Skip to content

Commit

Permalink
Make CS check happy
Browse files Browse the repository at this point in the history
  • Loading branch information
vhenzl committed Dec 5, 2020
1 parent bea8671 commit 36effa0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions lib/Doctrine/ORM/Query/ParameterTypeInferer.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

namespace Doctrine\ORM\Query;

use DateTimeImmutable;
use DateTimeInterface;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Types\Type;

Expand Down Expand Up @@ -53,11 +55,11 @@ public static function inferType($value)
return Type::BOOLEAN;
}

if ($value instanceof \DateTimeImmutable) {
if ($value instanceof DateTimeImmutable) {
return Type::DATETIME_IMMUTABLE;
}

if ($value instanceof \DateTimeInterface) {
if ($value instanceof DateTimeInterface) {
return Type::DATETIME;
}

Expand Down
3 changes: 2 additions & 1 deletion tests/Doctrine/Tests/ORM/Query/ParameterTypeInfererTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Doctrine\Tests\ORM\Query;

use DateTimeImmutable;
use Doctrine\ORM\Query\ParameterTypeInferer;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Types\Type;
Expand All @@ -18,7 +19,7 @@ public function providerParameterTypeInferer()
["bar", PDO::PARAM_STR],
["1", PDO::PARAM_STR],
[new \DateTime, Type::DATETIME],
[new \DateTimeImmutable(), Type::DATETIME_IMMUTABLE],
[new DateTimeImmutable(), Type::DATETIME_IMMUTABLE],
[new \DateInterval('P1D'), Type::DATEINTERVAL],
[[2], Connection::PARAM_INT_ARRAY],
[["foo"], Connection::PARAM_STR_ARRAY],
Expand Down

0 comments on commit 36effa0

Please sign in to comment.