Skip to content

Commit

Permalink
Replace type checking of DateTime with DateTimeInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaik Dean authored and greg0ire committed Nov 30, 2017
1 parent ee92cc9 commit 3330794
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Source/DoctrineODMQuerySourceIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ protected function getValue($value)
{
if (is_array($value) || $value instanceof \Traversable) {
$value = null;
} elseif ($value instanceof \DateTime) {
} elseif ($value instanceof \DateTimeInterface) {
$value = $value->format($this->dateTimeFormat);
} elseif (is_object($value)) {
$value = (string) $value;
Expand Down
2 changes: 1 addition & 1 deletion src/Source/DoctrineORMQuerySourceIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ protected function getValue($value)
{
if (is_array($value) || $value instanceof \Traversable) {
$value = null;
} elseif ($value instanceof \DateTime) {
} elseif ($value instanceof \DateTimeInterface) {
$value = $value->format($this->dateTimeFormat);
} elseif (is_object($value)) {
$value = (string) $value;
Expand Down
2 changes: 1 addition & 1 deletion src/Source/PropelCollectionSourceIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ protected function getValue($value)
{
if (is_array($value) || $value instanceof \Traversable) {
$value = null;
} elseif ($value instanceof \DateTime) {
} elseif ($value instanceof \DateTimeInterface) {
$value = $value->format($this->dateTimeFormat);
} elseif (is_object($value)) {
$value = (string) $value;
Expand Down

0 comments on commit 3330794

Please sign in to comment.