-
Notifications
You must be signed in to change notification settings - Fork 136
Date refactorting to 5.5 #25
Date refactorting to 5.5 #25
Conversation
Tests please! |
thanks @Ocramius can you help me to write a good tests to coverage this feature? |
The particular path is not followed. You'd simply |
Why not? DateTime implement DateTimeinterface |
@gianarb but you are not testing that any implementation of |
@gianarb thanks for this ;) |
Little problem Thanks @fntlnz for your support :P |
@gianarb as it stands, you'd probably have to test with |
in this moment we have already wrote tests with DateTime, DateTime Immutable and stdClass |
This is pending of RFC with a proposal of Interface removal. This will take days or weeks. |
@@ -127,8 +127,7 @@ public function isValid($value) | |||
*/ | |||
protected function convertToDateTime($param, $addErrors = true) | |||
{ | |||
// @TODO: when minimum dependency will be PHP 5.5, we can only keep check against DateTimeInterface | |||
if ($param instanceof DateTime || $param instanceof DateTimeInterface) { | |||
if ($param instanceof DateTimeInterface) { |
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.
As per discussion with the internal folks (sigh), this should probably be:
if ($param instanceof DateTime || $param instanceof DateTimeImmutable) {
According to internal folks, DateTimeInterface
is not to be used.
No description provided.