Failed Conditions
Pull Request — develop (#6888)
by Michael
61:51
created
lib/Doctrine/ORM/NativeQuery.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
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
      */
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM;
6 6
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Query/QueryExpressionVisitor.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,6 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM\Query;
6 6
 
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
             $expressionList[] = $this->dispatch($child);
100 100
         }
101 101
 
102
-        switch($expr->getType()) {
102
+        switch ($expr->getType()) {
103 103
             case CompositeExpression::TYPE_AND:
104 104
                 return new Expr\Andx($expressionList);
105 105
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
                 return new Expr\Orx($expressionList);
108 108
 
109 109
             default:
110
-                throw new \RuntimeException("Unknown composite " . $expr->getType());
110
+                throw new \RuntimeException("Unknown composite ".$expr->getType());
111 111
         }
112 112
     }
113 113
 
@@ -121,10 +121,10 @@  discard block
 block discarded – undo
121 121
             throw new QueryException('No aliases are set before invoking walkComparison().');
122 122
         }
123 123
 
124
-        $field = $this->queryAliases[0] . '.' . $comparison->getField();
124
+        $field = $this->queryAliases[0].'.'.$comparison->getField();
125 125
 
126
-        foreach($this->queryAliases as $alias) {
127
-            if(strpos($comparison->getField() . '.', $alias . '.') === 0) {
126
+        foreach ($this->queryAliases as $alias) {
127
+            if (strpos($comparison->getField().'.', $alias.'.') === 0) {
128 128
                 $field = $comparison->getField();
129 129
                 break;
130 130
             }
@@ -135,13 +135,13 @@  discard block
 block discarded – undo
135 135
 
136 136
         foreach ($this->parameters as $parameter) {
137 137
             if ($parameter->getName() === $parameterName) {
138
-                $parameterName .= '_' . $parameterCount;
138
+                $parameterName .= '_'.$parameterCount;
139 139
                 break;
140 140
             }
141 141
         }
142 142
 
143 143
         $parameter = new Parameter($parameterName, $this->walkValue($comparison->getValue()));
144
-        $placeholder = ':' . $parameterName;
144
+        $placeholder = ':'.$parameterName;
145 145
 
146 146
         switch ($comparison->getOperator()) {
147 147
             case Comparison::IN:
@@ -168,17 +168,17 @@  discard block
 block discarded – undo
168 168
 
169 169
                 return $this->expr->neq($field, $placeholder);
170 170
             case Comparison::CONTAINS:
171
-                $parameter->setValue('%' . $parameter->getValue() . '%', $parameter->getType());
171
+                $parameter->setValue('%'.$parameter->getValue().'%', $parameter->getType());
172 172
                 $this->parameters[] = $parameter;
173 173
 
174 174
                 return $this->expr->like($field, $placeholder);
175 175
             case Comparison::STARTS_WITH:
176
-                $parameter->setValue($parameter->getValue() . '%', $parameter->getType());
176
+                $parameter->setValue($parameter->getValue().'%', $parameter->getType());
177 177
                 $this->parameters[] = $parameter;
178 178
 
179 179
                 return $this->expr->like($field, $placeholder);
180 180
             case Comparison::ENDS_WITH:
181
-                $parameter->setValue('%' . $parameter->getValue(), $parameter->getType());
181
+                $parameter->setValue('%'.$parameter->getValue(), $parameter->getType());
182 182
                 $this->parameters[] = $parameter;
183 183
 
184 184
                 return $this->expr->like($field, $placeholder);
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
                     );
195 195
                 }
196 196
 
197
-                throw new \RuntimeException("Unknown comparison operator: " . $comparison->getOperator());
197
+                throw new \RuntimeException("Unknown comparison operator: ".$comparison->getOperator());
198 198
         }
199 199
     }
200 200
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/QueryBuilder.php 4 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,6 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Doc Comments   +5 added lines, -7 removed lines patch added patch discarded remove patch
@@ -609,7 +609,7 @@  discard block
 block discarded – undo
609 609
     /**
610 610
      * Gets a (previously set) query parameter of the query being constructed.
611 611
      *
612
-     * @param mixed $key The key (index or name) of the bound parameter.
612
+     * @param string $key The key (index or name) of the bound parameter.
613 613
      *
614 614
      * @return Query\Parameter|null The value of the bound parameter.
615 615
      */
@@ -1097,7 +1097,6 @@  discard block
 block discarded – undo
1097 1097
      *         ->andWhere('u.is_active = 1');
1098 1098
      * </code>
1099 1099
      *
1100
-     * @param mixed $where The query restrictions.
1101 1100
      *
1102 1101
      * @return self
1103 1102
      *
@@ -1130,7 +1129,6 @@  discard block
 block discarded – undo
1130 1129
      *         ->orWhere('u.id = 2');
1131 1130
      * </code>
1132 1131
      *
1133
-     * @param mixed $where The WHERE statement.
1134 1132
      *
1135 1133
      * @return self
1136 1134
      *
@@ -1195,7 +1193,7 @@  discard block
 block discarded – undo
1195 1193
      * Specifies a restriction over the groups of the query.
1196 1194
      * Replaces any previous having restrictions, if any.
1197 1195
      *
1198
-     * @param mixed $having The restriction over the groups.
1196
+     * @param string $having The restriction over the groups.
1199 1197
      *
1200 1198
      * @return self
1201 1199
      */
@@ -1212,7 +1210,7 @@  discard block
 block discarded – undo
1212 1210
      * Adds a restriction over the groups of the query, forming a logical
1213 1211
      * conjunction with any existing having restrictions.
1214 1212
      *
1215
-     * @param mixed $having The restriction to append.
1213
+     * @param string $having The restriction to append.
1216 1214
      *
1217 1215
      * @return self
1218 1216
      */
@@ -1235,7 +1233,7 @@  discard block
 block discarded – undo
1235 1233
      * Adds a restriction over the groups of the query, forming a logical
1236 1234
      * disjunction with any existing having restrictions.
1237 1235
      *
1238
-     * @param mixed $having The restriction to add.
1236
+     * @param string $having The restriction to add.
1239 1237
      *
1240 1238
      * @return self
1241 1239
      */
@@ -1454,7 +1452,7 @@  discard block
 block discarded – undo
1454 1452
     /**
1455 1453
      * Resets DQL parts.
1456 1454
      *
1457
-     * @param array|null $parts
1455
+     * @param string[] $parts
1458 1456
      *
1459 1457
      * @return self
1460 1458
      */
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM;
6 6
 
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
     public function setParameter($key, $value, $type = null)
519 519
     {
520 520
         $filteredParameters = $this->parameters->filter(
521
-            function ($parameter) use ($key)
521
+            function($parameter) use ($key)
522 522
             {
523 523
                 /* @var Query\Parameter $parameter */
524 524
                 // Must not be identical because of string to integer conversion
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
             }
527 527
         );
528 528
 
529
-        if (! $filteredParameters->isEmpty()) {
529
+        if ( ! $filteredParameters->isEmpty()) {
530 530
             /* @var Query\Parameter $parameter */
531 531
             $parameter = $filteredParameters->first();
532 532
             $parameter->setValue($value, $type);
@@ -599,7 +599,7 @@  discard block
 block discarded – undo
599 599
     public function getParameter($key)
600 600
     {
601 601
         $filteredParameters = $this->parameters->filter(
602
-            function ($parameter) use ($key)
602
+            function($parameter) use ($key)
603 603
             {
604 604
                 /* @var Query\Parameter $parameter */
605 605
                 // Must not be identical because of string to integer conversion
@@ -682,7 +682,7 @@  discard block
 block discarded – undo
682 682
         }
683 683
 
684 684
         $isMultiple = is_array($this->dqlParts[$dqlPartName])
685
-            && !($dqlPartName == 'join' && !$append);
685
+            && ! ($dqlPartName == 'join' && ! $append);
686 686
 
687 687
         // Allow adding any part retrieved from self::getDQLParts().
688 688
         if (is_array($dqlPart) && $dqlPartName != 'join') {
@@ -899,7 +899,7 @@  discard block
 block discarded – undo
899 899
     {
900 900
         $rootAliases = $this->getRootAliases();
901 901
 
902
-        if (!in_array($alias, $rootAliases)) {
902
+        if ( ! in_array($alias, $rootAliases)) {
903 903
             throw new Query\QueryException(
904 904
                 sprintf('Specified root alias %s must be set before invoking indexBy().', $alias)
905 905
             );
@@ -1301,15 +1301,15 @@  discard block
 block discarded – undo
1301 1301
             foreach ($criteria->getOrderings() as $sort => $order) {
1302 1302
 
1303 1303
                 $hasValidAlias = false;
1304
-                foreach($allAliases as $alias) {
1305
-                    if(strpos($sort . '.', $alias . '.') === 0) {
1304
+                foreach ($allAliases as $alias) {
1305
+                    if (strpos($sort.'.', $alias.'.') === 0) {
1306 1306
                         $hasValidAlias = true;
1307 1307
                         break;
1308 1308
                     }
1309 1309
                 }
1310 1310
 
1311
-                if(!$hasValidAlias) {
1312
-                    $sort = $allAliases[0] . '.' . $sort;
1311
+                if ( ! $hasValidAlias) {
1312
+                    $sort = $allAliases[0].'.'.$sort;
1313 1313
                 }
1314 1314
 
1315 1315
                 $this->addOrderBy($sort, $order);
@@ -1382,7 +1382,7 @@  discard block
 block discarded – undo
1382 1382
     private function getDQLForSelect()
1383 1383
     {
1384 1384
         $dql = 'SELECT'
1385
-             . ($this->dqlParts['distinct']===true ? ' DISTINCT' : '')
1385
+             . ($this->dqlParts['distinct'] === true ? ' DISTINCT' : '')
1386 1386
              . $this->getReducedDQLQueryPart('select', ['pre' => ' ', 'separator' => ', ']);
1387 1387
 
1388 1388
         $fromParts   = $this->getDQLPart('from');
@@ -1398,7 +1398,7 @@  discard block
 block discarded – undo
1398 1398
 
1399 1399
                 if ($from instanceof Expr\From && isset($joinParts[$from->getAlias()])) {
1400 1400
                     foreach ($joinParts[$from->getAlias()] as $join) {
1401
-                        $fromClause .= ' ' . ((string) $join);
1401
+                        $fromClause .= ' '.((string) $join);
1402 1402
                     }
1403 1403
                 }
1404 1404
 
Please login to merge, or discard this patch.
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -103,11 +103,11 @@  discard block
 block discarded – undo
103 103
      */
104 104
     private $joinRootAliases = [];
105 105
 
106
-     /**
107
-     * Whether to use second level cache, if available.
108
-     *
109
-     * @var boolean
110
-     */
106
+        /**
107
+         * Whether to use second level cache, if available.
108
+         *
109
+         * @var boolean
110
+         */
111 111
     protected $cacheable = false;
112 112
 
113 113
     /**
@@ -198,10 +198,10 @@  discard block
 block discarded – undo
198 198
     }
199 199
 
200 200
     /**
201
-    * Obtain the name of the second level query cache region in which query results will be stored
202
-    *
203
-    * @return string|null The cache region name; NULL indicates the default region.
204
-    */
201
+     * Obtain the name of the second level query cache region in which query results will be stored
202
+     *
203
+     * @return string|null The cache region name; NULL indicates the default region.
204
+     */
205 205
     public function getCacheRegion()
206 206
     {
207 207
         return $this->cacheRegion;
@@ -1356,10 +1356,10 @@  discard block
 block discarded – undo
1356 1356
      */
1357 1357
     private function getDQLForDelete()
1358 1358
     {
1359
-         return 'DELETE'
1360
-              . $this->getReducedDQLQueryPart('from', ['pre' => ' ', 'separator' => ', '])
1361
-              . $this->getReducedDQLQueryPart('where', ['pre' => ' WHERE '])
1362
-              . $this->getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']);
1359
+            return 'DELETE'
1360
+                . $this->getReducedDQLQueryPart('from', ['pre' => ' ', 'separator' => ', '])
1361
+                . $this->getReducedDQLQueryPart('where', ['pre' => ' WHERE '])
1362
+                . $this->getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']);
1363 1363
     }
1364 1364
 
1365 1365
     /**
@@ -1367,11 +1367,11 @@  discard block
 block discarded – undo
1367 1367
      */
1368 1368
     private function getDQLForUpdate()
1369 1369
     {
1370
-         return 'UPDATE'
1371
-              . $this->getReducedDQLQueryPart('from', ['pre' => ' ', 'separator' => ', '])
1372
-              . $this->getReducedDQLQueryPart('set', ['pre' => ' SET ', 'separator' => ', '])
1373
-              . $this->getReducedDQLQueryPart('where', ['pre' => ' WHERE '])
1374
-              . $this->getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']);
1370
+            return 'UPDATE'
1371
+                . $this->getReducedDQLQueryPart('from', ['pre' => ' ', 'separator' => ', '])
1372
+                . $this->getReducedDQLQueryPart('set', ['pre' => ' SET ', 'separator' => ', '])
1373
+                . $this->getReducedDQLQueryPart('where', ['pre' => ' WHERE '])
1374
+                . $this->getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']);
1375 1375
     }
1376 1376
 
1377 1377
     /**
@@ -1380,8 +1380,8 @@  discard block
 block discarded – undo
1380 1380
     private function getDQLForSelect()
1381 1381
     {
1382 1382
         $dql = 'SELECT'
1383
-             . ($this->dqlParts['distinct']===true ? ' DISTINCT' : '')
1384
-             . $this->getReducedDQLQueryPart('select', ['pre' => ' ', 'separator' => ', ']);
1383
+                . ($this->dqlParts['distinct']===true ? ' DISTINCT' : '')
1384
+                . $this->getReducedDQLQueryPart('select', ['pre' => ' ', 'separator' => ', ']);
1385 1385
 
1386 1386
         $fromParts   = $this->getDQLPart('from');
1387 1387
         $joinParts   = $this->getDQLPart('join');
@@ -1405,10 +1405,10 @@  discard block
 block discarded – undo
1405 1405
         }
1406 1406
 
1407 1407
         $dql .= implode(', ', $fromClauses)
1408
-              . $this->getReducedDQLQueryPart('where', ['pre' => ' WHERE '])
1409
-              . $this->getReducedDQLQueryPart('groupBy', ['pre' => ' GROUP BY ', 'separator' => ', '])
1410
-              . $this->getReducedDQLQueryPart('having', ['pre' => ' HAVING '])
1411
-              . $this->getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']);
1408
+                . $this->getReducedDQLQueryPart('where', ['pre' => ' WHERE '])
1409
+                . $this->getReducedDQLQueryPart('groupBy', ['pre' => ' GROUP BY ', 'separator' => ', '])
1410
+                . $this->getReducedDQLQueryPart('having', ['pre' => ' HAVING '])
1411
+                . $this->getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']);
1412 1412
 
1413 1413
         return $dql;
1414 1414
     }
@@ -1428,8 +1428,8 @@  discard block
 block discarded – undo
1428 1428
         }
1429 1429
 
1430 1430
         return ($options['pre'] ?? '')
1431
-             . (is_array($queryPart) ? implode($options['separator'], $queryPart) : $queryPart)
1432
-             . ($options['post'] ?? '');
1431
+                . (is_array($queryPart) ? implode($options['separator'], $queryPart) : $queryPart)
1432
+                . ($options['post'] ?? '');
1433 1433
     }
1434 1434
 
1435 1435
     /**
Please login to merge, or discard this patch.
tools/sandbox/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,11 +12,11 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Query/AST/Node.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM\Query\AST;
6 6
 
@@ -53,32 +53,32 @@  discard block
 block discarded – undo
53 53
         $str = '';
54 54
 
55 55
         if ($obj instanceof Node) {
56
-            $str .= get_class($obj) . '(' . PHP_EOL;
56
+            $str .= get_class($obj).'('.PHP_EOL;
57 57
             $props = get_object_vars($obj);
58 58
 
59 59
             foreach ($props as $name => $prop) {
60 60
                 $ident += 4;
61
-                $str .= str_repeat(' ', $ident) . '"' . $name . '": '
62
-                      . $this->dump($prop) . ',' . PHP_EOL;
61
+                $str .= str_repeat(' ', $ident).'"'.$name.'": '
62
+                      . $this->dump($prop).','.PHP_EOL;
63 63
                 $ident -= 4;
64 64
             }
65 65
 
66
-            $str .= str_repeat(' ', $ident) . ')';
66
+            $str .= str_repeat(' ', $ident).')';
67 67
         } else if (is_array($obj)) {
68 68
             $ident += 4;
69 69
             $str .= 'array(';
70 70
             $some = false;
71 71
 
72 72
             foreach ($obj as $k => $v) {
73
-                $str .= PHP_EOL . str_repeat(' ', $ident) . '"'
74
-                      . $k . '" => ' . $this->dump($v) . ',';
73
+                $str .= PHP_EOL.str_repeat(' ', $ident).'"'
74
+                      . $k.'" => '.$this->dump($v).',';
75 75
                 $some = true;
76 76
             }
77 77
 
78 78
             $ident -= 4;
79
-            $str .= ($some ? PHP_EOL . str_repeat(' ', $ident) : '') . ')';
79
+            $str .= ($some ? PHP_EOL . str_repeat(' ', $ident) : '').')';
80 80
         } else if (is_object($obj)) {
81
-            $str .= 'instanceof(' . get_class($obj) . ')';
81
+            $str .= 'instanceof('.get_class($obj).')';
82 82
         } else {
83 83
             $str .= var_export($obj, true);
84 84
         }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Query/Expr/Join.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -138,8 +138,8 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM\Query\Expr;
6 6
 
@@ -122,9 +122,9 @@  discard block
 block discarded – undo
122 122
      */
123 123
     public function __toString()
124 124
     {
125
-        return strtoupper($this->joinType) . ' JOIN ' . $this->join
126
-             . ($this->alias ? ' ' . $this->alias : '')
127
-             . ($this->indexBy ? ' INDEX BY ' . $this->indexBy : '')
128
-             . ($this->condition ? ' ' . strtoupper($this->conditionType) . ' ' . $this->condition : '');
125
+        return strtoupper($this->joinType).' JOIN '.$this->join
126
+             . ($this->alias ? ' '.$this->alias : '')
127
+             . ($this->indexBy ? ' INDEX BY '.$this->indexBy : '')
128
+             . ($this->condition ? ' '.strtoupper($this->conditionType).' '.$this->condition : '');
129 129
     }
130 130
 }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Query/ResultSetMapping.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -227,7 +227,9 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM\Query;
6 6
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/AbstractQuery.php 3 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -212,10 +212,10 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1044,7 +1044,7 @@
 block discarded – undo
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
     {
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM;
6 6
 
7 7
 use Doctrine\Common\Collections\Collection;
8
-use Doctrine\Common\Collections\ArrayCollection;;
8
+use Doctrine\Common\Collections\ArrayCollection; ;
9 9
 use Doctrine\ORM\Query\Parameter;
10 10
 use Doctrine\ORM\Cache\QueryCacheKey;
11 11
 use Doctrine\DBAL\Cache\QueryCacheProfile;
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
     public function getParameter($key)
306 306
     {
307 307
         $filteredParameters = $this->parameters->filter(
308
-            function ($parameter) use ($key)
308
+            function($parameter) use ($key)
309 309
             {
310 310
                 // Must not be identical because of string to integer conversion
311 311
                 return ($key == $parameter->getName());
@@ -354,14 +354,14 @@  discard block
 block discarded – undo
354 354
     public function setParameter($key, $value, $type = null)
355 355
     {
356 356
         $filteredParameters = $this->parameters->filter(
357
-            function ($parameter) use ($key)
357
+            function($parameter) use ($key)
358 358
             {
359 359
                 // Must not be identical because of string to integer conversion
360 360
                 return ($key == $parameter->getName());
361 361
             }
362 362
         );
363 363
 
364
-        if (! $filteredParameters->isEmpty()) {
364
+        if ( ! $filteredParameters->isEmpty()) {
365 365
             $parameter = $filteredParameters->first();
366 366
             $parameter->setValue($value, $type);
367 367
 
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
      */
451 451
     private function translateNamespaces(Query\ResultSetMapping $rsm)
452 452
     {
453
-        $translate = function ($alias) {
453
+        $translate = function($alias) {
454 454
             return $this->em->getClassMetadata($alias)->getClassName();
455 455
         };
456 456
 
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
      */
513 513
     public function setResultCacheProfile(QueryCacheProfile $profile = null)
514 514
     {
515
-        if (! $profile->getResultCacheDriver()) {
515
+        if ( ! $profile->getResultCacheDriver()) {
516 516
             $resultCacheDriver = $this->em->getConfiguration()->getResultCacheImpl();
517 517
             $profile = $profile->setResultCacheDriver($resultCacheDriver);
518 518
         }
@@ -980,7 +980,7 @@  discard block
 block discarded – undo
980 980
             $this->getTimestampKey()
981 981
         );
982 982
 
983
-        $result     = $queryCache->get($queryKey, $rsm, $this->hints);
983
+        $result = $queryCache->get($queryKey, $rsm, $this->hints);
984 984
 
985 985
         if ($result !== null) {
986 986
             if ($this->cacheLogger) {
@@ -1114,6 +1114,6 @@  discard block
 block discarded – undo
1114 1114
 
1115 1115
         ksort($hints);
1116 1116
 
1117
-        return sha1($query . '-' . serialize($params) . '-' . serialize($hints));
1117
+        return sha1($query.'-'.serialize($params).'-'.serialize($hints));
1118 1118
     }
1119 1119
 }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Cache/DefaultCache.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -45,9 +45,9 @@  discard block
 block discarded – undo
45 45
      */
46 46
     private $uow;
47 47
 
48
-     /**
49
-     * @var \Doctrine\ORM\Cache\CacheFactory
50
-     */
48
+        /**
49
+         * @var \Doctrine\ORM\Cache\CacheFactory
50
+         */
51 51
     private $cacheFactory;
52 52
 
53 53
     /**
@@ -289,12 +289,12 @@  discard block
 block discarded – undo
289 289
         return $this->queryCaches[$regionName];
290 290
     }
291 291
 
292
-     /**
293
-     * @param \Doctrine\ORM\Mapping\ClassMetadata $metadata   The entity metadata.
294
-     * @param mixed                               $identifier The entity identifier.
295
-     *
296
-     * @return \Doctrine\ORM\Cache\EntityCacheKey
297
-     */
292
+        /**
293
+         * @param \Doctrine\ORM\Mapping\ClassMetadata $metadata   The entity metadata.
294
+         * @param mixed                               $identifier The entity identifier.
295
+         *
296
+         * @return \Doctrine\ORM\Cache\EntityCacheKey
297
+         */
298 298
     private function buildEntityCacheKey(ClassMetadata $metadata, $identifier)
299 299
     {
300 300
         if ( ! is_array($identifier)) {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 
4
-declare(strict_types=1);
4
+declare(strict_types = 1);
5 5
 
6 6
 namespace Doctrine\ORM\Cache;
7 7
 
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 
206 206
         foreach ($metadatas as $metadata) {
207 207
             foreach ($metadata->getDeclaredPropertiesIterator() as $association) {
208
-                if (! $association instanceof ToManyAssociationMetadata) {
208
+                if ( ! $association instanceof ToManyAssociationMetadata) {
209 209
                     continue;
210 210
                 }
211 211
 
@@ -262,8 +262,7 @@  discard block
 block discarded – undo
262 262
     public function getQueryCache($regionName = null)
263 263
     {
264 264
         if ($regionName === null) {
265
-            return $this->defaultQueryCache ?:
266
-                $this->defaultQueryCache = $this->cacheFactory->buildQueryCache($this->em);
265
+            return $this->defaultQueryCache ?: $this->defaultQueryCache = $this->cacheFactory->buildQueryCache($this->em);
267 266
         }
268 267
 
269 268
         if ( ! isset($this->queryCaches[$regionName])) {
Please login to merge, or discard this patch.