-
Notifications
You must be signed in to change notification settings - Fork 2
✨ DateTimeCollection #140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
✨ DateTimeCollection #140
Conversation
f4af396
to
c3ce9f0
Compare
fb4f00b
to
293f0d9
Compare
Refonte de la PR en prenant en compte les classes générées de la ✅ Tests unitaires effectués seulement sur les |
f9b3387
to
cb62abb
Compare
|
||
trait ContainsDateTimeNullableValueTrait | ||
{ | ||
public function containsDateTimeValue(\DateTime $dateTime): bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pourquoi on n'utilise pas \DateTImeInterface dans ce trait, mais on l'utilise dans l'autre ?
|
||
namespace Steevanb\PhpCollection\ObjectCollection\DateTime; | ||
|
||
trait ContainsDateTimeStrictValueTrait |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
j'ai pas précisé ailleurs dans la lib quand on n'a que le typage demandé, c'est quand on autorise null que j'ai précisé
trait ContainsDateTimeStrictValueTrait | |
trait ContainsDateTimeValueTrait |
{ | ||
foreach ($this->toArray() as $value) { | ||
if ( | ||
$value === null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
je me demande à quel point on peut ne faire qu'un seul trait, qui gère tous les cas.
ici on pourrait faire un $value instanceof \DateTime, et ne plus se soucier du nullable ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C'est pour qu'une collection "stricte" n'ait pas besoin de faire une vérification complémentaire.
* ✅ **Tested!** upon `\DateTime` * ✅ **Tested!** upon `\DateTimeImmutable` ✨ Features ========== * Define `containsDateTimeValue()` function for all `DateTimeInterfaceCollection` - Verify upon "date time + timezone" rather than object hash - Same for nullable `\DateTimeInterface`
cb62abb
to
6711335
Compare
✅ Tested! upon
\DateTime
✨ Features
containsDateTimeValue()
function for allDateTimeInterfaceCollection
\DateTimeInterface