Failed Conditions
Pull Request — master (#8010)
by Oleg
09:21
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
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
     {
419 419
         $aliases = $this->getRootAliases();
420 420
 
421
-        if (! isset($aliases[0])) {
421
+        if ( ! isset($aliases[0])) {
422 422
             throw new RuntimeException('No alias was set before invoking getRootAlias().');
423 423
         }
424 424
 
@@ -601,7 +601,7 @@  discard block
 block discarded – undo
601 601
     public function getParameter($key)
602 602
     {
603 603
         $filteredParameters = $this->parameters->filter(
604
-            static function (Query\Parameter $parameter) use ($key) : bool {
604
+            static function(Query\Parameter $parameter) use ($key) : bool {
605 605
                 $parameterName = $parameter->getName();
606 606
 
607 607
                 return $key === $parameterName || (string) $key === (string) $parameterName;
@@ -677,7 +677,7 @@  discard block
 block discarded – undo
677 677
     {
678 678
         if ($append && ($dqlPartName === 'where' || $dqlPartName === 'having')) {
679 679
             throw new InvalidArgumentException(
680
-                "Using \$append = true does not have an effect with 'where' or 'having' " .
680
+                "Using \$append = true does not have an effect with 'where' or 'having' ".
681 681
                 'parts. See QueryBuilder#andWhere() for an example for correct usage.'
682 682
             );
683 683
         }
@@ -818,7 +818,7 @@  discard block
 block discarded – undo
818 818
     {
819 819
         $this->type = self::DELETE;
820 820
 
821
-        if (! $delete) {
821
+        if ( ! $delete) {
822 822
             return $this;
823 823
         }
824 824
 
@@ -845,7 +845,7 @@  discard block
 block discarded – undo
845 845
     {
846 846
         $this->type = self::UPDATE;
847 847
 
848
-        if (! $update) {
848
+        if ( ! $update) {
849 849
             return $this;
850 850
         }
851 851
 
@@ -900,7 +900,7 @@  discard block
 block discarded – undo
900 900
     {
901 901
         $rootAliases = $this->getRootAliases();
902 902
 
903
-        if (! in_array($alias, $rootAliases, true)) {
903
+        if ( ! in_array($alias, $rootAliases, true)) {
904 904
             throw QueryException::specifiedRootAliasMustBeSetBeforeInvokingIndexBy($alias);
905 905
         }
906 906
 
@@ -1059,7 +1059,7 @@  discard block
 block discarded – undo
1059 1059
      */
1060 1060
     public function where($predicates)
1061 1061
     {
1062
-        if (! (func_num_args() === 1 && $predicates instanceof Expr\Composite)) {
1062
+        if ( ! (func_num_args() === 1 && $predicates instanceof Expr\Composite)) {
1063 1063
             $predicates = new Expr\Andx(func_get_args());
1064 1064
         }
1065 1065
 
@@ -1178,7 +1178,7 @@  discard block
 block discarded – undo
1178 1178
      */
1179 1179
     public function having($having)
1180 1180
     {
1181
-        if (! (func_num_args() === 1 && ($having instanceof Expr\Andx || $having instanceof Expr\Orx))) {
1181
+        if ( ! (func_num_args() === 1 && ($having instanceof Expr\Andx || $having instanceof Expr\Orx))) {
1182 1182
             $having = new Expr\Andx(func_get_args());
1183 1183
         }
1184 1184
 
@@ -1276,7 +1276,7 @@  discard block
 block discarded – undo
1276 1276
     public function addCriteria(Criteria $criteria)
1277 1277
     {
1278 1278
         $allAliases = $this->getAllAliases();
1279
-        if (! isset($allAliases[0])) {
1279
+        if ( ! isset($allAliases[0])) {
1280 1280
             throw QueryException::noAliasesBeforeInvokingCriteria();
1281 1281
         }
1282 1282
 
@@ -1294,14 +1294,14 @@  discard block
 block discarded – undo
1294 1294
             foreach ($criteria->getOrderings() as $sort => $order) {
1295 1295
                 $hasValidAlias = false;
1296 1296
                 foreach ($allAliases as $alias) {
1297
-                    if (strpos($sort . '.', $alias . '.') === 0) {
1297
+                    if (strpos($sort.'.', $alias.'.') === 0) {
1298 1298
                         $hasValidAlias = true;
1299 1299
                         break;
1300 1300
                     }
1301 1301
                 }
1302 1302
 
1303
-                if (! $hasValidAlias) {
1304
-                    $sort = $allAliases[0] . '.' . $sort;
1303
+                if ( ! $hasValidAlias) {
1304
+                    $sort = $allAliases[0].'.'.$sort;
1305 1305
                 }
1306 1306
 
1307 1307
                 $this->addOrderBy($sort, $order);
@@ -1375,18 +1375,18 @@  discard block
 block discarded – undo
1375 1375
     private function getDQLForSelect()
1376 1376
     {
1377 1377
         $selectPart = $this->getReducedDQLQueryPart('select', ['pre' => ' ', 'separator' => ', ']);
1378
-        if (! $selectPart) {
1378
+        if ( ! $selectPart) {
1379 1379
             throw QueryException::missingSelectExpression();
1380 1380
         }
1381 1381
 
1382
-        $dql = 'SELECT' . ($this->dqlParts['distinct']===true ? ' DISTINCT' : '') . $selectPart;
1382
+        $dql = 'SELECT'.($this->dqlParts['distinct'] === true ? ' DISTINCT' : '').$selectPart;
1383 1383
 
1384 1384
         $fromParts   = $this->getDQLPart('from');
1385 1385
         $joinParts   = $this->getDQLPart('join');
1386 1386
         $fromClauses = [];
1387 1387
 
1388 1388
         // Loop through all FROM clauses
1389
-        if (! empty($fromParts)) {
1389
+        if ( ! empty($fromParts)) {
1390 1390
             $dql .= ' FROM ';
1391 1391
 
1392 1392
             foreach ($fromParts as $from) {
@@ -1394,7 +1394,7 @@  discard block
 block discarded – undo
1394 1394
 
1395 1395
                 if ($from instanceof Expr\From && isset($joinParts[$from->getAlias()])) {
1396 1396
                     foreach ($joinParts[$from->getAlias()] as $join) {
1397
-                        $fromClause .= ' ' . ((string) $join);
1397
+                        $fromClause .= ' '.((string) $join);
1398 1398
                     }
1399 1399
                 }
1400 1400
 
Please login to merge, or discard this patch.