@@ -56,7 +56,7 @@ |
||
| 56 | 56 | $metadata = $it->current(); |
| 57 | 57 | |
| 58 | 58 | foreach ($this->filter as $filter) { |
| 59 | - $pregResult = preg_match('/' . $filter . '/', $metadata->getClassName()); |
|
| 59 | + $pregResult = preg_match('/'.$filter.'/', $metadata->getClassName()); |
|
| 60 | 60 | |
| 61 | 61 | if ($pregResult === false) { |
| 62 | 62 | throw new \RuntimeException( |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | /** @var Query $countQuery */ |
| 222 | 222 | $countQuery = $this->cloneQuery($this->query); |
| 223 | 223 | |
| 224 | - if (! $countQuery->hasHint(CountWalker::HINT_DISTINCT)) { |
|
| 224 | + if ( ! $countQuery->hasHint(CountWalker::HINT_DISTINCT)) { |
|
| 225 | 225 | $countQuery->setHint(CountWalker::HINT_DISTINCT, true); |
| 226 | 226 | } |
| 227 | 227 | |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | foreach ($parameters as $key => $parameter) { |
| 249 | 249 | $parameterName = $parameter->getName(); |
| 250 | 250 | |
| 251 | - if (! (isset($parameterMappings[$parameterName]) || array_key_exists($parameterName, $parameterMappings))) { |
|
| 251 | + if ( ! (isset($parameterMappings[$parameterName]) || array_key_exists($parameterName, $parameterMappings))) { |
|
| 252 | 252 | unset($parameters[$key]); |
| 253 | 253 | } |
| 254 | 254 | } |
@@ -28,9 +28,9 @@ |
||
| 28 | 28 | */ |
| 29 | 29 | public function getSql(SqlWalker $sqlWalker) |
| 30 | 30 | { |
| 31 | - return 'ROW_NUMBER() OVER(' . trim($sqlWalker->walkOrderByClause( |
|
| 31 | + return 'ROW_NUMBER() OVER('.trim($sqlWalker->walkOrderByClause( |
|
| 32 | 32 | $this->orderByClause |
| 33 | - )) . ')'; |
|
| 33 | + )).')'; |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | /** |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | if ($property instanceof AssociationMetadata) { |
| 55 | 55 | throw new \RuntimeException( |
| 56 | - 'Paginating an entity with foreign key as identifier only works when using the Output Walkers. ' . |
|
| 56 | + 'Paginating an entity with foreign key as identifier only works when using the Output Walkers. '. |
|
| 57 | 57 | 'Call Paginator#setUseOutputWalkers(true) before iterating the paginator.' |
| 58 | 58 | ); |
| 59 | 59 | } |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | $AST->selectClause->selectExpressions = [new SelectExpression($pathExpression, '_dctrn_id')]; |
| 72 | 72 | $AST->selectClause->isDistinct = true; |
| 73 | 73 | |
| 74 | - if (! isset($AST->orderByClause)) { |
|
| 74 | + if ( ! isset($AST->orderByClause)) { |
|
| 75 | 75 | return; |
| 76 | 76 | } |
| 77 | 77 | |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | if ($item->expression instanceof PathExpression) { |
| 80 | 80 | $AST->selectClause->selectExpressions[] = new SelectExpression( |
| 81 | 81 | $this->createSelectExpressionItem($item->expression), |
| 82 | - '_dctrn_ord' . $this->aliasCounter++ |
|
| 82 | + '_dctrn_ord'.$this->aliasCounter++ |
|
| 83 | 83 | ); |
| 84 | 84 | |
| 85 | 85 | continue; |
@@ -191,13 +191,13 @@ discard block |
||
| 191 | 191 | |
| 192 | 192 | $innerSql = $this->getInnerSQL($AST); |
| 193 | 193 | $sqlIdentifier = $this->getSQLIdentifier($AST); |
| 194 | - $sqlAliasIdentifier = array_map(function ($info) { |
|
| 194 | + $sqlAliasIdentifier = array_map(function($info) { |
|
| 195 | 195 | return $info['alias']; |
| 196 | 196 | }, $sqlIdentifier); |
| 197 | 197 | |
| 198 | 198 | if ($hasOrderBy) { |
| 199 | - $orderGroupBy = ' GROUP BY ' . implode(', ', $sqlAliasIdentifier); |
|
| 200 | - $sqlPiece = 'MIN(' . $this->walkResultVariable('dctrn_rownum') . ') AS dctrn_minrownum'; |
|
| 199 | + $orderGroupBy = ' GROUP BY '.implode(', ', $sqlAliasIdentifier); |
|
| 200 | + $sqlPiece = 'MIN('.$this->walkResultVariable('dctrn_rownum').') AS dctrn_minrownum'; |
|
| 201 | 201 | |
| 202 | 202 | $sqlAliasIdentifier[] = $sqlPiece; |
| 203 | 203 | $sqlIdentifier[] = [ |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | $sql = sprintf('SELECT DISTINCT %s FROM (%s) dctrn_result', implode(', ', $sqlAliasIdentifier), $innerSql); |
| 211 | 211 | |
| 212 | 212 | if ($hasOrderBy) { |
| 213 | - $sql .= $orderGroupBy . $outerOrderBy; |
|
| 213 | + $sql .= $orderGroupBy.$outerOrderBy; |
|
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | // Apply the limit and offset. |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | |
| 255 | 255 | $innerSql = $this->getInnerSQL($AST); |
| 256 | 256 | $sqlIdentifier = $this->getSQLIdentifier($AST); |
| 257 | - $sqlAliasIdentifier = array_map(function ($info) { |
|
| 257 | + $sqlAliasIdentifier = array_map(function($info) { |
|
| 258 | 258 | return $info['alias']; |
| 259 | 259 | }, $sqlIdentifier); |
| 260 | 260 | |
@@ -312,7 +312,7 @@ discard block |
||
| 312 | 312 | $idVar = $pathExpression->identificationVariable; |
| 313 | 313 | $field = $pathExpression->field; |
| 314 | 314 | |
| 315 | - if (! isset($selects[$idVar])) { |
|
| 315 | + if ( ! isset($selects[$idVar])) { |
|
| 316 | 316 | $selects[$idVar] = []; |
| 317 | 317 | } |
| 318 | 318 | |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | if ($selectExpression instanceof SelectExpression) { |
| 326 | 326 | $idVar = $selectExpression->expression; |
| 327 | 327 | |
| 328 | - if (! is_string($idVar)) { |
|
| 328 | + if ( ! is_string($idVar)) { |
|
| 329 | 329 | continue; |
| 330 | 330 | } |
| 331 | 331 | |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | ?OrderByClause $orderByClause |
| 361 | 361 | ) : string { |
| 362 | 362 | // If the sql statement has an order by clause, we need to wrap it in a new select distinct statement |
| 363 | - if (! $orderByClause) { |
|
| 363 | + if ( ! $orderByClause) { |
|
| 364 | 364 | return $sql; |
| 365 | 365 | } |
| 366 | 366 | |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | $orderByItems[] = $orderByItemString; |
| 399 | 399 | $identifier = substr($orderByItemString, 0, strrpos($orderByItemString, ' ')); |
| 400 | 400 | |
| 401 | - if (! in_array($identifier, $identifiers, true)) { |
|
| 401 | + if ( ! in_array($identifier, $identifiers, true)) { |
|
| 402 | 402 | $identifiers[] = $identifier; |
| 403 | 403 | } |
| 404 | 404 | } |
@@ -551,7 +551,7 @@ discard block |
||
| 551 | 551 | */ |
| 552 | 552 | public function walkPathExpression($pathExpr) |
| 553 | 553 | { |
| 554 | - if (! $this->inSubSelect && ! $this->platformSupportsRowNumber() && ! in_array($pathExpr, $this->orderByPathExpressions, true)) { |
|
| 554 | + if ( ! $this->inSubSelect && ! $this->platformSupportsRowNumber() && ! in_array($pathExpr, $this->orderByPathExpressions, true)) { |
|
| 555 | 555 | $this->orderByPathExpressions[] = $pathExpr; |
| 556 | 556 | } |
| 557 | 557 | |
@@ -89,7 +89,7 @@ |
||
| 89 | 89 | [$pathExpression] |
| 90 | 90 | ); |
| 91 | 91 | $expression = new InExpression($arithmeticExpression); |
| 92 | - $expression->literals[] = new InputParameter(':' . self::PAGINATOR_ID_ALIAS); |
|
| 92 | + $expression->literals[] = new InputParameter(':'.self::PAGINATOR_ID_ALIAS); |
|
| 93 | 93 | } else { |
| 94 | 94 | $expression = new NullComparisonExpression($pathExpression); |
| 95 | 95 | $expression->not = false; |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | /** @var ClassMetadata $metadata */ |
| 43 | 43 | $metadata = $event->getClassMetadata(); |
| 44 | 44 | |
| 45 | - if (! isset($this->entityListeners[$metadata->getClassName()])) { |
|
| 45 | + if ( ! isset($this->entityListeners[$metadata->getClassName()])) { |
|
| 46 | 46 | return; |
| 47 | 47 | } |
| 48 | 48 | |
@@ -31,14 +31,14 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | public static function registerAutoloadDirectory($directory) |
| 33 | 33 | { |
| 34 | - if (! class_exists('Doctrine\Common\ClassLoader', false)) { |
|
| 35 | - require_once $directory . '/Doctrine/Common/ClassLoader.php'; |
|
| 34 | + if ( ! class_exists('Doctrine\Common\ClassLoader', false)) { |
|
| 35 | + require_once $directory.'/Doctrine/Common/ClassLoader.php'; |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | $loader = new ClassLoader('Doctrine', $directory); |
| 39 | 39 | $loader->register(); |
| 40 | 40 | |
| 41 | - $loader = new ClassLoader('Symfony\Component', $directory . '/Doctrine'); |
|
| 41 | + $loader = new ClassLoader('Symfony\Component', $directory.'/Doctrine'); |
|
| 42 | 42 | $loader->register(); |
| 43 | 43 | } |
| 44 | 44 | |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | { |
| 106 | 106 | $cache = self::createCacheInstance($isDevMode, $cache); |
| 107 | 107 | |
| 108 | - if (! $cache instanceof CacheProvider) { |
|
| 108 | + if ( ! $cache instanceof CacheProvider) { |
|
| 109 | 109 | return $cache; |
| 110 | 110 | } |
| 111 | 111 | |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | $namespace .= ':'; |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | - $cache->setNamespace($namespace . 'dc2_' . md5($proxyDir) . '_'); // to avoid collisions |
|
| 118 | + $cache->setNamespace($namespace.'dc2_'.md5($proxyDir).'_'); // to avoid collisions |
|
| 119 | 119 | |
| 120 | 120 | return $cache; |
| 121 | 121 | } |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | public static function scheduleInsertForManagedEntity($entity) |
| 31 | 31 | { |
| 32 | - return new self('A managed+dirty entity ' . self::objToStr($entity) . ' can not be scheduled for insertion.'); |
|
| 32 | + return new self('A managed+dirty entity '.self::objToStr($entity).' can not be scheduled for insertion.'); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | */ |
| 40 | 40 | public static function scheduleInsertForRemovedEntity($entity) |
| 41 | 41 | { |
| 42 | - return new self('Removed entity ' . self::objToStr($entity) . ' can not be scheduled for insertion.'); |
|
| 42 | + return new self('Removed entity '.self::objToStr($entity).' can not be scheduled for insertion.'); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /** |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | public static function scheduleInsertTwice($entity) |
| 51 | 51 | { |
| 52 | - return new self('Entity ' . self::objToStr($entity) . ' can not be scheduled for insertion twice.'); |
|
| 52 | + return new self('Entity '.self::objToStr($entity).' can not be scheduled for insertion twice.'); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | /** |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | public static function entityWithoutIdentity($className, $entity) |
| 62 | 62 | { |
| 63 | 63 | return new self( |
| 64 | - "The given entity of type '" . $className . "' (" . self::objToStr($entity) . ') has no identity/no ' . |
|
| 64 | + "The given entity of type '".$className."' (".self::objToStr($entity).') has no identity/no '. |
|
| 65 | 65 | 'id values set. It cannot be added to the identity map.' |
| 66 | 66 | ); |
| 67 | 67 | } |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | */ |
| 74 | 74 | public static function readOnlyRequiresManagedEntity($entity) |
| 75 | 75 | { |
| 76 | - return new self('Only managed entities can be marked or checked as read only. But ' . self::objToStr($entity) . ' is not'); |
|
| 76 | + return new self('Only managed entities can be marked or checked as read only. But '.self::objToStr($entity).' is not'); |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | /** |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | public static function newEntitiesFoundThroughRelationships($newEntitiesWithAssociations) |
| 85 | 85 | { |
| 86 | 86 | $errorMessages = array_map( |
| 87 | - function (array $newEntityWithAssociation) : string { |
|
| 87 | + function(array $newEntityWithAssociation) : string { |
|
| 88 | 88 | [$associationMetadata, $entity] = $newEntityWithAssociation; |
| 89 | 89 | |
| 90 | 90 | return self::newEntityFoundThroughRelationshipMessage($associationMetadata, $entity); |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | */ |
| 155 | 155 | public static function entityNotManaged($entity) |
| 156 | 156 | { |
| 157 | - return new self('Entity ' . self::objToStr($entity) . ' is not managed. An entity is managed if its fetched ' . |
|
| 157 | + return new self('Entity '.self::objToStr($entity).' is not managed. An entity is managed if its fetched '. |
|
| 158 | 158 | 'from the database or registered as new through EntityManager#persist'); |
| 159 | 159 | } |
| 160 | 160 | |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | */ |
| 167 | 167 | public static function entityHasNoIdentity($entity, $operation) |
| 168 | 168 | { |
| 169 | - return new self('Entity has no identity, therefore ' . $operation . ' cannot be performed. ' . self::objToStr($entity)); |
|
| 169 | + return new self('Entity has no identity, therefore '.$operation.' cannot be performed. '.self::objToStr($entity)); |
|
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | /** |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | */ |
| 178 | 178 | public static function entityIsRemoved($entity, $operation) |
| 179 | 179 | { |
| 180 | - return new self('Entity is removed, therefore ' . $operation . ' cannot be performed. ' . self::objToStr($entity)); |
|
| 180 | + return new self('Entity is removed, therefore '.$operation.' cannot be performed. '.self::objToStr($entity)); |
|
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | /** |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | */ |
| 189 | 189 | public static function detachedEntityCannot($entity, $operation) |
| 190 | 190 | { |
| 191 | - return new self('Detached entity ' . self::objToStr($entity) . ' cannot be ' . $operation); |
|
| 191 | + return new self('Detached entity '.self::objToStr($entity).' cannot be '.$operation); |
|
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | /** |
@@ -200,8 +200,8 @@ discard block |
||
| 200 | 200 | */ |
| 201 | 201 | public static function invalidObject($context, $given, $parameterIndex = 1) |
| 202 | 202 | { |
| 203 | - return new self($context . ' expects parameter ' . $parameterIndex . |
|
| 204 | - ' to be an entity object, ' . gettype($given) . ' given.'); |
|
| 203 | + return new self($context.' expects parameter '.$parameterIndex. |
|
| 204 | + ' to be an entity object, '.gettype($given).' given.'); |
|
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | /** |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | */ |
| 210 | 210 | public static function invalidCompositeIdentifier() |
| 211 | 211 | { |
| 212 | - return new self('Binding an entity with a composite primary key to a query is not supported. ' . |
|
| 212 | + return new self('Binding an entity with a composite primary key to a query is not supported. '. |
|
| 213 | 213 | 'You should split the parameter into the explicit fields and bind them separately.'); |
| 214 | 214 | } |
| 215 | 215 | |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | */ |
| 247 | 247 | private static function objToStr($obj) : string |
| 248 | 248 | { |
| 249 | - return method_exists($obj, '__toString') ? (string) $obj : get_class($obj) . '@' . spl_object_id($obj); |
|
| 249 | + return method_exists($obj, '__toString') ? (string) $obj : get_class($obj).'@'.spl_object_id($obj); |
|
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | /** |
@@ -255,15 +255,15 @@ discard block |
||
| 255 | 255 | private static function newEntityFoundThroughRelationshipMessage(AssociationMetadata $association, $entity) : string |
| 256 | 256 | { |
| 257 | 257 | return 'A new entity was found through the relationship \'' |
| 258 | - . $association->getSourceEntity() . '#' . $association->getName() . '\' that was not' |
|
| 259 | - . ' configured to cascade persist operations for entity: ' . self::objToStr($entity) . '.' |
|
| 258 | + . $association->getSourceEntity().'#'.$association->getName().'\' that was not' |
|
| 259 | + . ' configured to cascade persist operations for entity: '.self::objToStr($entity).'.' |
|
| 260 | 260 | . ' To solve this issue: Either explicitly call EntityManager#persist()' |
| 261 | 261 | . ' on this unknown entity or configure cascade persist' |
| 262 | 262 | . ' this association in the mapping for example @ManyToOne(..,cascade={"persist"}).' |
| 263 | 263 | . (method_exists($entity, '__toString') |
| 264 | 264 | ? '' |
| 265 | 265 | : ' If you cannot find out which entity causes the problem implement \'' |
| 266 | - . $association->getTargetEntity() . '#__toString()\' to get a clue.' |
|
| 266 | + . $association->getTargetEntity().'#__toString()\' to get a clue.' |
|
| 267 | 267 | ); |
| 268 | 268 | } |
| 269 | 269 | } |