Completed
Pull Request — master (#7800)
by Maxime
10:09
created
lib/Doctrine/ORM/Query/Expr/BaseAlias.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
      */
44 44
     public function add($arg, $alias = null)
45 45
     {
46
-        if ($alias !== null && is_array($arg) && (! $arg instanceof self || $arg->count() > 0)) {
46
+        if ($alias !== null && is_array($arg) && ( ! $arg instanceof self || $arg->count() > 0)) {
47 47
             foreach ($arg as $v) {
48 48
                 parent::add(sprintf('%s.%s', $alias, $v));
49 49
             }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/QueryBuilder.php 1 patch
Spacing   +17 added lines, -17 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
 
@@ -1146,7 +1146,7 @@  discard block
 block discarded – undo
1146 1146
      */
1147 1147
     public function groupBy($groupBy)
1148 1148
     {
1149
-        if (! is_array($groupBy)) {
1149
+        if ( ! is_array($groupBy)) {
1150 1150
             $groupBy = func_get_args();
1151 1151
         }
1152 1152
 
@@ -1170,7 +1170,7 @@  discard block
 block discarded – undo
1170 1170
      */
1171 1171
     public function addGroupBy($groupBy)
1172 1172
     {
1173
-        if (! is_array($groupBy)) {
1173
+        if ( ! is_array($groupBy)) {
1174 1174
             $groupBy = func_get_args();
1175 1175
         }
1176 1176
 
@@ -1187,7 +1187,7 @@  discard block
 block discarded – undo
1187 1187
      */
1188 1188
     public function having($having)
1189 1189
     {
1190
-        if (! (func_num_args() === 1 && ($having instanceof Expr\Andx || $having instanceof Expr\Orx))) {
1190
+        if ( ! (func_num_args() === 1 && ($having instanceof Expr\Andx || $having instanceof Expr\Orx))) {
1191 1191
             $having = new Expr\Andx(func_get_args());
1192 1192
         }
1193 1193
 
@@ -1285,7 +1285,7 @@  discard block
 block discarded – undo
1285 1285
     public function addCriteria(Criteria $criteria)
1286 1286
     {
1287 1287
         $allAliases = $this->getAllAliases();
1288
-        if (! isset($allAliases[0])) {
1288
+        if ( ! isset($allAliases[0])) {
1289 1289
             throw new Query\QueryException('No aliases are set before invoking addCriteria().');
1290 1290
         }
1291 1291
 
@@ -1303,14 +1303,14 @@  discard block
 block discarded – undo
1303 1303
             foreach ($criteria->getOrderings() as $sort => $order) {
1304 1304
                 $hasValidAlias = false;
1305 1305
                 foreach ($allAliases as $alias) {
1306
-                    if (strpos($sort . '.', $alias . '.') === 0) {
1306
+                    if (strpos($sort.'.', $alias.'.') === 0) {
1307 1307
                         $hasValidAlias = true;
1308 1308
                         break;
1309 1309
                     }
1310 1310
                 }
1311 1311
 
1312
-                if (! $hasValidAlias) {
1313
-                    $sort = $allAliases[0] . '.' . $sort;
1312
+                if ( ! $hasValidAlias) {
1313
+                    $sort = $allAliases[0].'.'.$sort;
1314 1314
                 }
1315 1315
 
1316 1316
                 $this->addOrderBy($sort, $order);
@@ -1384,7 +1384,7 @@  discard block
 block discarded – undo
1384 1384
     private function getDQLForSelect()
1385 1385
     {
1386 1386
         $dql = 'SELECT'
1387
-             . ($this->dqlParts['distinct']===true ? ' DISTINCT' : '')
1387
+             . ($this->dqlParts['distinct'] === true ? ' DISTINCT' : '')
1388 1388
              . $this->getReducedDQLQueryPart('select', ['pre' => ' ', 'separator' => ', ']);
1389 1389
 
1390 1390
         $fromParts   = $this->getDQLPart('from');
@@ -1392,7 +1392,7 @@  discard block
 block discarded – undo
1392 1392
         $fromClauses = [];
1393 1393
 
1394 1394
         // Loop through all FROM clauses
1395
-        if (! empty($fromParts)) {
1395
+        if ( ! empty($fromParts)) {
1396 1396
             $dql .= ' FROM ';
1397 1397
 
1398 1398
             foreach ($fromParts as $from) {
@@ -1400,7 +1400,7 @@  discard block
 block discarded – undo
1400 1400
 
1401 1401
                 if ($from instanceof Expr\From && isset($joinParts[$from->getAlias()])) {
1402 1402
                     foreach ($joinParts[$from->getAlias()] as $join) {
1403
-                        $fromClause .= ' ' . ((string) $join);
1403
+                        $fromClause .= ' '.((string) $join);
1404 1404
                     }
1405 1405
                 }
1406 1406
 
Please login to merge, or discard this patch.