@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | $this->addToAssertionCount(1); |
30 | 30 | } catch (QueryException $e) { |
31 | 31 | if ($debug) { |
32 | - echo $e->getTraceAsString() . PHP_EOL; |
|
32 | + echo $e->getTraceAsString().PHP_EOL; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | $this->fail($e->getMessage()); |
@@ -44,8 +44,8 @@ discard block |
||
44 | 44 | $this->fail('No syntax errors were detected, when syntax errors were expected'); |
45 | 45 | } catch (QueryException $e) { |
46 | 46 | if ($debug) { |
47 | - echo $e->getMessage() . PHP_EOL; |
|
48 | - echo $e->getTraceAsString() . PHP_EOL; |
|
47 | + echo $e->getMessage().PHP_EOL; |
|
48 | + echo $e->getTraceAsString().PHP_EOL; |
|
49 | 49 | } |
50 | 50 | $this->addToAssertionCount(1); |
51 | 51 | } |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | ['SELECT foo: FROM Doctrine\Tests\Models\CMS\CmsUser foo:'], |
108 | 108 | |
109 | 109 | /* Checks for invalid AbstractSchemaName */ |
110 | - ['SELECT u FROM UnknownClass u'], // unknown |
|
110 | + ['SELECT u FROM UnknownClass u'], // unknown |
|
111 | 111 | ['SELECT u FROM \Unknown\Class u'], // unknown, leading backslash |
112 | 112 | ['SELECT u FROM Unknown\\\\Class u'], // unknown, syntactically bogus (duplicate \\) |
113 | 113 | ['SELECT u FROM Unknown\Class\ u'], // unknown, syntactically bogus (trailing \) |
@@ -573,7 +573,7 @@ discard block |
||
573 | 573 | */ |
574 | 574 | public function testDQLKeywordInJoinIsAllowed() : void |
575 | 575 | { |
576 | - self::assertValidDQL('SELECT u FROM ' . __NAMESPACE__ . '\DQLKeywordsModelUser u JOIN u.group g'); |
|
576 | + self::assertValidDQL('SELECT u FROM '.__NAMESPACE__.'\DQLKeywordsModelUser u JOIN u.group g'); |
|
577 | 577 | } |
578 | 578 | |
579 | 579 | /** |
@@ -581,7 +581,7 @@ discard block |
||
581 | 581 | */ |
582 | 582 | public function testDQLKeywordInConditionIsAllowed() : void |
583 | 583 | { |
584 | - self::assertValidDQL('SELECT g FROM ' . __NAMESPACE__ . '\DQLKeywordsModelGroup g WHERE g.from=0'); |
|
584 | + self::assertValidDQL('SELECT g FROM '.__NAMESPACE__.'\DQLKeywordsModelGroup g WHERE g.from=0'); |
|
585 | 585 | } |
586 | 586 | |
587 | 587 | /* The exception is currently thrown in the SQLWalker, not earlier. |
@@ -686,7 +686,7 @@ discard block |
||
686 | 686 | */ |
687 | 687 | public function testNewLiteralExpression() : void |
688 | 688 | { |
689 | - self::assertValidDQL('SELECT new ' . __NAMESPACE__ . "\\DummyStruct(u.id, 'foo', 1, true) FROM Doctrine\Tests\Models\CMS\CmsUser u"); |
|
689 | + self::assertValidDQL('SELECT new '.__NAMESPACE__."\\DummyStruct(u.id, 'foo', 1, true) FROM Doctrine\Tests\Models\CMS\CmsUser u"); |
|
690 | 690 | } |
691 | 691 | |
692 | 692 | /** |
@@ -694,7 +694,7 @@ discard block |
||
694 | 694 | */ |
695 | 695 | public function testNewLiteralWithSubselectExpression() : void |
696 | 696 | { |
697 | - self::assertValidDQL('SELECT new ' . __NAMESPACE__ . "\\DummyStruct(u.id, 'foo', (SELECT 1 FROM Doctrine\Tests\Models\CMS\CmsUser su), true) FROM Doctrine\Tests\Models\CMS\CmsUser u"); |
|
697 | + self::assertValidDQL('SELECT new '.__NAMESPACE__."\\DummyStruct(u.id, 'foo', (SELECT 1 FROM Doctrine\Tests\Models\CMS\CmsUser su), true) FROM Doctrine\Tests\Models\CMS\CmsUser u"); |
|
698 | 698 | } |
699 | 699 | |
700 | 700 | public function testStringPrimaryAcceptsAggregateExpression() : void |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | { |
40 | 40 | $query = $this->em->createQuery( |
41 | 41 | 'SELECT CONCAT(e.type, MIN(e.version)) pair' |
42 | - . ' FROM ' . GH7286Entity::class . ' e' |
|
42 | + . ' FROM '.GH7286Entity::class.' e' |
|
43 | 43 | . ' WHERE e.type IS NOT NULL' |
44 | 44 | . ' GROUP BY e.type' |
45 | 45 | . ' ORDER BY e.type' |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | |
64 | 64 | $query = $this->em->createQuery( |
65 | 65 | 'SELECT CC(e.type, MIN(e.version)) pair' |
66 | - . ' FROM ' . GH7286Entity::class . ' e' |
|
66 | + . ' FROM '.GH7286Entity::class.' e' |
|
67 | 67 | . ' WHERE e.type IS NOT NULL AND e.type != :type' |
68 | 68 | . ' GROUP BY e.type' |
69 | 69 | ); |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | */ |
57 | 57 | public function generateProxyClasses(array $classes) : int |
58 | 58 | { |
59 | - $concreteClasses = array_filter($classes, static function (ClassMetadata $metadata) : bool { |
|
59 | + $concreteClasses = array_filter($classes, static function(ClassMetadata $metadata) : bool { |
|
60 | 60 | return ! ($metadata->isMappedSuperclass || $metadata->getReflectionClass()->isAbstract()); |
61 | 61 | }); |
62 | 62 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | ->proxyFactory |
66 | 66 | ->createProxy( |
67 | 67 | $metadata->getClassName(), |
68 | - static function () { |
|
68 | + static function() { |
|
69 | 69 | // empty closure, serves its purpose, for now |
70 | 70 | }, |
71 | 71 | $this->skippedFieldsFqns($metadata) |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | ->getUnitOfWork() |
90 | 90 | ->getEntityPersister($metadata->getClassName()); |
91 | 91 | |
92 | - $proxyInstance = $this |
|
92 | + $proxyInstance = $this |
|
93 | 93 | ->proxyFactory |
94 | 94 | ->createProxy( |
95 | 95 | $metadata->getClassName(), |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | |
109 | 109 | private function makeInitializer(ClassMetadata $metadata, EntityPersister $persister) : Closure |
110 | 110 | { |
111 | - return static function ( |
|
111 | + return static function( |
|
112 | 112 | GhostObjectInterface $ghostObject, |
113 | 113 | string $method, |
114 | 114 | // we don't care |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | $identifier = $persister->getIdentifier($ghostObject); |
127 | 127 | |
128 | 128 | // @TODO how do we use `$properties` in the persister? That would be a massive optimisation |
129 | - if (! $persister->loadById($identifier, $ghostObject)) { |
|
129 | + if ( ! $persister->loadById($identifier, $ghostObject)) { |
|
130 | 130 | $initializer = $originalInitializer; |
131 | 131 | |
132 | 132 | throw EntityNotFoundException::fromClassNameAndIdentifier( |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | $transientFieldsFqns = []; |
159 | 159 | |
160 | 160 | foreach ($metadata->getDeclaredPropertiesIterator() as $name => $property) { |
161 | - if (! $property instanceof TransientMetadata) { |
|
161 | + if ( ! $property instanceof TransientMetadata) { |
|
162 | 162 | continue; |
163 | 163 | } |
164 | 164 | |
@@ -196,11 +196,11 @@ discard block |
||
196 | 196 | private function propertyFqcn(ReflectionProperty $property) : string |
197 | 197 | { |
198 | 198 | if ($property->isPrivate()) { |
199 | - return "\0" . $property->getDeclaringClass()->getName() . "\0" . $property->getName(); |
|
199 | + return "\0".$property->getDeclaringClass()->getName()."\0".$property->getName(); |
|
200 | 200 | } |
201 | 201 | |
202 | 202 | if ($property->isProtected()) { |
203 | - return "\0*\0" . $property->getName(); |
|
203 | + return "\0*\0".$property->getName(); |
|
204 | 204 | } |
205 | 205 | |
206 | 206 | return $property->getName(); |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | public function getParameter($key) |
301 | 301 | { |
302 | 302 | $filteredParameters = $this->parameters->filter( |
303 | - static function (Query\Parameter $parameter) use ($key) : bool { |
|
303 | + static function(Query\Parameter $parameter) use ($key) : bool { |
|
304 | 304 | $parameterName = $parameter->getName(); |
305 | 305 | |
306 | 306 | return $key === $parameterName || (string) $key === (string) $parameterName; |
@@ -716,7 +716,7 @@ discard block |
||
716 | 716 | return null; |
717 | 717 | } |
718 | 718 | |
719 | - if (! is_array($result)) { |
|
719 | + if ( ! is_array($result)) { |
|
720 | 720 | return $result; |
721 | 721 | } |
722 | 722 | |
@@ -750,7 +750,7 @@ discard block |
||
750 | 750 | throw new NoResultException(); |
751 | 751 | } |
752 | 752 | |
753 | - if (! is_array($result)) { |
|
753 | + if ( ! is_array($result)) { |
|
754 | 754 | return $result; |
755 | 755 | } |
756 | 756 | |
@@ -840,7 +840,7 @@ discard block |
||
840 | 840 | $this->setHydrationMode($hydrationMode); |
841 | 841 | } |
842 | 842 | |
843 | - if (! empty($parameters)) { |
|
843 | + if ( ! empty($parameters)) { |
|
844 | 844 | $this->setParameters($parameters); |
845 | 845 | } |
846 | 846 | |
@@ -879,11 +879,11 @@ discard block |
||
879 | 879 | $this->setHydrationMode($hydrationMode); |
880 | 880 | } |
881 | 881 | |
882 | - if (! empty($parameters)) { |
|
882 | + if ( ! empty($parameters)) { |
|
883 | 883 | $this->setParameters($parameters); |
884 | 884 | } |
885 | 885 | |
886 | - $setCacheEntry = static function () { |
|
886 | + $setCacheEntry = static function() { |
|
887 | 887 | }; |
888 | 888 | |
889 | 889 | if ($this->hydrationCacheProfile !== null) { |
@@ -897,11 +897,11 @@ discard block |
||
897 | 897 | return $result[$realCacheKey]; |
898 | 898 | } |
899 | 899 | |
900 | - if (! $result) { |
|
900 | + if ( ! $result) { |
|
901 | 901 | $result = []; |
902 | 902 | } |
903 | 903 | |
904 | - $setCacheEntry = static function ($data) use ($cache, $result, $cacheKey, $realCacheKey, $queryCacheProfile) { |
|
904 | + $setCacheEntry = static function($data) use ($cache, $result, $cacheKey, $realCacheKey, $queryCacheProfile) { |
|
905 | 905 | $result[$realCacheKey] = $data; |
906 | 906 | |
907 | 907 | $cache->save($cacheKey, $result, $queryCacheProfile->getLifetime()); |
@@ -1063,7 +1063,7 @@ discard block |
||
1063 | 1063 | { |
1064 | 1064 | $query = $this->getSQL(); |
1065 | 1065 | $hints = $this->getHints(); |
1066 | - $params = array_map(function (Parameter $parameter) { |
|
1066 | + $params = array_map(function(Parameter $parameter) { |
|
1067 | 1067 | $value = $parameter->getValue(); |
1068 | 1068 | |
1069 | 1069 | // Small optimization |
@@ -1077,6 +1077,6 @@ discard block |
||
1077 | 1077 | |
1078 | 1078 | ksort($hints); |
1079 | 1079 | |
1080 | - return sha1($query . '-' . serialize($params) . '-' . serialize($hints)); |
|
1080 | + return sha1($query.'-'.serialize($params).'-'.serialize($hints)); |
|
1081 | 1081 | } |
1082 | 1082 | } |
@@ -1353,9 +1353,9 @@ discard block |
||
1353 | 1353 | private function getDQLForDelete() |
1354 | 1354 | { |
1355 | 1355 | return 'DELETE' |
1356 | - . $this->getReducedDQLQueryPart('from', ['pre' => ' ', 'separator' => ', ']) |
|
1357 | - . $this->getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
1358 | - . $this->getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
1356 | + . $this->getReducedDQLQueryPart('from', ['pre' => ' ', 'separator' => ', ']) |
|
1357 | + . $this->getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
1358 | + . $this->getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
1359 | 1359 | } |
1360 | 1360 | |
1361 | 1361 | /** |
@@ -1364,10 +1364,10 @@ discard block |
||
1364 | 1364 | private function getDQLForUpdate() |
1365 | 1365 | { |
1366 | 1366 | return 'UPDATE' |
1367 | - . $this->getReducedDQLQueryPart('from', ['pre' => ' ', 'separator' => ', ']) |
|
1368 | - . $this->getReducedDQLQueryPart('set', ['pre' => ' SET ', 'separator' => ', ']) |
|
1369 | - . $this->getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
1370 | - . $this->getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
1367 | + . $this->getReducedDQLQueryPart('from', ['pre' => ' ', 'separator' => ', ']) |
|
1368 | + . $this->getReducedDQLQueryPart('set', ['pre' => ' SET ', 'separator' => ', ']) |
|
1369 | + . $this->getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
1370 | + . $this->getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
1371 | 1371 | } |
1372 | 1372 | |
1373 | 1373 | /** |
@@ -1376,8 +1376,8 @@ discard block |
||
1376 | 1376 | private function getDQLForSelect() |
1377 | 1377 | { |
1378 | 1378 | $dql = 'SELECT' |
1379 | - . ($this->dqlParts['distinct']===true ? ' DISTINCT' : '') |
|
1380 | - . $this->getReducedDQLQueryPart('select', ['pre' => ' ', 'separator' => ', ']); |
|
1379 | + . ($this->dqlParts['distinct']===true ? ' DISTINCT' : '') |
|
1380 | + . $this->getReducedDQLQueryPart('select', ['pre' => ' ', 'separator' => ', ']); |
|
1381 | 1381 | |
1382 | 1382 | $fromParts = $this->getDQLPart('from'); |
1383 | 1383 | $joinParts = $this->getDQLPart('join'); |
@@ -1401,10 +1401,10 @@ discard block |
||
1401 | 1401 | } |
1402 | 1402 | |
1403 | 1403 | return $dql . implode(', ', $fromClauses) |
1404 | - . $this->getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
1405 | - . $this->getReducedDQLQueryPart('groupBy', ['pre' => ' GROUP BY ', 'separator' => ', ']) |
|
1406 | - . $this->getReducedDQLQueryPart('having', ['pre' => ' HAVING ']) |
|
1407 | - . $this->getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
1404 | + . $this->getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
1405 | + . $this->getReducedDQLQueryPart('groupBy', ['pre' => ' GROUP BY ', 'separator' => ', ']) |
|
1406 | + . $this->getReducedDQLQueryPart('having', ['pre' => ' HAVING ']) |
|
1407 | + . $this->getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
1408 | 1408 | } |
1409 | 1409 | |
1410 | 1410 | /** |
@@ -1422,8 +1422,8 @@ discard block |
||
1422 | 1422 | } |
1423 | 1423 | |
1424 | 1424 | return ($options['pre'] ?? '') |
1425 | - . (is_array($queryPart) ? implode($options['separator'], $queryPart) : $queryPart) |
|
1426 | - . ($options['post'] ?? ''); |
|
1425 | + . (is_array($queryPart) ? implode($options['separator'], $queryPart) : $queryPart) |
|
1426 | + . ($options['post'] ?? ''); |
|
1427 | 1427 | } |
1428 | 1428 | |
1429 | 1429 | /** |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | { |
418 | 418 | $aliases = $this->getRootAliases(); |
419 | 419 | |
420 | - if (! isset($aliases[0])) { |
|
420 | + if ( ! isset($aliases[0])) { |
|
421 | 421 | throw new RuntimeException('No alias was set before invoking getRootAlias().'); |
422 | 422 | } |
423 | 423 | |
@@ -600,7 +600,7 @@ discard block |
||
600 | 600 | public function getParameter($key) |
601 | 601 | { |
602 | 602 | $filteredParameters = $this->parameters->filter( |
603 | - static function (Query\Parameter $parameter) use ($key) : bool { |
|
603 | + static function(Query\Parameter $parameter) use ($key) : bool { |
|
604 | 604 | $parameterName = $parameter->getName(); |
605 | 605 | |
606 | 606 | return $key === $parameterName || (string) $key === (string) $parameterName; |
@@ -676,7 +676,7 @@ discard block |
||
676 | 676 | { |
677 | 677 | if ($append && ($dqlPartName === 'where' || $dqlPartName === 'having')) { |
678 | 678 | throw new InvalidArgumentException( |
679 | - "Using \$append = true does not have an effect with 'where' or 'having' " . |
|
679 | + "Using \$append = true does not have an effect with 'where' or 'having' ". |
|
680 | 680 | 'parts. See QueryBuilder#andWhere() for an example for correct usage.' |
681 | 681 | ); |
682 | 682 | } |
@@ -817,7 +817,7 @@ discard block |
||
817 | 817 | { |
818 | 818 | $this->type = self::DELETE; |
819 | 819 | |
820 | - if (! $delete) { |
|
820 | + if ( ! $delete) { |
|
821 | 821 | return $this; |
822 | 822 | } |
823 | 823 | |
@@ -844,7 +844,7 @@ discard block |
||
844 | 844 | { |
845 | 845 | $this->type = self::UPDATE; |
846 | 846 | |
847 | - if (! $update) { |
|
847 | + if ( ! $update) { |
|
848 | 848 | return $this; |
849 | 849 | } |
850 | 850 | |
@@ -899,7 +899,7 @@ discard block |
||
899 | 899 | { |
900 | 900 | $rootAliases = $this->getRootAliases(); |
901 | 901 | |
902 | - if (! in_array($alias, $rootAliases, true)) { |
|
902 | + if ( ! in_array($alias, $rootAliases, true)) { |
|
903 | 903 | throw new Query\QueryException( |
904 | 904 | sprintf('Specified root alias %s must be set before invoking indexBy().', $alias) |
905 | 905 | ); |
@@ -1060,7 +1060,7 @@ discard block |
||
1060 | 1060 | */ |
1061 | 1061 | public function where($predicates) |
1062 | 1062 | { |
1063 | - if (! (func_num_args() === 1 && $predicates instanceof Expr\Composite)) { |
|
1063 | + if ( ! (func_num_args() === 1 && $predicates instanceof Expr\Composite)) { |
|
1064 | 1064 | $predicates = new Expr\Andx(func_get_args()); |
1065 | 1065 | } |
1066 | 1066 | |
@@ -1179,7 +1179,7 @@ discard block |
||
1179 | 1179 | */ |
1180 | 1180 | public function having($having) |
1181 | 1181 | { |
1182 | - if (! (func_num_args() === 1 && ($having instanceof Expr\Andx || $having instanceof Expr\Orx))) { |
|
1182 | + if ( ! (func_num_args() === 1 && ($having instanceof Expr\Andx || $having instanceof Expr\Orx))) { |
|
1183 | 1183 | $having = new Expr\Andx(func_get_args()); |
1184 | 1184 | } |
1185 | 1185 | |
@@ -1277,7 +1277,7 @@ discard block |
||
1277 | 1277 | public function addCriteria(Criteria $criteria) |
1278 | 1278 | { |
1279 | 1279 | $allAliases = $this->getAllAliases(); |
1280 | - if (! isset($allAliases[0])) { |
|
1280 | + if ( ! isset($allAliases[0])) { |
|
1281 | 1281 | throw new Query\QueryException('No aliases are set before invoking addCriteria().'); |
1282 | 1282 | } |
1283 | 1283 | |
@@ -1295,14 +1295,14 @@ discard block |
||
1295 | 1295 | foreach ($criteria->getOrderings() as $sort => $order) { |
1296 | 1296 | $hasValidAlias = false; |
1297 | 1297 | foreach ($allAliases as $alias) { |
1298 | - if (strpos($sort . '.', $alias . '.') === 0) { |
|
1298 | + if (strpos($sort.'.', $alias.'.') === 0) { |
|
1299 | 1299 | $hasValidAlias = true; |
1300 | 1300 | break; |
1301 | 1301 | } |
1302 | 1302 | } |
1303 | 1303 | |
1304 | - if (! $hasValidAlias) { |
|
1305 | - $sort = $allAliases[0] . '.' . $sort; |
|
1304 | + if ( ! $hasValidAlias) { |
|
1305 | + $sort = $allAliases[0].'.'.$sort; |
|
1306 | 1306 | } |
1307 | 1307 | |
1308 | 1308 | $this->addOrderBy($sort, $order); |
@@ -1376,7 +1376,7 @@ discard block |
||
1376 | 1376 | private function getDQLForSelect() |
1377 | 1377 | { |
1378 | 1378 | $dql = 'SELECT' |
1379 | - . ($this->dqlParts['distinct']===true ? ' DISTINCT' : '') |
|
1379 | + . ($this->dqlParts['distinct'] === true ? ' DISTINCT' : '') |
|
1380 | 1380 | . $this->getReducedDQLQueryPart('select', ['pre' => ' ', 'separator' => ', ']); |
1381 | 1381 | |
1382 | 1382 | $fromParts = $this->getDQLPart('from'); |
@@ -1384,7 +1384,7 @@ discard block |
||
1384 | 1384 | $fromClauses = []; |
1385 | 1385 | |
1386 | 1386 | // Loop through all FROM clauses |
1387 | - if (! empty($fromParts)) { |
|
1387 | + if ( ! empty($fromParts)) { |
|
1388 | 1388 | $dql .= ' FROM '; |
1389 | 1389 | |
1390 | 1390 | foreach ($fromParts as $from) { |
@@ -1392,7 +1392,7 @@ discard block |
||
1392 | 1392 | |
1393 | 1393 | if ($from instanceof Expr\From && isset($joinParts[$from->getAlias()])) { |
1394 | 1394 | foreach ($joinParts[$from->getAlias()] as $join) { |
1395 | - $fromClause .= ' ' . ((string) $join); |
|
1395 | + $fromClause .= ' '.((string) $join); |
|
1396 | 1396 | } |
1397 | 1397 | } |
1398 | 1398 | |
@@ -1400,7 +1400,7 @@ discard block |
||
1400 | 1400 | } |
1401 | 1401 | } |
1402 | 1402 | |
1403 | - return $dql . implode(', ', $fromClauses) |
|
1403 | + return $dql.implode(', ', $fromClauses) |
|
1404 | 1404 | . $this->getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
1405 | 1405 | . $this->getReducedDQLQueryPart('groupBy', ['pre' => ' GROUP BY ', 'separator' => ', ']) |
1406 | 1406 | . $this->getReducedDQLQueryPart('having', ['pre' => ' HAVING ']) |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | public static function scheduleInsertForManagedEntity($entity) |
32 | 32 | { |
33 | - return new self('A managed+dirty entity ' . self::objToStr($entity) . ' can not be scheduled for insertion.'); |
|
33 | + return new self('A managed+dirty entity '.self::objToStr($entity).' can not be scheduled for insertion.'); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public static function scheduleInsertForRemovedEntity($entity) |
42 | 42 | { |
43 | - return new self('Removed entity ' . self::objToStr($entity) . ' can not be scheduled for insertion.'); |
|
43 | + return new self('Removed entity '.self::objToStr($entity).' can not be scheduled for insertion.'); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | */ |
51 | 51 | public static function scheduleInsertTwice($entity) |
52 | 52 | { |
53 | - return new self('Entity ' . self::objToStr($entity) . ' can not be scheduled for insertion twice.'); |
|
53 | + return new self('Entity '.self::objToStr($entity).' can not be scheduled for insertion twice.'); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | public static function entityWithoutIdentity($className, $entity) |
63 | 63 | { |
64 | 64 | return new self( |
65 | - "The given entity of type '" . $className . "' (" . self::objToStr($entity) . ') has no identity/no ' . |
|
65 | + "The given entity of type '".$className."' (".self::objToStr($entity).') has no identity/no '. |
|
66 | 66 | 'id values set. It cannot be added to the identity map.' |
67 | 67 | ); |
68 | 68 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | */ |
75 | 75 | public static function readOnlyRequiresManagedEntity($entity) |
76 | 76 | { |
77 | - return new self('Only managed entities can be marked or checked as read only. But ' . self::objToStr($entity) . ' is not'); |
|
77 | + return new self('Only managed entities can be marked or checked as read only. But '.self::objToStr($entity).' is not'); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | /** |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | public static function newEntitiesFoundThroughRelationships($newEntitiesWithAssociations) |
86 | 86 | { |
87 | 87 | $errorMessages = array_map( |
88 | - static function (array $newEntityWithAssociation) : string { |
|
88 | + static function(array $newEntityWithAssociation) : string { |
|
89 | 89 | [$associationMetadata, $entity] = $newEntityWithAssociation; |
90 | 90 | |
91 | 91 | return self::newEntityFoundThroughRelationshipMessage($associationMetadata, $entity); |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | */ |
155 | 155 | public static function entityNotManaged($entity) |
156 | 156 | { |
157 | - return new self('Entity ' . self::objToStr($entity) . ' is not managed. An entity is managed if its fetched ' . |
|
157 | + return new self('Entity '.self::objToStr($entity).' is not managed. An entity is managed if its fetched '. |
|
158 | 158 | 'from the database or registered as new through EntityManager#persist'); |
159 | 159 | } |
160 | 160 | |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | */ |
167 | 167 | public static function entityHasNoIdentity($entity, $operation) |
168 | 168 | { |
169 | - return new self('Entity has no identity, therefore ' . $operation . ' cannot be performed. ' . self::objToStr($entity)); |
|
169 | + return new self('Entity has no identity, therefore '.$operation.' cannot be performed. '.self::objToStr($entity)); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | /** |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | */ |
178 | 178 | public static function entityIsRemoved($entity, $operation) |
179 | 179 | { |
180 | - return new self('Entity is removed, therefore ' . $operation . ' cannot be performed. ' . self::objToStr($entity)); |
|
180 | + return new self('Entity is removed, therefore '.$operation.' cannot be performed. '.self::objToStr($entity)); |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | /** |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | */ |
189 | 189 | public static function detachedEntityCannot($entity, $operation) |
190 | 190 | { |
191 | - return new self('Detached entity ' . self::objToStr($entity) . ' cannot be ' . $operation); |
|
191 | + return new self('Detached entity '.self::objToStr($entity).' cannot be '.$operation); |
|
192 | 192 | } |
193 | 193 | |
194 | 194 | /** |
@@ -200,8 +200,8 @@ discard block |
||
200 | 200 | */ |
201 | 201 | public static function invalidObject($context, $given, $parameterIndex = 1) |
202 | 202 | { |
203 | - return new self($context . ' expects parameter ' . $parameterIndex . |
|
204 | - ' to be an entity object, ' . gettype($given) . ' given.'); |
|
203 | + return new self($context.' expects parameter '.$parameterIndex. |
|
204 | + ' to be an entity object, '.gettype($given).' given.'); |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | /** |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | */ |
210 | 210 | public static function invalidCompositeIdentifier() |
211 | 211 | { |
212 | - return new self('Binding an entity with a composite primary key to a query is not supported. ' . |
|
212 | + return new self('Binding an entity with a composite primary key to a query is not supported. '. |
|
213 | 213 | 'You should split the parameter into the explicit fields and bind them separately.'); |
214 | 214 | } |
215 | 215 | |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | */ |
247 | 247 | private static function objToStr($obj) : string |
248 | 248 | { |
249 | - return method_exists($obj, '__toString') ? (string) $obj : get_class($obj) . '@' . spl_object_id($obj); |
|
249 | + return method_exists($obj, '__toString') ? (string) $obj : get_class($obj).'@'.spl_object_id($obj); |
|
250 | 250 | } |
251 | 251 | |
252 | 252 | /** |
@@ -255,15 +255,15 @@ discard block |
||
255 | 255 | private static function newEntityFoundThroughRelationshipMessage(AssociationMetadata $association, $entity) : string |
256 | 256 | { |
257 | 257 | return 'A new entity was found through the relationship \'' |
258 | - . $association->getSourceEntity() . '#' . $association->getName() . '\' that was not' |
|
259 | - . ' configured to cascade persist operations for entity: ' . self::objToStr($entity) . '.' |
|
258 | + . $association->getSourceEntity().'#'.$association->getName().'\' that was not' |
|
259 | + . ' configured to cascade persist operations for entity: '.self::objToStr($entity).'.' |
|
260 | 260 | . ' To solve this issue: Either explicitly call EntityManager#persist()' |
261 | 261 | . ' on this unknown entity or configure cascade persist' |
262 | 262 | . ' this association in the mapping for example @ManyToOne(..,cascade={"persist"}).' |
263 | 263 | . (method_exists($entity, '__toString') |
264 | 264 | ? '' |
265 | 265 | : ' If you cannot find out which entity causes the problem implement \'' |
266 | - . $association->getTargetEntity() . '#__toString()\' to get a clue.' |
|
266 | + . $association->getTargetEntity().'#__toString()\' to get a clue.' |
|
267 | 267 | ); |
268 | 268 | } |
269 | 269 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | // remove namespace separators from remaining class name |
47 | 47 | $fileName = str_replace('\\', '', $classNameRelativeToMetadataNamespace); |
48 | 48 | |
49 | - return $metadataDir . DIRECTORY_SEPARATOR . $fileName . '.php'; |
|
49 | + return $metadataDir.DIRECTORY_SEPARATOR.$fileName.'.php'; |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | ) : Closure { |
64 | 64 | $metadataNamespace = ltrim($metadataNamespace, '\\'); |
65 | 65 | |
66 | - if (! ($notFoundCallback === null || is_callable($notFoundCallback))) { |
|
66 | + if ( ! ($notFoundCallback === null || is_callable($notFoundCallback))) { |
|
67 | 67 | $type = is_object($notFoundCallback) ? get_class($notFoundCallback) : gettype($notFoundCallback); |
68 | 68 | |
69 | 69 | throw new InvalidArgumentException( |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | ); |
72 | 72 | } |
73 | 73 | |
74 | - $autoloader = static function ($className) use ($metadataDir, $metadataNamespace, $notFoundCallback) { |
|
74 | + $autoloader = static function($className) use ($metadataDir, $metadataNamespace, $notFoundCallback) { |
|
75 | 75 | if (strpos($className, $metadataNamespace) === 0) { |
76 | 76 | $file = Autoloader::resolveFile($metadataDir, $metadataNamespace, $className); |
77 | 77 |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | $this->ensureDirectoryIsReady(dirname($filePath)); |
38 | 38 | |
39 | - $tmpFileName = $filePath . '.' . uniqid('', true); |
|
39 | + $tmpFileName = $filePath.'.'.uniqid('', true); |
|
40 | 40 | |
41 | 41 | file_put_contents($tmpFileName, $sourceCode); |
42 | 42 | @chmod($tmpFileName, 0664); |
@@ -50,11 +50,11 @@ discard block |
||
50 | 50 | */ |
51 | 51 | private function ensureDirectoryIsReady(string $directory) |
52 | 52 | { |
53 | - if (! is_dir($directory) && (@mkdir($directory, 0775, true) === false)) { |
|
53 | + if ( ! is_dir($directory) && (@mkdir($directory, 0775, true) === false)) { |
|
54 | 54 | throw new RuntimeException(sprintf('Your metadata directory "%s" must be writable', $directory)); |
55 | 55 | } |
56 | 56 | |
57 | - if (! is_writable($directory)) { |
|
57 | + if ( ! is_writable($directory)) { |
|
58 | 58 | throw new RuntimeException(sprintf('Your proxy directory "%s" must be writable', $directory)); |
59 | 59 | } |
60 | 60 | } |
@@ -42,7 +42,7 @@ |
||
42 | 42 | */ |
43 | 43 | public function register($object) |
44 | 44 | { |
45 | - if (! is_object($object)) { |
|
45 | + if ( ! is_object($object)) { |
|
46 | 46 | throw new InvalidArgumentException(sprintf('An object was expected, but got "%s".', gettype($object))); |
47 | 47 | } |
48 | 48 |