Failed Conditions
Pull Request — master (#8010)
by Oleg
08:41
created
lib/Doctrine/ORM/QueryBuilder.php 2 patches
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1353,9 +1353,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     /**
@@ -1404,10 +1404,10 @@  discard block
 block discarded – undo
1404 1404
         }
1405 1405
 
1406 1406
         $dql .= implode(', ', $fromClauses)
1407
-              . $this->getReducedDQLQueryPart('where', ['pre' => ' WHERE '])
1408
-              . $this->getReducedDQLQueryPart('groupBy', ['pre' => ' GROUP BY ', 'separator' => ', '])
1409
-              . $this->getReducedDQLQueryPart('having', ['pre' => ' HAVING '])
1410
-              . $this->getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']);
1407
+                . $this->getReducedDQLQueryPart('where', ['pre' => ' WHERE '])
1408
+                . $this->getReducedDQLQueryPart('groupBy', ['pre' => ' GROUP BY ', 'separator' => ', '])
1409
+                . $this->getReducedDQLQueryPart('having', ['pre' => ' HAVING '])
1410
+                . $this->getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']);
1411 1411
 
1412 1412
         return $dql;
1413 1413
     }
@@ -1427,8 +1427,8 @@  discard block
 block discarded – undo
1427 1427
         }
1428 1428
 
1429 1429
         return ($options['pre'] ?? '')
1430
-             . (is_array($queryPart) ? implode($options['separator'], $queryPart) : $queryPart)
1431
-             . ($options['post'] ?? '');
1430
+                . (is_array($queryPart) ? implode($options['separator'], $queryPart) : $queryPart)
1431
+                . ($options['post'] ?? '');
1432 1432
     }
1433 1433
 
1434 1434
     /**
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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,18 +1376,18 @@  discard block
 block discarded – undo
1376 1376
     private function getDQLForSelect()
1377 1377
     {
1378 1378
         $selectPart = $this->getReducedDQLQueryPart('select', ['pre' => ' ', 'separator' => ', ']);
1379
-        if (!$selectPart) {
1379
+        if ( ! $selectPart) {
1380 1380
             throw new Query\QueryException('SELECT expression is required for building DQL');
1381 1381
         }
1382 1382
 
1383
-        $dql = 'SELECT' . ($this->dqlParts['distinct']===true ? ' DISTINCT' : '') . $selectPart;
1383
+        $dql = 'SELECT'.($this->dqlParts['distinct'] === true ? ' DISTINCT' : '').$selectPart;
1384 1384
 
1385 1385
         $fromParts   = $this->getDQLPart('from');
1386 1386
         $joinParts   = $this->getDQLPart('join');
1387 1387
         $fromClauses = [];
1388 1388
 
1389 1389
         // Loop through all FROM clauses
1390
-        if (! empty($fromParts)) {
1390
+        if ( ! empty($fromParts)) {
1391 1391
             $dql .= ' FROM ';
1392 1392
 
1393 1393
             foreach ($fromParts as $from) {
@@ -1395,7 +1395,7 @@  discard block
 block discarded – undo
1395 1395
 
1396 1396
                 if ($from instanceof Expr\From && isset($joinParts[$from->getAlias()])) {
1397 1397
                     foreach ($joinParts[$from->getAlias()] as $join) {
1398
-                        $fromClause .= ' ' . ((string) $join);
1398
+                        $fromClause .= ' '.((string) $join);
1399 1399
                     }
1400 1400
                 }
1401 1401
 
Please login to merge, or discard this patch.