@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | $key = Query\Parameter::normalizeName($key); |
304 | 304 | |
305 | 305 | $filteredParameters = $this->parameters->filter( |
306 | - static function (Query\Parameter $parameter) use ($key) : bool { |
|
306 | + static function(Query\Parameter $parameter) use ($key) : bool { |
|
307 | 307 | $parameterName = $parameter->getName(); |
308 | 308 | |
309 | 309 | return $key === $parameterName; |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | return $value; |
397 | 397 | } |
398 | 398 | |
399 | - if (! is_object($value)) { |
|
399 | + if ( ! is_object($value)) { |
|
400 | 400 | return $value; |
401 | 401 | } |
402 | 402 | |
@@ -727,7 +727,7 @@ discard block |
||
727 | 727 | return null; |
728 | 728 | } |
729 | 729 | |
730 | - if (! is_array($result)) { |
|
730 | + if ( ! is_array($result)) { |
|
731 | 731 | return $result; |
732 | 732 | } |
733 | 733 | |
@@ -761,7 +761,7 @@ discard block |
||
761 | 761 | throw new NoResultException(); |
762 | 762 | } |
763 | 763 | |
764 | - if (! is_array($result)) { |
|
764 | + if ( ! is_array($result)) { |
|
765 | 765 | return $result; |
766 | 766 | } |
767 | 767 | |
@@ -851,7 +851,7 @@ discard block |
||
851 | 851 | $this->setHydrationMode($hydrationMode); |
852 | 852 | } |
853 | 853 | |
854 | - if (! empty($parameters)) { |
|
854 | + if ( ! empty($parameters)) { |
|
855 | 855 | $this->setParameters($parameters); |
856 | 856 | } |
857 | 857 | |
@@ -890,11 +890,11 @@ discard block |
||
890 | 890 | $this->setHydrationMode($hydrationMode); |
891 | 891 | } |
892 | 892 | |
893 | - if (! empty($parameters)) { |
|
893 | + if ( ! empty($parameters)) { |
|
894 | 894 | $this->setParameters($parameters); |
895 | 895 | } |
896 | 896 | |
897 | - $setCacheEntry = static function () { |
|
897 | + $setCacheEntry = static function() { |
|
898 | 898 | }; |
899 | 899 | |
900 | 900 | if ($this->hydrationCacheProfile !== null) { |
@@ -908,11 +908,11 @@ discard block |
||
908 | 908 | return $result[$realCacheKey]; |
909 | 909 | } |
910 | 910 | |
911 | - if (! $result) { |
|
911 | + if ( ! $result) { |
|
912 | 912 | $result = []; |
913 | 913 | } |
914 | 914 | |
915 | - $setCacheEntry = static function ($data) use ($cache, $result, $cacheKey, $realCacheKey, $queryCacheProfile) { |
|
915 | + $setCacheEntry = static function($data) use ($cache, $result, $cacheKey, $realCacheKey, $queryCacheProfile) { |
|
916 | 916 | $result[$realCacheKey] = $data; |
917 | 917 | |
918 | 918 | $cache->save($cacheKey, $result, $queryCacheProfile->getLifetime()); |
@@ -1074,7 +1074,7 @@ discard block |
||
1074 | 1074 | { |
1075 | 1075 | $query = $this->getSQL(); |
1076 | 1076 | $hints = $this->getHints(); |
1077 | - $params = array_map(function (Parameter $parameter) { |
|
1077 | + $params = array_map(function(Parameter $parameter) { |
|
1078 | 1078 | $value = $parameter->getValue(); |
1079 | 1079 | |
1080 | 1080 | // Small optimization |
@@ -1088,6 +1088,6 @@ discard block |
||
1088 | 1088 | |
1089 | 1089 | ksort($hints); |
1090 | 1090 | |
1091 | - return sha1($query . '-' . serialize($params) . '-' . serialize($hints)); |
|
1091 | + return sha1($query.'-'.serialize($params).'-'.serialize($hints)); |
|
1092 | 1092 | } |
1093 | 1093 | } |
@@ -417,7 +417,7 @@ discard block |
||
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 | |
@@ -602,7 +602,7 @@ discard block |
||
602 | 602 | $key = Query\Parameter::normalizeName($key); |
603 | 603 | |
604 | 604 | $filteredParameters = $this->parameters->filter( |
605 | - static function (Query\Parameter $parameter) use ($key) : bool { |
|
605 | + static function(Query\Parameter $parameter) use ($key) : bool { |
|
606 | 606 | $parameterName = $parameter->getName(); |
607 | 607 | |
608 | 608 | return $key === $parameterName; |
@@ -678,7 +678,7 @@ discard block |
||
678 | 678 | { |
679 | 679 | if ($append && ($dqlPartName === 'where' || $dqlPartName === 'having')) { |
680 | 680 | throw new InvalidArgumentException( |
681 | - "Using \$append = true does not have an effect with 'where' or 'having' " . |
|
681 | + "Using \$append = true does not have an effect with 'where' or 'having' ". |
|
682 | 682 | 'parts. See QueryBuilder#andWhere() for an example for correct usage.' |
683 | 683 | ); |
684 | 684 | } |
@@ -819,7 +819,7 @@ discard block |
||
819 | 819 | { |
820 | 820 | $this->type = self::DELETE; |
821 | 821 | |
822 | - if (! $delete) { |
|
822 | + if ( ! $delete) { |
|
823 | 823 | return $this; |
824 | 824 | } |
825 | 825 | |
@@ -846,7 +846,7 @@ discard block |
||
846 | 846 | { |
847 | 847 | $this->type = self::UPDATE; |
848 | 848 | |
849 | - if (! $update) { |
|
849 | + if ( ! $update) { |
|
850 | 850 | return $this; |
851 | 851 | } |
852 | 852 | |
@@ -901,7 +901,7 @@ discard block |
||
901 | 901 | { |
902 | 902 | $rootAliases = $this->getRootAliases(); |
903 | 903 | |
904 | - if (! in_array($alias, $rootAliases, true)) { |
|
904 | + if ( ! in_array($alias, $rootAliases, true)) { |
|
905 | 905 | throw new Query\QueryException( |
906 | 906 | sprintf('Specified root alias %s must be set before invoking indexBy().', $alias) |
907 | 907 | ); |
@@ -1062,7 +1062,7 @@ discard block |
||
1062 | 1062 | */ |
1063 | 1063 | public function where($predicates) |
1064 | 1064 | { |
1065 | - if (! (func_num_args() === 1 && $predicates instanceof Expr\Composite)) { |
|
1065 | + if ( ! (func_num_args() === 1 && $predicates instanceof Expr\Composite)) { |
|
1066 | 1066 | $predicates = new Expr\Andx(func_get_args()); |
1067 | 1067 | } |
1068 | 1068 | |
@@ -1181,7 +1181,7 @@ discard block |
||
1181 | 1181 | */ |
1182 | 1182 | public function having($having) |
1183 | 1183 | { |
1184 | - if (! (func_num_args() === 1 && ($having instanceof Expr\Andx || $having instanceof Expr\Orx))) { |
|
1184 | + if ( ! (func_num_args() === 1 && ($having instanceof Expr\Andx || $having instanceof Expr\Orx))) { |
|
1185 | 1185 | $having = new Expr\Andx(func_get_args()); |
1186 | 1186 | } |
1187 | 1187 | |
@@ -1279,7 +1279,7 @@ discard block |
||
1279 | 1279 | public function addCriteria(Criteria $criteria) |
1280 | 1280 | { |
1281 | 1281 | $allAliases = $this->getAllAliases(); |
1282 | - if (! isset($allAliases[0])) { |
|
1282 | + if ( ! isset($allAliases[0])) { |
|
1283 | 1283 | throw new Query\QueryException('No aliases are set before invoking addCriteria().'); |
1284 | 1284 | } |
1285 | 1285 | |
@@ -1297,14 +1297,14 @@ discard block |
||
1297 | 1297 | foreach ($criteria->getOrderings() as $sort => $order) { |
1298 | 1298 | $hasValidAlias = false; |
1299 | 1299 | foreach ($allAliases as $alias) { |
1300 | - if (strpos($sort . '.', $alias . '.') === 0) { |
|
1300 | + if (strpos($sort.'.', $alias.'.') === 0) { |
|
1301 | 1301 | $hasValidAlias = true; |
1302 | 1302 | break; |
1303 | 1303 | } |
1304 | 1304 | } |
1305 | 1305 | |
1306 | - if (! $hasValidAlias) { |
|
1307 | - $sort = $allAliases[0] . '.' . $sort; |
|
1306 | + if ( ! $hasValidAlias) { |
|
1307 | + $sort = $allAliases[0].'.'.$sort; |
|
1308 | 1308 | } |
1309 | 1309 | |
1310 | 1310 | $this->addOrderBy($sort, $order); |
@@ -1378,7 +1378,7 @@ discard block |
||
1378 | 1378 | private function getDQLForSelect() |
1379 | 1379 | { |
1380 | 1380 | $dql = 'SELECT' |
1381 | - . ($this->dqlParts['distinct']===true ? ' DISTINCT' : '') |
|
1381 | + . ($this->dqlParts['distinct'] === true ? ' DISTINCT' : '') |
|
1382 | 1382 | . $this->getReducedDQLQueryPart('select', ['pre' => ' ', 'separator' => ', ']); |
1383 | 1383 | |
1384 | 1384 | $fromParts = $this->getDQLPart('from'); |
@@ -1386,7 +1386,7 @@ discard block |
||
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 |
||
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 |