@@ -19,9 +19,9 @@ |
||
| 19 | 19 | { |
| 20 | 20 | /** @var TransientMetadata $value */ |
| 21 | 21 | $indentation = str_repeat(self::INDENTATION, $indentationLevel); |
| 22 | - $objectReference = $indentation . self::VARIABLE; |
|
| 22 | + $objectReference = $indentation.self::VARIABLE; |
|
| 23 | 23 | |
| 24 | - return $objectReference . ' = ' . $this->exportInstantiation($value); |
|
| 24 | + return $objectReference.' = '.$this->exportInstantiation($value); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | protected function exportInstantiation(TransientMetadata $metadata) : string |
@@ -22,10 +22,10 @@ |
||
| 22 | 22 | { |
| 23 | 23 | /** @var CacheMetadata $value */ |
| 24 | 24 | $indentation = str_repeat(self::INDENTATION, $indentationLevel); |
| 25 | - $objectReference = $indentation . self::VARIABLE; |
|
| 25 | + $objectReference = $indentation.self::VARIABLE; |
|
| 26 | 26 | $lines = []; |
| 27 | 27 | |
| 28 | - $lines[] = $objectReference . ' = ' . $this->exportInstantiation($value); |
|
| 28 | + $lines[] = $objectReference.' = '.$this->exportInstantiation($value); |
|
| 29 | 29 | |
| 30 | 30 | return implode(PHP_EOL, $lines); |
| 31 | 31 | } |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | $classMetadata = $this->em->getClassMetadata($class); |
| 123 | 123 | $platform = $this->em->getConnection()->getDatabasePlatform(); |
| 124 | 124 | |
| 125 | - if (! $this->isInheritanceSupported($classMetadata)) { |
|
| 125 | + if ( ! $this->isInheritanceSupported($classMetadata)) { |
|
| 126 | 126 | throw new InvalidArgumentException( |
| 127 | 127 | 'ResultSetMapping builder does not currently support your inheritance scheme.' |
| 128 | 128 | ); |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | ); |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | - if (! $joinColumn->getType()) { |
|
| 165 | + if ( ! $joinColumn->getType()) { |
|
| 166 | 166 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 167 | 167 | } |
| 168 | 168 | |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | { |
| 202 | 202 | switch ($mode) { |
| 203 | 203 | case self::COLUMN_RENAMING_INCREMENT: |
| 204 | - return $columnName . $this->sqlCounter++; |
|
| 204 | + return $columnName.$this->sqlCounter++; |
|
| 205 | 205 | case self::COLUMN_RENAMING_CUSTOM: |
| 206 | 206 | return $customRenameColumns[$columnName] ?? $columnName; |
| 207 | 207 | case self::COLUMN_RENAMING_NONE: |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | $sql .= ', '; |
| 231 | 231 | } |
| 232 | 232 | |
| 233 | - $sql .= $tableAlias . '.'; |
|
| 233 | + $sql .= $tableAlias.'.'; |
|
| 234 | 234 | |
| 235 | 235 | if (isset($this->fieldMappings[$columnName])) { |
| 236 | 236 | $class = $this->em->getClassMetadata($this->declaringClasses[$columnName]); |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | $sql .= $this->discriminatorColumns[$dqlAlias]; |
| 243 | 243 | } |
| 244 | 244 | |
| 245 | - $sql .= ' AS ' . $columnName; |
|
| 245 | + $sql .= ' AS '.$columnName; |
|
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | return $sql; |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | case CompositeExpression::TYPE_OR: |
| 95 | 95 | return new Expr\Orx($expressionList); |
| 96 | 96 | default: |
| 97 | - throw new RuntimeException('Unknown composite ' . $expr->getType()); |
|
| 97 | + throw new RuntimeException('Unknown composite '.$expr->getType()); |
|
| 98 | 98 | } |
| 99 | 99 | } |
| 100 | 100 | |
@@ -103,14 +103,14 @@ discard block |
||
| 103 | 103 | */ |
| 104 | 104 | public function walkComparison(Comparison $comparison) |
| 105 | 105 | { |
| 106 | - if (! isset($this->queryAliases[0])) { |
|
| 106 | + if ( ! isset($this->queryAliases[0])) { |
|
| 107 | 107 | throw new QueryException('No aliases are set before invoking walkComparison().'); |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | - $field = $this->queryAliases[0] . '.' . $comparison->getField(); |
|
| 110 | + $field = $this->queryAliases[0].'.'.$comparison->getField(); |
|
| 111 | 111 | |
| 112 | 112 | foreach ($this->queryAliases as $alias) { |
| 113 | - if (strpos($comparison->getField() . '.', $alias . '.') === 0) { |
|
| 113 | + if (strpos($comparison->getField().'.', $alias.'.') === 0) { |
|
| 114 | 114 | $field = $comparison->getField(); |
| 115 | 115 | break; |
| 116 | 116 | } |
@@ -121,13 +121,13 @@ discard block |
||
| 121 | 121 | |
| 122 | 122 | foreach ($this->parameters as $parameter) { |
| 123 | 123 | if ($parameter->getName() === $parameterName) { |
| 124 | - $parameterName .= '_' . $parameterCount; |
|
| 124 | + $parameterName .= '_'.$parameterCount; |
|
| 125 | 125 | break; |
| 126 | 126 | } |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | $parameter = new Parameter($parameterName, $this->walkValue($comparison->getValue())); |
| 130 | - $placeholder = ':' . $parameterName; |
|
| 130 | + $placeholder = ':'.$parameterName; |
|
| 131 | 131 | |
| 132 | 132 | switch ($comparison->getOperator()) { |
| 133 | 133 | case Comparison::IN: |
@@ -154,17 +154,17 @@ discard block |
||
| 154 | 154 | |
| 155 | 155 | return $this->expr->neq($field, $placeholder); |
| 156 | 156 | case Comparison::CONTAINS: |
| 157 | - $parameter->setValue('%' . $parameter->getValue() . '%', $parameter->getType()); |
|
| 157 | + $parameter->setValue('%'.$parameter->getValue().'%', $parameter->getType()); |
|
| 158 | 158 | $this->parameters[] = $parameter; |
| 159 | 159 | |
| 160 | 160 | return $this->expr->like($field, $placeholder); |
| 161 | 161 | case Comparison::STARTS_WITH: |
| 162 | - $parameter->setValue($parameter->getValue() . '%', $parameter->getType()); |
|
| 162 | + $parameter->setValue($parameter->getValue().'%', $parameter->getType()); |
|
| 163 | 163 | $this->parameters[] = $parameter; |
| 164 | 164 | |
| 165 | 165 | return $this->expr->like($field, $placeholder); |
| 166 | 166 | case Comparison::ENDS_WITH: |
| 167 | - $parameter->setValue('%' . $parameter->getValue(), $parameter->getType()); |
|
| 167 | + $parameter->setValue('%'.$parameter->getValue(), $parameter->getType()); |
|
| 168 | 168 | $this->parameters[] = $parameter; |
| 169 | 169 | |
| 170 | 170 | return $this->expr->like($field, $placeholder); |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | ); |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | - throw new RuntimeException('Unknown comparison operator: ' . $comparison->getOperator()); |
|
| 183 | + throw new RuntimeException('Unknown comparison operator: '.$comparison->getOperator()); |
|
| 184 | 184 | } |
| 185 | 185 | } |
| 186 | 186 | |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | public function getClassShortName(string $className) : string |
| 31 | 31 | { |
| 32 | 32 | if (strpos($className, '\\') !== false) { |
| 33 | - $className = substr($className, strrpos($className, '\\')+1); |
|
| 33 | + $className = substr($className, strrpos($className, '\\') + 1); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | return $className; |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | $namespace = ''; |
| 45 | 45 | |
| 46 | 46 | if (strpos($className, '\\') !== false) { |
| 47 | - $namespace = strrev(substr(strrev($className), strpos(strrev($className), '\\')+1)); |
|
| 47 | + $namespace = strrev(substr(strrev($className), strpos(strrev($className), '\\') + 1)); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | return $namespace; |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | public function getParameter($key) |
| 302 | 302 | { |
| 303 | 303 | $filteredParameters = $this->parameters->filter( |
| 304 | - static function (Query\Parameter $parameter) use ($key) : bool { |
|
| 304 | + static function(Query\Parameter $parameter) use ($key) : bool { |
|
| 305 | 305 | $parameterName = $parameter->getName(); |
| 306 | 306 | |
| 307 | 307 | return $key === $parameterName || (string) $key === (string) $parameterName; |
@@ -394,7 +394,7 @@ discard block |
||
| 394 | 394 | return $value; |
| 395 | 395 | } |
| 396 | 396 | |
| 397 | - if (! is_object($value)) { |
|
| 397 | + if ( ! is_object($value)) { |
|
| 398 | 398 | return $value; |
| 399 | 399 | } |
| 400 | 400 | |
@@ -725,7 +725,7 @@ discard block |
||
| 725 | 725 | return null; |
| 726 | 726 | } |
| 727 | 727 | |
| 728 | - if (! is_array($result)) { |
|
| 728 | + if ( ! is_array($result)) { |
|
| 729 | 729 | return $result; |
| 730 | 730 | } |
| 731 | 731 | |
@@ -759,7 +759,7 @@ discard block |
||
| 759 | 759 | throw new NoResultException(); |
| 760 | 760 | } |
| 761 | 761 | |
| 762 | - if (! is_array($result)) { |
|
| 762 | + if ( ! is_array($result)) { |
|
| 763 | 763 | return $result; |
| 764 | 764 | } |
| 765 | 765 | |
@@ -849,7 +849,7 @@ discard block |
||
| 849 | 849 | $this->setHydrationMode($hydrationMode); |
| 850 | 850 | } |
| 851 | 851 | |
| 852 | - if (! empty($parameters)) { |
|
| 852 | + if ( ! empty($parameters)) { |
|
| 853 | 853 | $this->setParameters($parameters); |
| 854 | 854 | } |
| 855 | 855 | |
@@ -888,11 +888,11 @@ discard block |
||
| 888 | 888 | $this->setHydrationMode($hydrationMode); |
| 889 | 889 | } |
| 890 | 890 | |
| 891 | - if (! empty($parameters)) { |
|
| 891 | + if ( ! empty($parameters)) { |
|
| 892 | 892 | $this->setParameters($parameters); |
| 893 | 893 | } |
| 894 | 894 | |
| 895 | - $setCacheEntry = static function () { |
|
| 895 | + $setCacheEntry = static function() { |
|
| 896 | 896 | }; |
| 897 | 897 | |
| 898 | 898 | if ($this->hydrationCacheProfile !== null) { |
@@ -906,11 +906,11 @@ discard block |
||
| 906 | 906 | return $result[$realCacheKey]; |
| 907 | 907 | } |
| 908 | 908 | |
| 909 | - if (! $result) { |
|
| 909 | + if ( ! $result) { |
|
| 910 | 910 | $result = []; |
| 911 | 911 | } |
| 912 | 912 | |
| 913 | - $setCacheEntry = static function ($data) use ($cache, $result, $cacheKey, $realCacheKey, $queryCacheProfile) { |
|
| 913 | + $setCacheEntry = static function($data) use ($cache, $result, $cacheKey, $realCacheKey, $queryCacheProfile) { |
|
| 914 | 914 | $result[$realCacheKey] = $data; |
| 915 | 915 | |
| 916 | 916 | $cache->save($cacheKey, $result, $queryCacheProfile->getLifetime()); |
@@ -1072,7 +1072,7 @@ discard block |
||
| 1072 | 1072 | { |
| 1073 | 1073 | $query = $this->getSQL(); |
| 1074 | 1074 | $hints = $this->getHints(); |
| 1075 | - $params = array_map(function (Parameter $parameter) { |
|
| 1075 | + $params = array_map(function(Parameter $parameter) { |
|
| 1076 | 1076 | $value = $parameter->getValue(); |
| 1077 | 1077 | |
| 1078 | 1078 | // Small optimization |
@@ -1086,6 +1086,6 @@ discard block |
||
| 1086 | 1086 | |
| 1087 | 1087 | ksort($hints); |
| 1088 | 1088 | |
| 1089 | - return sha1($query . '-' . serialize($params) . '-' . serialize($hints)); |
|
| 1089 | + return sha1($query.'-'.serialize($params).'-'.serialize($hints)); |
|
| 1090 | 1090 | } |
| 1091 | 1091 | } |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | |
| 233 | 233 | // Check query cache. |
| 234 | 234 | $queryCache = $this->getQueryCacheDriver(); |
| 235 | - if (! ($this->useQueryCache && $queryCache)) { |
|
| 235 | + if ( ! ($this->useQueryCache && $queryCache)) { |
|
| 236 | 236 | $parser = new Parser($this); |
| 237 | 237 | |
| 238 | 238 | $this->parserResult = $parser->parse(); |
@@ -367,7 +367,7 @@ discard block |
||
| 367 | 367 | foreach ($this->parameters as $parameter) { |
| 368 | 368 | $key = $parameter->getName(); |
| 369 | 369 | |
| 370 | - if (! isset($paramMappings[$key])) { |
|
| 370 | + if ( ! isset($paramMappings[$key])) { |
|
| 371 | 371 | throw QueryException::unknownParameter($key); |
| 372 | 372 | } |
| 373 | 373 | |
@@ -696,7 +696,7 @@ discard block |
||
| 696 | 696 | public function setLockMode($lockMode) |
| 697 | 697 | { |
| 698 | 698 | if (in_array($lockMode, [LockMode::NONE, LockMode::PESSIMISTIC_READ, LockMode::PESSIMISTIC_WRITE], true)) { |
| 699 | - if (! $this->em->getConnection()->isTransactionActive()) { |
|
| 699 | + if ( ! $this->em->getConnection()->isTransactionActive()) { |
|
| 700 | 700 | throw TransactionRequiredException::transactionRequired(); |
| 701 | 701 | } |
| 702 | 702 | } |
@@ -737,11 +737,11 @@ discard block |
||
| 737 | 737 | ->getName(); |
| 738 | 738 | |
| 739 | 739 | return md5( |
| 740 | - $this->getDQL() . serialize($this->hints) . |
|
| 741 | - '&platform=' . $platform . |
|
| 742 | - ($this->em->hasFilters() ? $this->em->getFilters()->getHash() : '') . |
|
| 743 | - '&firstResult=' . $this->firstResult . '&maxResult=' . $this->maxResults . |
|
| 744 | - '&hydrationMode=' . $this->hydrationMode . '&types=' . serialize($this->parsedTypes) . 'DOCTRINE_QUERY_CACHE_SALT' |
|
| 740 | + $this->getDQL().serialize($this->hints). |
|
| 741 | + '&platform='.$platform. |
|
| 742 | + ($this->em->hasFilters() ? $this->em->getFilters()->getHash() : ''). |
|
| 743 | + '&firstResult='.$this->firstResult.'&maxResult='.$this->maxResults. |
|
| 744 | + '&hydrationMode='.$this->hydrationMode.'&types='.serialize($this->parsedTypes).'DOCTRINE_QUERY_CACHE_SALT' |
|
| 745 | 745 | ); |
| 746 | 746 | } |
| 747 | 747 | |
@@ -750,7 +750,7 @@ discard block |
||
| 750 | 750 | */ |
| 751 | 751 | protected function getHash() |
| 752 | 752 | { |
| 753 | - return sha1(parent::getHash() . '-' . $this->firstResult . '-' . $this->maxResults); |
|
| 753 | + return sha1(parent::getHash().'-'.$this->firstResult.'-'.$this->maxResults); |
|
| 754 | 754 | } |
| 755 | 755 | |
| 756 | 756 | /** |
@@ -160,7 +160,7 @@ |
||
| 160 | 160 | ?ClassMetadata $parent, |
| 161 | 161 | ClassMetadataBuildingContext $metadataBuildingContext |
| 162 | 162 | ) : ClassMetadataDefinition { |
| 163 | - if (! isset($this->definitions[$className])) { |
|
| 163 | + if ( ! isset($this->definitions[$className])) { |
|
| 164 | 164 | $this->definitions[$className] = $this->definitionFactory->build($className, $parent, $metadataBuildingContext); |
| 165 | 165 | } |
| 166 | 166 | |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | ?string $className = null, |
| 44 | 44 | ?string $embeddedClassName = null |
| 45 | 45 | ) : string { |
| 46 | - return $propertyName . '_' . $embeddedColumnName; |
|
| 46 | + return $propertyName.'_'.$embeddedColumnName; |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | */ |
| 60 | 60 | public function joinColumnName(string $propertyName, ?string $className = null) : string |
| 61 | 61 | { |
| 62 | - return $propertyName . '_' . $this->referenceColumnName(); |
|
| 62 | + return $propertyName.'_'.$this->referenceColumnName(); |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | /** |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | */ |
| 68 | 68 | public function joinTableName(string $sourceEntity, string $targetEntity, ?string $propertyName = null) : string |
| 69 | 69 | { |
| 70 | - return strtolower($this->classToTableName($sourceEntity) . '_' . |
|
| 70 | + return strtolower($this->classToTableName($sourceEntity).'_'. |
|
| 71 | 71 | $this->classToTableName($targetEntity)); |
| 72 | 72 | } |
| 73 | 73 | |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | public function joinKeyColumnName(string $entityName, ?string $referencedColumnName = null) : string |
| 78 | 78 | { |
| 79 | 79 | return strtolower( |
| 80 | - $this->classToTableName($entityName) . '_' . ($referencedColumnName ?: $this->referenceColumnName()) |
|
| 80 | + $this->classToTableName($entityName).'_'.($referencedColumnName ?: $this->referenceColumnName()) |
|
| 81 | 81 | ); |
| 82 | 82 | } |
| 83 | 83 | } |