@@ -49,7 +49,7 @@ |
||
49 | 49 | /** |
50 | 50 | * Gets the SQL query. |
51 | 51 | * |
52 | - * @return mixed The built SQL query or an array of all SQL queries. |
|
52 | + * @return string The built SQL query or an array of all SQL queries. |
|
53 | 53 | * |
54 | 54 | * @override |
55 | 55 | */ |
@@ -17,7 +17,7 @@ |
||
17 | 17 | * <http://www.doctrine-project.org>. |
18 | 18 | */ |
19 | 19 | |
20 | -declare(strict_types=1); |
|
20 | +declare(strict_types = 1); |
|
21 | 21 | |
22 | 22 | namespace Doctrine\ORM; |
23 | 23 |
@@ -579,7 +579,7 @@ |
||
579 | 579 | * Internal note: Tried to implement Serializable first but that did not work well |
580 | 580 | * with circular references. This solution seems simpler and works well. |
581 | 581 | * |
582 | - * @return array |
|
582 | + * @return string[] |
|
583 | 583 | */ |
584 | 584 | public function __sleep() |
585 | 585 | { |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | * <http://www.doctrine-project.org>. |
18 | 18 | */ |
19 | 19 | |
20 | -declare(strict_types=1); |
|
20 | +declare(strict_types = 1); |
|
21 | 21 | |
22 | 22 | namespace Doctrine\ORM; |
23 | 23 | |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | */ |
414 | 414 | public function containsKey($key) |
415 | 415 | { |
416 | - if (! $this->initialized && |
|
416 | + if ( ! $this->initialized && |
|
417 | 417 | $this->association !== null && |
418 | 418 | $this->association->getFetchMode() === FetchMode::EXTRA_LAZY && |
419 | 419 | $this->association->getIndexedBy()) { |
@@ -430,7 +430,7 @@ discard block |
||
430 | 430 | */ |
431 | 431 | public function contains($element) |
432 | 432 | { |
433 | - if (! $this->initialized && |
|
433 | + if ( ! $this->initialized && |
|
434 | 434 | $this->association !== null && |
435 | 435 | $this->association->getFetchMode() === FetchMode::EXTRA_LAZY) { |
436 | 436 | $persister = $this->em->getUnitOfWork()->getCollectionPersister($this->association); |
@@ -446,11 +446,11 @@ discard block |
||
446 | 446 | */ |
447 | 447 | public function get($key) |
448 | 448 | { |
449 | - if (! $this->initialized && |
|
449 | + if ( ! $this->initialized && |
|
450 | 450 | $this->association !== null && |
451 | 451 | $this->association->getFetchMode() === FetchMode::EXTRA_LAZY && |
452 | 452 | $this->association->getIndexedBy()) { |
453 | - if (!$this->typeClass->isIdentifierComposite() && $this->typeClass->isIdentifier($this->association->getIndexedBy())) { |
|
453 | + if ( ! $this->typeClass->isIdentifierComposite() && $this->typeClass->isIdentifier($this->association->getIndexedBy())) { |
|
454 | 454 | return $this->em->find($this->typeClass->getClassName(), $key); |
455 | 455 | } |
456 | 456 | |
@@ -465,7 +465,7 @@ discard block |
||
465 | 465 | */ |
466 | 466 | public function count() |
467 | 467 | { |
468 | - if (! $this->initialized && |
|
468 | + if ( ! $this->initialized && |
|
469 | 469 | $this->association !== null && |
470 | 470 | $this->association->getFetchMode() === FetchMode::EXTRA_LAZY) { |
471 | 471 | $persister = $this->em->getUnitOfWork()->getCollectionPersister($this->association); |
@@ -619,7 +619,7 @@ discard block |
||
619 | 619 | */ |
620 | 620 | public function slice($offset, $length = null) |
621 | 621 | { |
622 | - if (! $this->initialized && |
|
622 | + if ( ! $this->initialized && |
|
623 | 623 | ! $this->isDirty && |
624 | 624 | $this->association !== null && |
625 | 625 | $this->association->getFetchMode() === FetchMode::EXTRA_LAZY) { |
@@ -20,7 +20,6 @@ |
||
20 | 20 | namespace Doctrine\ORM\Query; |
21 | 21 | |
22 | 22 | use Doctrine\Common\Collections\ArrayCollection; |
23 | - |
|
24 | 23 | use Doctrine\Common\Collections\Expr\ExpressionVisitor; |
25 | 24 | use Doctrine\Common\Collections\Expr\Comparison; |
26 | 25 | use Doctrine\Common\Collections\Expr\CompositeExpression; |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | * <http://www.doctrine-project.org>. |
18 | 18 | */ |
19 | 19 | |
20 | -declare(strict_types=1); |
|
20 | +declare(strict_types = 1); |
|
21 | 21 | |
22 | 22 | namespace Doctrine\ORM\Query; |
23 | 23 | |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $expressionList[] = $this->dispatch($child); |
117 | 117 | } |
118 | 118 | |
119 | - switch($expr->getType()) { |
|
119 | + switch ($expr->getType()) { |
|
120 | 120 | case CompositeExpression::TYPE_AND: |
121 | 121 | return new Expr\Andx($expressionList); |
122 | 122 | |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | return new Expr\Orx($expressionList); |
125 | 125 | |
126 | 126 | default: |
127 | - throw new \RuntimeException("Unknown composite " . $expr->getType()); |
|
127 | + throw new \RuntimeException("Unknown composite ".$expr->getType()); |
|
128 | 128 | } |
129 | 129 | } |
130 | 130 | |
@@ -138,10 +138,10 @@ discard block |
||
138 | 138 | throw new QueryException('No aliases are set before invoking walkComparison().'); |
139 | 139 | } |
140 | 140 | |
141 | - $field = $this->queryAliases[0] . '.' . $comparison->getField(); |
|
141 | + $field = $this->queryAliases[0].'.'.$comparison->getField(); |
|
142 | 142 | |
143 | - foreach($this->queryAliases as $alias) { |
|
144 | - if(strpos($comparison->getField() . '.', $alias . '.') === 0) { |
|
143 | + foreach ($this->queryAliases as $alias) { |
|
144 | + if (strpos($comparison->getField().'.', $alias.'.') === 0) { |
|
145 | 145 | $field = $comparison->getField(); |
146 | 146 | break; |
147 | 147 | } |
@@ -151,13 +151,13 @@ discard block |
||
151 | 151 | |
152 | 152 | foreach ($this->parameters as $parameter) { |
153 | 153 | if ($parameter->getName() === $parameterName) { |
154 | - $parameterName .= '_' . count($this->parameters); |
|
154 | + $parameterName .= '_'.count($this->parameters); |
|
155 | 155 | break; |
156 | 156 | } |
157 | 157 | } |
158 | 158 | |
159 | 159 | $parameter = new Parameter($parameterName, $this->walkValue($comparison->getValue())); |
160 | - $placeholder = ':' . $parameterName; |
|
160 | + $placeholder = ':'.$parameterName; |
|
161 | 161 | |
162 | 162 | switch ($comparison->getOperator()) { |
163 | 163 | case Comparison::IN: |
@@ -184,17 +184,17 @@ discard block |
||
184 | 184 | |
185 | 185 | return $this->expr->neq($field, $placeholder); |
186 | 186 | case Comparison::CONTAINS: |
187 | - $parameter->setValue('%' . $parameter->getValue() . '%', $parameter->getType()); |
|
187 | + $parameter->setValue('%'.$parameter->getValue().'%', $parameter->getType()); |
|
188 | 188 | $this->parameters[] = $parameter; |
189 | 189 | |
190 | 190 | return $this->expr->like($field, $placeholder); |
191 | 191 | case Comparison::STARTS_WITH: |
192 | - $parameter->setValue($parameter->getValue() . '%', $parameter->getType()); |
|
192 | + $parameter->setValue($parameter->getValue().'%', $parameter->getType()); |
|
193 | 193 | $this->parameters[] = $parameter; |
194 | 194 | |
195 | 195 | return $this->expr->like($field, $placeholder); |
196 | 196 | case Comparison::ENDS_WITH: |
197 | - $parameter->setValue('%' . $parameter->getValue(), $parameter->getType()); |
|
197 | + $parameter->setValue('%'.$parameter->getValue(), $parameter->getType()); |
|
198 | 198 | $this->parameters[] = $parameter; |
199 | 199 | |
200 | 200 | return $this->expr->like($field, $placeholder); |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | ); |
211 | 211 | } |
212 | 212 | |
213 | - throw new \RuntimeException("Unknown comparison operator: " . $comparison->getOperator()); |
|
213 | + throw new \RuntimeException("Unknown comparison operator: ".$comparison->getOperator()); |
|
214 | 214 | } |
215 | 215 | } |
216 | 216 |
@@ -21,7 +21,6 @@ |
||
21 | 21 | |
22 | 22 | use Doctrine\Common\Collections\ArrayCollection; |
23 | 23 | use Doctrine\Common\Collections\Criteria; |
24 | - |
|
25 | 24 | use Doctrine\ORM\Query\Expr; |
26 | 25 | use Doctrine\ORM\Query\QueryExpressionVisitor; |
27 | 26 |
@@ -606,7 +606,7 @@ discard block |
||
606 | 606 | /** |
607 | 607 | * Gets a (previously set) query parameter of the query being constructed. |
608 | 608 | * |
609 | - * @param mixed $key The key (index or name) of the bound parameter. |
|
609 | + * @param string $key The key (index or name) of the bound parameter. |
|
610 | 610 | * |
611 | 611 | * @return Query\Parameter|null The value of the bound parameter. |
612 | 612 | */ |
@@ -794,7 +794,7 @@ discard block |
||
794 | 794 | * ->leftJoin('u.Phonenumbers', 'p'); |
795 | 795 | * </code> |
796 | 796 | * |
797 | - * @param mixed $select The selection expression. |
|
797 | + * @param string $select The selection expression. |
|
798 | 798 | * |
799 | 799 | * @return self |
800 | 800 | */ |
@@ -1094,7 +1094,6 @@ discard block |
||
1094 | 1094 | * ->andWhere('u.is_active = 1'); |
1095 | 1095 | * </code> |
1096 | 1096 | * |
1097 | - * @param mixed $where The query restrictions. |
|
1098 | 1097 | * |
1099 | 1098 | * @return self |
1100 | 1099 | * |
@@ -1127,7 +1126,6 @@ discard block |
||
1127 | 1126 | * ->orWhere('u.id = 2'); |
1128 | 1127 | * </code> |
1129 | 1128 | * |
1130 | - * @param mixed $where The WHERE statement. |
|
1131 | 1129 | * |
1132 | 1130 | * @return self |
1133 | 1131 | * |
@@ -1192,7 +1190,7 @@ discard block |
||
1192 | 1190 | * Specifies a restriction over the groups of the query. |
1193 | 1191 | * Replaces any previous having restrictions, if any. |
1194 | 1192 | * |
1195 | - * @param mixed $having The restriction over the groups. |
|
1193 | + * @param string $having The restriction over the groups. |
|
1196 | 1194 | * |
1197 | 1195 | * @return self |
1198 | 1196 | */ |
@@ -1209,7 +1207,7 @@ discard block |
||
1209 | 1207 | * Adds a restriction over the groups of the query, forming a logical |
1210 | 1208 | * conjunction with any existing having restrictions. |
1211 | 1209 | * |
1212 | - * @param mixed $having The restriction to append. |
|
1210 | + * @param string $having The restriction to append. |
|
1213 | 1211 | * |
1214 | 1212 | * @return self |
1215 | 1213 | */ |
@@ -1232,7 +1230,7 @@ discard block |
||
1232 | 1230 | * Adds a restriction over the groups of the query, forming a logical |
1233 | 1231 | * disjunction with any existing having restrictions. |
1234 | 1232 | * |
1235 | - * @param mixed $having The restriction to add. |
|
1233 | + * @param string $having The restriction to add. |
|
1236 | 1234 | * |
1237 | 1235 | * @return self |
1238 | 1236 | */ |
@@ -1451,7 +1449,7 @@ discard block |
||
1451 | 1449 | /** |
1452 | 1450 | * Resets DQL parts. |
1453 | 1451 | * |
1454 | - * @param array|null $parts |
|
1452 | + * @param string[] $parts |
|
1455 | 1453 | * |
1456 | 1454 | * @return self |
1457 | 1455 | */ |
@@ -120,11 +120,11 @@ discard block |
||
120 | 120 | */ |
121 | 121 | private $joinRootAliases = []; |
122 | 122 | |
123 | - /** |
|
124 | - * Whether to use second level cache, if available. |
|
125 | - * |
|
126 | - * @var boolean |
|
127 | - */ |
|
123 | + /** |
|
124 | + * Whether to use second level cache, if available. |
|
125 | + * |
|
126 | + * @var boolean |
|
127 | + */ |
|
128 | 128 | protected $cacheable = false; |
129 | 129 | |
130 | 130 | /** |
@@ -215,10 +215,10 @@ discard block |
||
215 | 215 | } |
216 | 216 | |
217 | 217 | /** |
218 | - * Obtain the name of the second level query cache region in which query results will be stored |
|
219 | - * |
|
220 | - * @return string|null The cache region name; NULL indicates the default region. |
|
221 | - */ |
|
218 | + * Obtain the name of the second level query cache region in which query results will be stored |
|
219 | + * |
|
220 | + * @return string|null The cache region name; NULL indicates the default region. |
|
221 | + */ |
|
222 | 222 | public function getCacheRegion() |
223 | 223 | { |
224 | 224 | return $this->cacheRegion; |
@@ -1375,10 +1375,10 @@ discard block |
||
1375 | 1375 | */ |
1376 | 1376 | private function getDQLForDelete() |
1377 | 1377 | { |
1378 | - return 'DELETE' |
|
1379 | - . $this->getReducedDQLQueryPart('from', ['pre' => ' ', 'separator' => ', ']) |
|
1380 | - . $this->getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
1381 | - . $this->getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
1378 | + return 'DELETE' |
|
1379 | + . $this->getReducedDQLQueryPart('from', ['pre' => ' ', 'separator' => ', ']) |
|
1380 | + . $this->getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
1381 | + . $this->getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
1382 | 1382 | } |
1383 | 1383 | |
1384 | 1384 | /** |
@@ -1386,11 +1386,11 @@ discard block |
||
1386 | 1386 | */ |
1387 | 1387 | private function getDQLForUpdate() |
1388 | 1388 | { |
1389 | - return 'UPDATE' |
|
1390 | - . $this->getReducedDQLQueryPart('from', ['pre' => ' ', 'separator' => ', ']) |
|
1391 | - . $this->getReducedDQLQueryPart('set', ['pre' => ' SET ', 'separator' => ', ']) |
|
1392 | - . $this->getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
1393 | - . $this->getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
1389 | + return 'UPDATE' |
|
1390 | + . $this->getReducedDQLQueryPart('from', ['pre' => ' ', 'separator' => ', ']) |
|
1391 | + . $this->getReducedDQLQueryPart('set', ['pre' => ' SET ', 'separator' => ', ']) |
|
1392 | + . $this->getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
1393 | + . $this->getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
1394 | 1394 | } |
1395 | 1395 | |
1396 | 1396 | /** |
@@ -1399,8 +1399,8 @@ discard block |
||
1399 | 1399 | private function getDQLForSelect() |
1400 | 1400 | { |
1401 | 1401 | $dql = 'SELECT' |
1402 | - . ($this->dqlParts['distinct']===true ? ' DISTINCT' : '') |
|
1403 | - . $this->getReducedDQLQueryPart('select', ['pre' => ' ', 'separator' => ', ']); |
|
1402 | + . ($this->dqlParts['distinct']===true ? ' DISTINCT' : '') |
|
1403 | + . $this->getReducedDQLQueryPart('select', ['pre' => ' ', 'separator' => ', ']); |
|
1404 | 1404 | |
1405 | 1405 | $fromParts = $this->getDQLPart('from'); |
1406 | 1406 | $joinParts = $this->getDQLPart('join'); |
@@ -1424,10 +1424,10 @@ discard block |
||
1424 | 1424 | } |
1425 | 1425 | |
1426 | 1426 | $dql .= implode(', ', $fromClauses) |
1427 | - . $this->getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
1428 | - . $this->getReducedDQLQueryPart('groupBy', ['pre' => ' GROUP BY ', 'separator' => ', ']) |
|
1429 | - . $this->getReducedDQLQueryPart('having', ['pre' => ' HAVING ']) |
|
1430 | - . $this->getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
1427 | + . $this->getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
1428 | + . $this->getReducedDQLQueryPart('groupBy', ['pre' => ' GROUP BY ', 'separator' => ', ']) |
|
1429 | + . $this->getReducedDQLQueryPart('having', ['pre' => ' HAVING ']) |
|
1430 | + . $this->getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
1431 | 1431 | |
1432 | 1432 | return $dql; |
1433 | 1433 | } |
@@ -1447,8 +1447,8 @@ discard block |
||
1447 | 1447 | } |
1448 | 1448 | |
1449 | 1449 | return (isset($options['pre']) ? $options['pre'] : '') |
1450 | - . (is_array($queryPart) ? implode($options['separator'], $queryPart) : $queryPart) |
|
1451 | - . (isset($options['post']) ? $options['post'] : ''); |
|
1450 | + . (is_array($queryPart) ? implode($options['separator'], $queryPart) : $queryPart) |
|
1451 | + . (isset($options['post']) ? $options['post'] : ''); |
|
1452 | 1452 | } |
1453 | 1453 | |
1454 | 1454 | /** |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | * <http://www.doctrine-project.org>. |
18 | 18 | */ |
19 | 19 | |
20 | -declare(strict_types=1); |
|
20 | +declare(strict_types = 1); |
|
21 | 21 | |
22 | 22 | namespace Doctrine\ORM; |
23 | 23 | |
@@ -535,7 +535,7 @@ discard block |
||
535 | 535 | public function setParameter($key, $value, $type = null) |
536 | 536 | { |
537 | 537 | $filteredParameters = $this->parameters->filter( |
538 | - function ($parameter) use ($key) |
|
538 | + function($parameter) use ($key) |
|
539 | 539 | { |
540 | 540 | /* @var Query\Parameter $parameter */ |
541 | 541 | // Must not be identical because of string to integer conversion |
@@ -616,7 +616,7 @@ discard block |
||
616 | 616 | public function getParameter($key) |
617 | 617 | { |
618 | 618 | $filteredParameters = $this->parameters->filter( |
619 | - function ($parameter) use ($key) |
|
619 | + function($parameter) use ($key) |
|
620 | 620 | { |
621 | 621 | /* @var Query\Parameter $parameter */ |
622 | 622 | // Must not be identical because of string to integer conversion |
@@ -699,7 +699,7 @@ discard block |
||
699 | 699 | } |
700 | 700 | |
701 | 701 | $isMultiple = is_array($this->dqlParts[$dqlPartName]) |
702 | - && !($dqlPartName == 'join' && !$append); |
|
702 | + && ! ($dqlPartName == 'join' && ! $append); |
|
703 | 703 | |
704 | 704 | // Allow adding any part retrieved from self::getDQLParts(). |
705 | 705 | if (is_array($dqlPart) && $dqlPartName != 'join') { |
@@ -916,7 +916,7 @@ discard block |
||
916 | 916 | { |
917 | 917 | $rootAliases = $this->getRootAliases(); |
918 | 918 | |
919 | - if (!in_array($alias, $rootAliases)) { |
|
919 | + if ( ! in_array($alias, $rootAliases)) { |
|
920 | 920 | throw new Query\QueryException( |
921 | 921 | sprintf('Specified root alias %s must be set before invoking indexBy().', $alias) |
922 | 922 | ); |
@@ -1318,15 +1318,15 @@ discard block |
||
1318 | 1318 | foreach ($criteria->getOrderings() as $sort => $order) { |
1319 | 1319 | |
1320 | 1320 | $hasValidAlias = false; |
1321 | - foreach($allAliases as $alias) { |
|
1322 | - if(strpos($sort . '.', $alias . '.') === 0) { |
|
1321 | + foreach ($allAliases as $alias) { |
|
1322 | + if (strpos($sort.'.', $alias.'.') === 0) { |
|
1323 | 1323 | $hasValidAlias = true; |
1324 | 1324 | break; |
1325 | 1325 | } |
1326 | 1326 | } |
1327 | 1327 | |
1328 | - if(!$hasValidAlias) { |
|
1329 | - $sort = $allAliases[0] . '.' . $sort; |
|
1328 | + if ( ! $hasValidAlias) { |
|
1329 | + $sort = $allAliases[0].'.'.$sort; |
|
1330 | 1330 | } |
1331 | 1331 | |
1332 | 1332 | $this->addOrderBy($sort, $order); |
@@ -1399,7 +1399,7 @@ discard block |
||
1399 | 1399 | private function getDQLForSelect() |
1400 | 1400 | { |
1401 | 1401 | $dql = 'SELECT' |
1402 | - . ($this->dqlParts['distinct']===true ? ' DISTINCT' : '') |
|
1402 | + . ($this->dqlParts['distinct'] === true ? ' DISTINCT' : '') |
|
1403 | 1403 | . $this->getReducedDQLQueryPart('select', ['pre' => ' ', 'separator' => ', ']); |
1404 | 1404 | |
1405 | 1405 | $fromParts = $this->getDQLPart('from'); |
@@ -1415,7 +1415,7 @@ discard block |
||
1415 | 1415 | |
1416 | 1416 | if ($from instanceof Expr\From && isset($joinParts[$from->getAlias()])) { |
1417 | 1417 | foreach ($joinParts[$from->getAlias()] as $join) { |
1418 | - $fromClause .= ' ' . ((string) $join); |
|
1418 | + $fromClause .= ' '.((string) $join); |
|
1419 | 1419 | } |
1420 | 1420 | } |
1421 | 1421 |
@@ -12,11 +12,11 @@ |
||
12 | 12 | use Entities\Address; |
13 | 13 | use Entities\User; |
14 | 14 | |
15 | -$em = require_once __DIR__ . '/bootstrap.php'; |
|
15 | +$em = require_once __DIR__.'/bootstrap.php'; |
|
16 | 16 | |
17 | 17 | ## PUT YOUR TEST CODE BELOW |
18 | 18 | |
19 | 19 | $user = new User; |
20 | 20 | $address = new Address; |
21 | 21 | |
22 | -echo 'Hello World!' . PHP_EOL; |
|
22 | +echo 'Hello World!'.PHP_EOL; |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | foreach ($props as $name => $prop) { |
75 | 75 | $ident += 4; |
76 | 76 | $str .= str_repeat(' ', $ident) . '"' . $name . '": ' |
77 | - . $this->dump($prop) . ',' . PHP_EOL; |
|
77 | + . $this->dump($prop) . ',' . PHP_EOL; |
|
78 | 78 | $ident -= 4; |
79 | 79 | } |
80 | 80 | |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | |
87 | 87 | foreach ($obj as $k => $v) { |
88 | 88 | $str .= PHP_EOL . str_repeat(' ', $ident) . '"' |
89 | - . $k . '" => ' . $this->dump($v) . ','; |
|
89 | + . $k . '" => ' . $this->dump($v) . ','; |
|
90 | 90 | $some = true; |
91 | 91 | } |
92 | 92 |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | * <http://www.doctrine-project.org>. |
18 | 18 | */ |
19 | 19 | |
20 | -declare(strict_types=1); |
|
20 | +declare(strict_types = 1); |
|
21 | 21 | |
22 | 22 | namespace Doctrine\ORM\Query\AST; |
23 | 23 | |
@@ -70,32 +70,32 @@ discard block |
||
70 | 70 | $str = ''; |
71 | 71 | |
72 | 72 | if ($obj instanceof Node) { |
73 | - $str .= get_class($obj) . '(' . PHP_EOL; |
|
73 | + $str .= get_class($obj).'('.PHP_EOL; |
|
74 | 74 | $props = get_object_vars($obj); |
75 | 75 | |
76 | 76 | foreach ($props as $name => $prop) { |
77 | 77 | $ident += 4; |
78 | - $str .= str_repeat(' ', $ident) . '"' . $name . '": ' |
|
79 | - . $this->dump($prop) . ',' . PHP_EOL; |
|
78 | + $str .= str_repeat(' ', $ident).'"'.$name.'": ' |
|
79 | + . $this->dump($prop).','.PHP_EOL; |
|
80 | 80 | $ident -= 4; |
81 | 81 | } |
82 | 82 | |
83 | - $str .= str_repeat(' ', $ident) . ')'; |
|
83 | + $str .= str_repeat(' ', $ident).')'; |
|
84 | 84 | } else if (is_array($obj)) { |
85 | 85 | $ident += 4; |
86 | 86 | $str .= 'array('; |
87 | 87 | $some = false; |
88 | 88 | |
89 | 89 | foreach ($obj as $k => $v) { |
90 | - $str .= PHP_EOL . str_repeat(' ', $ident) . '"' |
|
91 | - . $k . '" => ' . $this->dump($v) . ','; |
|
90 | + $str .= PHP_EOL.str_repeat(' ', $ident).'"' |
|
91 | + . $k.'" => '.$this->dump($v).','; |
|
92 | 92 | $some = true; |
93 | 93 | } |
94 | 94 | |
95 | 95 | $ident -= 4; |
96 | - $str .= ($some ? PHP_EOL . str_repeat(' ', $ident) : '') . ')'; |
|
96 | + $str .= ($some ? PHP_EOL.str_repeat(' ', $ident) : '').')'; |
|
97 | 97 | } else if (is_object($obj)) { |
98 | - $str .= 'instanceof(' . get_class($obj) . ')'; |
|
98 | + $str .= 'instanceof('.get_class($obj).')'; |
|
99 | 99 | } else { |
100 | 100 | $str .= var_export($obj, true); |
101 | 101 | } |
@@ -138,8 +138,8 @@ |
||
138 | 138 | public function __toString() |
139 | 139 | { |
140 | 140 | return strtoupper($this->joinType) . ' JOIN ' . $this->join |
141 | - . ($this->alias ? ' ' . $this->alias : '') |
|
142 | - . ($this->indexBy ? ' INDEX BY ' . $this->indexBy : '') |
|
143 | - . ($this->condition ? ' ' . strtoupper($this->conditionType) . ' ' . $this->condition : ''); |
|
141 | + . ($this->alias ? ' ' . $this->alias : '') |
|
142 | + . ($this->indexBy ? ' INDEX BY ' . $this->indexBy : '') |
|
143 | + . ($this->condition ? ' ' . strtoupper($this->conditionType) . ' ' . $this->condition : ''); |
|
144 | 144 | } |
145 | 145 | } |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | * <http://www.doctrine-project.org>. |
18 | 18 | */ |
19 | 19 | |
20 | -declare(strict_types=1); |
|
20 | +declare(strict_types = 1); |
|
21 | 21 | |
22 | 22 | namespace Doctrine\ORM\Query\Expr; |
23 | 23 | |
@@ -139,9 +139,9 @@ discard block |
||
139 | 139 | */ |
140 | 140 | public function __toString() |
141 | 141 | { |
142 | - return strtoupper($this->joinType) . ' JOIN ' . $this->join |
|
143 | - . ($this->alias ? ' ' . $this->alias : '') |
|
144 | - . ($this->indexBy ? ' INDEX BY ' . $this->indexBy : '') |
|
145 | - . ($this->condition ? ' ' . strtoupper($this->conditionType) . ' ' . $this->condition : ''); |
|
142 | + return strtoupper($this->joinType).' JOIN '.$this->join |
|
143 | + . ($this->alias ? ' '.$this->alias : '') |
|
144 | + . ($this->indexBy ? ' INDEX BY '.$this->indexBy : '') |
|
145 | + . ($this->condition ? ' '.strtoupper($this->conditionType).' '.$this->condition : ''); |
|
146 | 146 | } |
147 | 147 | } |
@@ -227,7 +227,9 @@ |
||
227 | 227 | $found = false; |
228 | 228 | |
229 | 229 | foreach (array_merge($this->metaMappings, $this->fieldMappings) as $columnName => $columnFieldName) { |
230 | - if ( ! ($columnFieldName === $fieldName && $this->columnOwnerMap[$columnName] === $alias)) continue; |
|
230 | + if ( ! ($columnFieldName === $fieldName && $this->columnOwnerMap[$columnName] === $alias)) { |
|
231 | + continue; |
|
232 | + } |
|
231 | 233 | |
232 | 234 | $this->addIndexByColumn($alias, $columnName); |
233 | 235 | $found = true; |
@@ -17,7 +17,7 @@ |
||
17 | 17 | * <http://www.doctrine-project.org>. |
18 | 18 | */ |
19 | 19 | |
20 | -declare(strict_types=1); |
|
20 | +declare(strict_types = 1); |
|
21 | 21 | |
22 | 22 | namespace Doctrine\ORM\Query; |
23 | 23 | use Doctrine\DBAL\Types\Type; |
@@ -212,10 +212,10 @@ |
||
212 | 212 | } |
213 | 213 | |
214 | 214 | /** |
215 | - * Obtain the name of the second level query cache region in which query results will be stored |
|
216 | - * |
|
217 | - * @return string|null The cache region name; NULL indicates the default region. |
|
218 | - */ |
|
215 | + * Obtain the name of the second level query cache region in which query results will be stored |
|
216 | + * |
|
217 | + * @return string|null The cache region name; NULL indicates the default region. |
|
218 | + */ |
|
219 | 219 | public function getCacheRegion() |
220 | 220 | { |
221 | 221 | return $this->cacheRegion; |
@@ -1044,7 +1044,7 @@ |
||
1044 | 1044 | * Will return the configured id if it exists otherwise a hash will be |
1045 | 1045 | * automatically generated for you. |
1046 | 1046 | * |
1047 | - * @return array ($key, $hash) |
|
1047 | + * @return string[] ($key, $hash) |
|
1048 | 1048 | */ |
1049 | 1049 | protected function getHydrationCacheId() |
1050 | 1050 | { |
@@ -17,13 +17,13 @@ discard block |
||
17 | 17 | * <http://www.doctrine-project.org>. |
18 | 18 | */ |
19 | 19 | |
20 | -declare(strict_types=1); |
|
20 | +declare(strict_types = 1); |
|
21 | 21 | |
22 | 22 | namespace Doctrine\ORM; |
23 | 23 | |
24 | 24 | use Doctrine\Common\Util\ClassUtils; |
25 | 25 | use Doctrine\Common\Collections\Collection; |
26 | -use Doctrine\Common\Collections\ArrayCollection;; |
|
26 | +use Doctrine\Common\Collections\ArrayCollection; ; |
|
27 | 27 | use Doctrine\ORM\Query\Parameter; |
28 | 28 | use Doctrine\ORM\Cache\QueryCacheKey; |
29 | 29 | use Doctrine\DBAL\Cache\QueryCacheProfile; |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | public function getParameter($key) |
323 | 323 | { |
324 | 324 | $filteredParameters = $this->parameters->filter( |
325 | - function ($parameter) use ($key) |
|
325 | + function($parameter) use ($key) |
|
326 | 326 | { |
327 | 327 | // Must not be identical because of string to integer conversion |
328 | 328 | return ($key == $parameter->getName()); |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | public function setParameter($key, $value, $type = null) |
372 | 372 | { |
373 | 373 | $filteredParameters = $this->parameters->filter( |
374 | - function ($parameter) use ($key) |
|
374 | + function($parameter) use ($key) |
|
375 | 375 | { |
376 | 376 | // Must not be identical because of string to integer conversion |
377 | 377 | return ($key == $parameter->getName()); |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | */ |
468 | 468 | private function translateNamespaces(Query\ResultSetMapping $rsm) |
469 | 469 | { |
470 | - $translate = function ($alias) { |
|
470 | + $translate = function($alias) { |
|
471 | 471 | return $this->em->getClassMetadata($alias)->getClassName(); |
472 | 472 | }; |
473 | 473 | |
@@ -529,7 +529,7 @@ discard block |
||
529 | 529 | */ |
530 | 530 | public function setResultCacheProfile(QueryCacheProfile $profile = null) |
531 | 531 | { |
532 | - if (! $profile->getResultCacheDriver()) { |
|
532 | + if ( ! $profile->getResultCacheDriver()) { |
|
533 | 533 | $resultCacheDriver = $this->em->getConfiguration()->getResultCacheImpl(); |
534 | 534 | $profile = $profile->setResultCacheDriver($resultCacheDriver); |
535 | 535 | } |
@@ -997,7 +997,7 @@ discard block |
||
997 | 997 | $this->getTimestampKey() |
998 | 998 | ); |
999 | 999 | |
1000 | - $result = $queryCache->get($queryKey, $rsm, $this->hints); |
|
1000 | + $result = $queryCache->get($queryKey, $rsm, $this->hints); |
|
1001 | 1001 | |
1002 | 1002 | if ($result !== null) { |
1003 | 1003 | if ($this->cacheLogger) { |
@@ -1131,6 +1131,6 @@ discard block |
||
1131 | 1131 | |
1132 | 1132 | ksort($hints); |
1133 | 1133 | |
1134 | - return sha1($query . '-' . serialize($params) . '-' . serialize($hints)); |
|
1134 | + return sha1($query.'-'.serialize($params).'-'.serialize($hints)); |
|
1135 | 1135 | } |
1136 | 1136 | } |