Failed Conditions
Pull Request — master (#8010)
by Oleg
05:58
created
lib/Doctrine/ORM/QueryBuilder.php 1 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.