diff --git a/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php b/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php index bb5bcb4df48..a6dc7a4aa37 100644 --- a/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php +++ b/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php @@ -10,14 +10,11 @@ use Doctrine\ORM\PersistentCollection; use Doctrine\ORM\Query; use Doctrine\ORM\UnitOfWork; -use ReflectionClass; -use ReflectionException; use function array_fill_keys; use function array_key_exists; use function array_keys; use function array_map; -use function assert; use function count; use function is_array; use function key; @@ -570,7 +567,6 @@ protected function hydrateRowData(array $row, array &$result) foreach ($rowData['newObjects'] as $objIndex => $newObject) { $class = $newObject['class']; - assert($class instanceof ReflectionClass); $args = $newObject['args']; if (PHP_VERSION_ID >= 80000) { diff --git a/lib/Doctrine/ORM/Query/Parser.php b/lib/Doctrine/ORM/Query/Parser.php index 2236de5d77e..a2060870164 100644 --- a/lib/Doctrine/ORM/Query/Parser.php +++ b/lib/Doctrine/ORM/Query/Parser.php @@ -1922,7 +1922,7 @@ public function NewObjectExpression() while ($this->lexer->isNextToken(Lexer::T_COMMA)) { $this->match(Lexer::T_COMMA); if ($this->lexer->isNextToken(Lexer::T_CLOSE_PARENTHESIS)) { - // Comma above is a trailling comma, ignore it + // Comma above is a trailing comma, ignore it break; } diff --git a/tests/Doctrine/Tests/ORM/Functional/NewOperatorTest.php b/tests/Doctrine/Tests/ORM/Functional/NewOperatorTest.php index 952c6f1f44f..34db6a3e8f3 100644 --- a/tests/Doctrine/Tests/ORM/Functional/NewOperatorTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/NewOperatorTest.php @@ -1076,13 +1076,12 @@ public function testClassCantBeInstantiatedException(): void $this->_em->createQuery($dql)->getResult(); } - /** @return array */ + /** @return array */ public static function provideQueriesWithNamedArguments(): array { return [ 'Only named arguments in order' => [ - 'query' => ' - SELECT + 'SELECT new Doctrine\Tests\Models\CMS\CmsUserDTO( name: u.name, email: e.email, @@ -1098,8 +1097,7 @@ public static function provideQueriesWithNamedArguments(): array u.name', ], 'Only named arguments not in order' => [ - 'query' => ' - SELECT + 'SELECT new Doctrine\Tests\Models\CMS\CmsUserDTO( email: e.email, name: u.name, @@ -1115,8 +1113,7 @@ public static function provideQueriesWithNamedArguments(): array u.name', ], 'Both named and unnamed arguments' => [ - 'query' => ' - SELECT + 'SELECT new Doctrine\Tests\Models\CMS\CmsUserDTO( u.name, address: a.city, @@ -1131,9 +1128,8 @@ public static function provideQueriesWithNamedArguments(): array ORDER BY u.name', ], - 'Both named and unnamed arguments without trailling comma' => [ - 'query' => ' - SELECT + 'Both named and unnamed arguments without trailing comma' => [ + 'SELECT new Doctrine\Tests\Models\CMS\CmsUserDTO( u.name, address: a.city,