From 3330794c8fadfe8bf40cab312ee86ea6deb23fdf Mon Sep 17 00:00:00 2001 From: Jaik Dean Date: Thu, 30 Nov 2017 11:47:58 +0000 Subject: [PATCH] Replace type checking of DateTime with DateTimeInterface --- src/Source/DoctrineODMQuerySourceIterator.php | 2 +- src/Source/DoctrineORMQuerySourceIterator.php | 2 +- src/Source/PropelCollectionSourceIterator.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Source/DoctrineODMQuerySourceIterator.php b/src/Source/DoctrineODMQuerySourceIterator.php index 7a7e9faa..9f70433a 100644 --- a/src/Source/DoctrineODMQuerySourceIterator.php +++ b/src/Source/DoctrineODMQuerySourceIterator.php @@ -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; diff --git a/src/Source/DoctrineORMQuerySourceIterator.php b/src/Source/DoctrineORMQuerySourceIterator.php index 5fa3c1a8..f44c2e3c 100644 --- a/src/Source/DoctrineORMQuerySourceIterator.php +++ b/src/Source/DoctrineORMQuerySourceIterator.php @@ -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; diff --git a/src/Source/PropelCollectionSourceIterator.php b/src/Source/PropelCollectionSourceIterator.php index 725bc3f8..f2a5a043 100644 --- a/src/Source/PropelCollectionSourceIterator.php +++ b/src/Source/PropelCollectionSourceIterator.php @@ -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;