@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | 9 => "St Julien" |
166 | 166 | ]; |
167 | 167 | |
168 | - $query = $this->_em |
|
168 | + $query = $this->_em |
|
169 | 169 | ->createQuery("SELECT a FROM Doctrine\Tests\Models\CMS\CmsAddress a WHERE a.city IN (:cities)") |
170 | 170 | ->setParameter('cities', $cities); |
171 | 171 | |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | */ |
182 | 182 | public function testProcessParameterValueClassMetadata() |
183 | 183 | { |
184 | - $query = $this->_em->createQuery("SELECT a FROM Doctrine\Tests\Models\CMS\CmsAddress a WHERE a.city IN (:cities)"); |
|
184 | + $query = $this->_em->createQuery("SELECT a FROM Doctrine\Tests\Models\CMS\CmsAddress a WHERE a.city IN (:cities)"); |
|
185 | 185 | $this->assertEquals( |
186 | 186 | CmsAddress::class, |
187 | 187 | $query->processParameterValue($this->_em->getClassMetadata(CmsAddress::class)) |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | */ |
311 | 311 | public function testGetParameterTypeJuggling() : void |
312 | 312 | { |
313 | - $query = $this->_em->createQuery('select u from ' . CmsUser::class . ' u where u.id = ?0'); |
|
313 | + $query = $this->_em->createQuery('select u from '.CmsUser::class.' u where u.id = ?0'); |
|
314 | 314 | |
315 | 315 | $query->setParameter(0, 0); |
316 | 316 | |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | */ |
325 | 325 | public function testSetParameterWithNameZeroIsNotOverridden() : void |
326 | 326 | { |
327 | - $query = $this->_em->createQuery('select u from ' . CmsUser::class . ' u where u.id != ?0 and u.username = :name'); |
|
327 | + $query = $this->_em->createQuery('select u from '.CmsUser::class.' u where u.id != ?0 and u.username = :name'); |
|
328 | 328 | |
329 | 329 | $query->setParameter(0, 0); |
330 | 330 | $query->setParameter('name', 'Doctrine'); |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | */ |
340 | 340 | public function testSetParameterWithNameZeroDoesNotOverrideAnotherParameter() : void |
341 | 341 | { |
342 | - $query = $this->_em->createQuery('select u from ' . CmsUser::class . ' u where u.id != ?0 and u.username = :name'); |
|
342 | + $query = $this->_em->createQuery('select u from '.CmsUser::class.' u where u.id != ?0 and u.username = :name'); |
|
343 | 343 | |
344 | 344 | $query->setParameter('name', 'Doctrine'); |
345 | 345 | $query->setParameter(0, 0); |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | */ |
355 | 355 | public function testSetParameterWithTypeJugglingWorks() |
356 | 356 | { |
357 | - $query = $this->_em->createQuery('select u from ' . CmsUser::class . ' u where u.id != ?0 and u.username = :name'); |
|
357 | + $query = $this->_em->createQuery('select u from '.CmsUser::class.' u where u.id != ?0 and u.username = :name'); |
|
358 | 358 | |
359 | 359 | $query->setParameter('0', 1); |
360 | 360 | $query->setParameter('name', 'Doctrine'); |
@@ -603,7 +603,7 @@ discard block |
||
603 | 603 | public function getParameter($key) |
604 | 604 | { |
605 | 605 | $filteredParameters = $this->parameters->filter( |
606 | - function (Query\Parameter $parameter) use ($key) : bool { |
|
606 | + function(Query\Parameter $parameter) use ($key) : bool { |
|
607 | 607 | $parameterName = $parameter->getName(); |
608 | 608 | |
609 | 609 | return $key === $parameterName || (string) $key === (string) $parameterName; |
@@ -685,7 +685,7 @@ discard block |
||
685 | 685 | } |
686 | 686 | |
687 | 687 | $isMultiple = is_array($this->_dqlParts[$dqlPartName]) |
688 | - && !($dqlPartName == 'join' && !$append); |
|
688 | + && ! ($dqlPartName == 'join' && ! $append); |
|
689 | 689 | |
690 | 690 | // Allow adding any part retrieved from self::getDQLParts(). |
691 | 691 | if (is_array($dqlPart) && $dqlPartName != 'join') { |
@@ -902,7 +902,7 @@ discard block |
||
902 | 902 | { |
903 | 903 | $rootAliases = $this->getRootAliases(); |
904 | 904 | |
905 | - if (!in_array($alias, $rootAliases)) { |
|
905 | + if ( ! in_array($alias, $rootAliases)) { |
|
906 | 906 | throw new Query\QueryException( |
907 | 907 | sprintf('Specified root alias %s must be set before invoking indexBy().', $alias) |
908 | 908 | ); |
@@ -1304,15 +1304,15 @@ discard block |
||
1304 | 1304 | foreach ($criteria->getOrderings() as $sort => $order) { |
1305 | 1305 | |
1306 | 1306 | $hasValidAlias = false; |
1307 | - foreach($allAliases as $alias) { |
|
1308 | - if(strpos($sort . '.', $alias . '.') === 0) { |
|
1307 | + foreach ($allAliases as $alias) { |
|
1308 | + if (strpos($sort.'.', $alias.'.') === 0) { |
|
1309 | 1309 | $hasValidAlias = true; |
1310 | 1310 | break; |
1311 | 1311 | } |
1312 | 1312 | } |
1313 | 1313 | |
1314 | - if(!$hasValidAlias) { |
|
1315 | - $sort = $allAliases[0] . '.' . $sort; |
|
1314 | + if ( ! $hasValidAlias) { |
|
1315 | + $sort = $allAliases[0].'.'.$sort; |
|
1316 | 1316 | } |
1317 | 1317 | |
1318 | 1318 | $this->addOrderBy($sort, $order); |
@@ -1385,7 +1385,7 @@ discard block |
||
1385 | 1385 | private function _getDQLForSelect() |
1386 | 1386 | { |
1387 | 1387 | $dql = 'SELECT' |
1388 | - . ($this->_dqlParts['distinct']===true ? ' DISTINCT' : '') |
|
1388 | + . ($this->_dqlParts['distinct'] === true ? ' DISTINCT' : '') |
|
1389 | 1389 | . $this->_getReducedDQLQueryPart('select', ['pre' => ' ', 'separator' => ', ']); |
1390 | 1390 | |
1391 | 1391 | $fromParts = $this->getDQLPart('from'); |
@@ -1401,7 +1401,7 @@ discard block |
||
1401 | 1401 | |
1402 | 1402 | if ($from instanceof Expr\From && isset($joinParts[$from->getAlias()])) { |
1403 | 1403 | foreach ($joinParts[$from->getAlias()] as $join) { |
1404 | - $fromClause .= ' ' . ((string) $join); |
|
1404 | + $fromClause .= ' '.((string) $join); |
|
1405 | 1405 | } |
1406 | 1406 | } |
1407 | 1407 |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | public function getParameter($key) |
322 | 322 | { |
323 | 323 | $filteredParameters = $this->parameters->filter( |
324 | - function (Query\Parameter $parameter) use ($key) : bool { |
|
324 | + function(Query\Parameter $parameter) use ($key) : bool { |
|
325 | 325 | $parameterName = $parameter->getName(); |
326 | 326 | |
327 | 327 | return $key === $parameterName || (string) $key === (string) $parameterName; |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | */ |
460 | 460 | private function translateNamespaces(Query\ResultSetMapping $rsm) |
461 | 461 | { |
462 | - $translate = function ($alias) { |
|
462 | + $translate = function($alias) { |
|
463 | 463 | return $this->_em->getClassMetadata($alias)->getName(); |
464 | 464 | }; |
465 | 465 | |
@@ -989,7 +989,7 @@ discard block |
||
989 | 989 | $this->getTimestampKey() |
990 | 990 | ); |
991 | 991 | |
992 | - $result = $queryCache->get($queryKey, $rsm, $this->_hints); |
|
992 | + $result = $queryCache->get($queryKey, $rsm, $this->_hints); |
|
993 | 993 | |
994 | 994 | if ($result !== null) { |
995 | 995 | if ($this->cacheLogger) { |
@@ -1125,6 +1125,6 @@ discard block |
||
1125 | 1125 | |
1126 | 1126 | ksort($hints); |
1127 | 1127 | |
1128 | - return sha1($query . '-' . serialize($params) . '-' . serialize($hints)); |
|
1128 | + return sha1($query.'-'.serialize($params).'-'.serialize($hints)); |
|
1129 | 1129 | } |
1130 | 1130 | } |