@@ -62,17 +62,17 @@ discard block |
||
| 62 | 62 | */ |
| 63 | 63 | public function get(QueryCacheKey $key, ResultSetMapping $rsm, array $hints = []) |
| 64 | 64 | { |
| 65 | - if (! ($key->cacheMode & Cache::MODE_GET)) { |
|
| 65 | + if ( ! ($key->cacheMode & Cache::MODE_GET)) { |
|
| 66 | 66 | return null; |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | $cacheEntry = $this->region->get($key); |
| 70 | 70 | |
| 71 | - if (! $cacheEntry instanceof QueryCacheEntry) { |
|
| 71 | + if ( ! $cacheEntry instanceof QueryCacheEntry) { |
|
| 72 | 72 | return null; |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - if (! $this->validator->isValid($key, $cacheEntry)) { |
|
| 75 | + if ( ! $this->validator->isValid($key, $cacheEntry)) { |
|
| 76 | 76 | $this->region->evict($key); |
| 77 | 77 | |
| 78 | 78 | return null; |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | $cm = $this->em->getClassMetadata($entityName); |
| 90 | 90 | |
| 91 | - $generateKeys = function (array $entry) use ($cm) : EntityCacheKey { |
|
| 91 | + $generateKeys = function(array $entry) use ($cm) : EntityCacheKey { |
|
| 92 | 92 | return new EntityCacheKey($cm->getRootClassName(), $entry['identifier']); |
| 93 | 93 | }; |
| 94 | 94 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | $this->cacheLogger->entityCacheHit($regionName, $cacheKeys->identifiers[$index]); |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | - if (! $hasRelation) { |
|
| 114 | + if ( ! $hasRelation) { |
|
| 115 | 115 | $result[$index] = $unitOfWork->createEntity( |
| 116 | 116 | $entityEntry->class, |
| 117 | 117 | $entityEntry->resolveAssociationEntries($this->em), |
@@ -156,11 +156,11 @@ discard block |
||
| 156 | 156 | continue; |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | - if (! isset($assoc['list']) || empty($assoc['list'])) { |
|
| 159 | + if ( ! isset($assoc['list']) || empty($assoc['list'])) { |
|
| 160 | 160 | continue; |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | - $generateKeys = function ($id) use ($assocMetadata) : EntityCacheKey { |
|
| 163 | + $generateKeys = function($id) use ($assocMetadata) : EntityCacheKey { |
|
| 164 | 164 | return new EntityCacheKey($assocMetadata->getRootClassName(), $id); |
| 165 | 165 | }; |
| 166 | 166 | |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | throw FeatureNotImplemented::multipleRootEntities(); |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | - if (! $rsm->isSelect) { |
|
| 241 | + if ( ! $rsm->isSelect) { |
|
| 242 | 242 | throw FeatureNotImplemented::nonSelectStatements(); |
| 243 | 243 | } |
| 244 | 244 | |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | throw FeatureNotImplemented::partialEntities(); |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | - if (! ($key->cacheMode & Cache::MODE_PUT)) { |
|
| 249 | + if ( ! ($key->cacheMode & Cache::MODE_PUT)) { |
|
| 250 | 250 | return false; |
| 251 | 251 | } |
| 252 | 252 | |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | $unitOfWork = $this->em->getUnitOfWork(); |
| 257 | 257 | $persister = $unitOfWork->getEntityPersister($entityName); |
| 258 | 258 | |
| 259 | - if (! ($persister instanceof CachedPersister)) { |
|
| 259 | + if ( ! ($persister instanceof CachedPersister)) { |
|
| 260 | 260 | throw NonCacheableEntity::fromEntity($entityName); |
| 261 | 261 | } |
| 262 | 262 | |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | |
| 269 | 269 | if (($key->cacheMode & Cache::MODE_REFRESH) || ! $region->contains($entityKey)) { |
| 270 | 270 | // Cancel put result if entity put fail |
| 271 | - if (! $persister->storeEntityCache($entity, $entityKey)) { |
|
| 271 | + if ( ! $persister->storeEntityCache($entity, $entityKey)) { |
|
| 272 | 272 | return false; |
| 273 | 273 | } |
| 274 | 274 | } |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | } |
| 303 | 303 | |
| 304 | 304 | // store single nested association |
| 305 | - if (! is_array($assocValue)) { |
|
| 305 | + if ( ! is_array($assocValue)) { |
|
| 306 | 306 | // Cancel put result if association put fail |
| 307 | 307 | if ($this->storeAssociationCache($key, $association, $assocValue) === null) { |
| 308 | 308 | return false; |
@@ -341,9 +341,9 @@ discard block |
||
| 341 | 341 | $assocIdentifier = $unitOfWork->getEntityIdentifier($assocValue); |
| 342 | 342 | $entityKey = new EntityCacheKey($assocMetadata->getRootClassName(), $assocIdentifier); |
| 343 | 343 | |
| 344 | - if ((! $assocValue instanceof GhostObjectInterface && ($key->cacheMode & Cache::MODE_REFRESH)) || ! $assocRegion->contains($entityKey)) { |
|
| 344 | + if (( ! $assocValue instanceof GhostObjectInterface && ($key->cacheMode & Cache::MODE_REFRESH)) || ! $assocRegion->contains($entityKey)) { |
|
| 345 | 345 | // Entity put fail |
| 346 | - if (! $assocPersister->storeEntityCache($assocValue, $entityKey)) { |
|
| 346 | + if ( ! $assocPersister->storeEntityCache($assocValue, $entityKey)) { |
|
| 347 | 347 | return null; |
| 348 | 348 | } |
| 349 | 349 | } |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | |
| 364 | 364 | if (($key->cacheMode & Cache::MODE_REFRESH) || ! $assocRegion->contains($entityKey)) { |
| 365 | 365 | // Entity put fail |
| 366 | - if (! $assocPersister->storeEntityCache($assocItem, $entityKey)) { |
|
| 366 | + if ( ! $assocPersister->storeEntityCache($assocItem, $entityKey)) { |
|
| 367 | 367 | return null; |
| 368 | 368 | } |
| 369 | 369 | } |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | public function getClassShortName(string $className) : string |
| 29 | 29 | { |
| 30 | 30 | if (strpos($className, '\\') !== false) { |
| 31 | - $className = substr($className, strrpos($className, '\\')+1); |
|
| 31 | + $className = substr($className, strrpos($className, '\\') + 1); |
|
| 32 | 32 | } |
| 33 | 33 | return $className; |
| 34 | 34 | } |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | $namespace = ''; |
| 42 | 42 | |
| 43 | 43 | if (strpos($className, '\\') !== false) { |
| 44 | - $namespace = strrev(substr(strrev($className), strpos(strrev($className), '\\')+1)); |
|
| 44 | + $namespace = strrev(substr(strrev($className), strpos(strrev($className), '\\') + 1)); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | return $namespace; |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | public function getParentClasses(string $className) : array |
| 20 | 20 | { |
| 21 | - if (! class_exists($className)) { |
|
| 21 | + if ( ! class_exists($className)) { |
|
| 22 | 22 | throw MappingException::nonExistingClass($className); |
| 23 | 23 | } |
| 24 | 24 | |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | */ |
| 27 | 27 | public function getRepository(EntityManagerInterface $entityManager, $entityName) |
| 28 | 28 | { |
| 29 | - $repositoryHash = $entityManager->getClassMetadata($entityName)->getClassName() . spl_object_id($entityManager); |
|
| 29 | + $repositoryHash = $entityManager->getClassMetadata($entityName)->getClassName().spl_object_id($entityManager); |
|
| 30 | 30 | |
| 31 | 31 | return $this->repositoryList[$repositoryHash] |
| 32 | 32 | ?? $this->repositoryList[$repositoryHash] = $this->createRepository($entityManager, $entityName); |
@@ -14,13 +14,13 @@ |
||
| 14 | 14 | string $method |
| 15 | 15 | ) : self { |
| 16 | 16 | return new self( |
| 17 | - "Entity '" . $entityName . "' has no field '" . $fieldName . "'. " . |
|
| 18 | - "You can therefore not call '" . $method . "' on the entities' repository." |
|
| 17 | + "Entity '".$entityName."' has no field '".$fieldName."'. ". |
|
| 18 | + "You can therefore not call '".$method."' on the entities' repository." |
|
| 19 | 19 | ); |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | public static function onMissingParameter(string $methodName) : self |
| 23 | 23 | { |
| 24 | - return new self("You need to pass a parameter to '" . $methodName . "'"); |
|
| 24 | + return new self("You need to pass a parameter to '".$methodName."'"); |
|
| 25 | 25 | } |
| 26 | 26 | } |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | string $associationFieldName |
| 14 | 14 | ) : self { |
| 15 | 15 | return new self( |
| 16 | - "You cannot search for the association field '" . $entityName . '#' . $associationFieldName . "', " . |
|
| 16 | + "You cannot search for the association field '".$entityName.'#'.$associationFieldName."', ". |
|
| 17 | 17 | 'because it is the inverse side of an association. Find methods only work on owning side associations.' |
| 18 | 18 | ); |
| 19 | 19 | } |
@@ -82,8 +82,8 @@ |
||
| 82 | 82 | */ |
| 83 | 83 | final public function getParameter($name) |
| 84 | 84 | { |
| 85 | - if (! isset($this->parameters[$name])) { |
|
| 86 | - throw new \InvalidArgumentException("Parameter '" . $name . "' does not exist."); |
|
| 85 | + if ( ! isset($this->parameters[$name])) { |
|
| 86 | + throw new \InvalidArgumentException("Parameter '".$name."' does not exist."); |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | return $this->em->getConnection()->quote($this->parameters[$name]['value'], $this->parameters[$name]['type']); |
@@ -80,11 +80,11 @@ discard block |
||
| 80 | 80 | */ |
| 81 | 81 | public function enable($name) |
| 82 | 82 | { |
| 83 | - if (! $this->has($name)) { |
|
| 84 | - throw new \InvalidArgumentException("Filter '" . $name . "' does not exist."); |
|
| 83 | + if ( ! $this->has($name)) { |
|
| 84 | + throw new \InvalidArgumentException("Filter '".$name."' does not exist."); |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - if (! $this->isEnabled($name)) { |
|
| 87 | + if ( ! $this->isEnabled($name)) { |
|
| 88 | 88 | $filterClass = $this->config->getFilterClassName($name); |
| 89 | 89 | |
| 90 | 90 | $this->enabledFilters[$name] = new $filterClass($this->em); |
@@ -132,8 +132,8 @@ discard block |
||
| 132 | 132 | */ |
| 133 | 133 | public function getFilter($name) |
| 134 | 134 | { |
| 135 | - if (! $this->isEnabled($name)) { |
|
| 136 | - throw new \InvalidArgumentException("Filter '" . $name . "' is not enabled."); |
|
| 135 | + if ( ! $this->isEnabled($name)) { |
|
| 136 | + throw new \InvalidArgumentException("Filter '".$name."' is not enabled."); |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | return $this->enabledFilters[$name]; |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | $filterHash = ''; |
| 187 | 187 | |
| 188 | 188 | foreach ($this->enabledFilters as $name => $filter) { |
| 189 | - $filterHash .= $name . $filter; |
|
| 189 | + $filterHash .= $name.$filter; |
|
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | return $filterHash; |
@@ -67,8 +67,8 @@ discard block |
||
| 67 | 67 | // 1. Create an INSERT INTO temptable ... SELECT identifiers WHERE $AST->getWhereClause() |
| 68 | 68 | $sqlWalker->setSQLTableAlias($primaryClass->getTableName(), 'i0', $updateClause->aliasIdentificationVariable); |
| 69 | 69 | |
| 70 | - $this->insertSql = 'INSERT INTO ' . $tempTable . ' (' . $idColumnNameList . ')' |
|
| 71 | - . ' SELECT i0.' . implode(', i0.', array_keys($idColumns)); |
|
| 70 | + $this->insertSql = 'INSERT INTO '.$tempTable.' ('.$idColumnNameList.')' |
|
| 71 | + . ' SELECT i0.'.implode(', i0.', array_keys($idColumns)); |
|
| 72 | 72 | |
| 73 | 73 | $rangeDecl = new AST\RangeVariableDeclaration($primaryClass->getClassName(), $updateClause->aliasIdentificationVariable); |
| 74 | 74 | $fromClause = new AST\FromClause([new AST\IdentificationVariableDeclaration($rangeDecl, null, [])]); |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | // 3. Create and store UPDATE statements |
| 87 | 87 | $hierarchyClasses = array_merge( |
| 88 | 88 | array_map( |
| 89 | - function ($className) use ($em) { |
|
| 89 | + function($className) use ($em) { |
|
| 90 | 90 | return $em->getClassMetadata($className); |
| 91 | 91 | }, |
| 92 | 92 | array_reverse($primaryClass->getSubClasses()) |
@@ -142,8 +142,8 @@ discard block |
||
| 142 | 142 | ]; |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | - $this->createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable . ' (' |
|
| 146 | - . $platform->getColumnDeclarationListSQL($columnDefinitions) . ')'; |
|
| 145 | + $this->createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL().' '.$tempTable.' (' |
|
| 146 | + . $platform->getColumnDeclarationListSQL($columnDefinitions).')'; |
|
| 147 | 147 | |
| 148 | 148 | $this->dropTempTableSql = $platform->getDropTemporaryTableSQL($tempTable); |
| 149 | 149 | } |