@@ -83,7 +83,7 @@ |
||
| 83 | 83 | |
| 84 | 84 | /** |
| 85 | 85 | * @param array[][]|object[][] $newEntitiesWithAssociations non-empty an array |
| 86 | - * of [array $associationMapping, object $entity] pairs |
|
| 86 | + * of [array $associationMapping, object $entity] pairs |
|
| 87 | 87 | * |
| 88 | 88 | * @return ORMInvalidArgumentException |
| 89 | 89 | */ |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | static public function scheduleInsertForManagedEntity($entity) |
| 36 | 36 | { |
| 37 | - return new self("A managed+dirty entity " . self::objToStr($entity) . " can not be scheduled for insertion."); |
|
| 37 | + return new self("A managed+dirty entity ".self::objToStr($entity)." can not be scheduled for insertion."); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | /** |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | static public function scheduleInsertForRemovedEntity($entity) |
| 46 | 46 | { |
| 47 | - return new self("Removed entity " . self::objToStr($entity) . " can not be scheduled for insertion."); |
|
| 47 | + return new self("Removed entity ".self::objToStr($entity)." can not be scheduled for insertion."); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /** |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | */ |
| 55 | 55 | static public function scheduleInsertTwice($entity) |
| 56 | 56 | { |
| 57 | - return new self("Entity " . self::objToStr($entity) . " can not be scheduled for insertion twice."); |
|
| 57 | + return new self("Entity ".self::objToStr($entity)." can not be scheduled for insertion twice."); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | /** |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | static public function entityWithoutIdentity($className, $entity) |
| 67 | 67 | { |
| 68 | 68 | return new self( |
| 69 | - "The given entity of type '" . $className . "' (".self::objToStr($entity).") has no identity/no " . |
|
| 69 | + "The given entity of type '".$className."' (".self::objToStr($entity).") has no identity/no ". |
|
| 70 | 70 | "id values set. It cannot be added to the identity map." |
| 71 | 71 | ); |
| 72 | 72 | } |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | */ |
| 79 | 79 | static public function readOnlyRequiresManagedEntity($entity) |
| 80 | 80 | { |
| 81 | - return new self("Only managed entities can be marked or checked as read only. But " . self::objToStr($entity) . " is not"); |
|
| 81 | + return new self("Only managed entities can be marked or checked as read only. But ".self::objToStr($entity)." is not"); |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | /** |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | static public function newEntitiesFoundThroughRelationships($newEntitiesWithAssociations) |
| 91 | 91 | { |
| 92 | 92 | $errorMessages = array_map( |
| 93 | - function (array $newEntityWithAssociation) : string { |
|
| 93 | + function(array $newEntityWithAssociation) : string { |
|
| 94 | 94 | [$associationMapping, $entity] = $newEntityWithAssociation; |
| 95 | 95 | |
| 96 | 96 | return self::newEntityFoundThroughRelationshipMessage($associationMapping, $entity); |
@@ -128,8 +128,8 @@ discard block |
||
| 128 | 128 | */ |
| 129 | 129 | static public function detachedEntityFoundThroughRelationship(array $assoc, $entry) |
| 130 | 130 | { |
| 131 | - return new self("A detached entity of type " . $assoc['targetEntity'] . " (" . self::objToStr($entry) . ") " |
|
| 132 | - . " was found through the relationship '" . $assoc['sourceEntity'] . "#" . $assoc['fieldName'] . "' " |
|
| 131 | + return new self("A detached entity of type ".$assoc['targetEntity']." (".self::objToStr($entry).") " |
|
| 132 | + . " was found through the relationship '".$assoc['sourceEntity']."#".$assoc['fieldName']."' " |
|
| 133 | 133 | . "during cascading a persist operation."); |
| 134 | 134 | } |
| 135 | 135 | |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | */ |
| 141 | 141 | static public function entityNotManaged($entity) |
| 142 | 142 | { |
| 143 | - return new self("Entity " . self::objToStr($entity) . " is not managed. An entity is managed if its fetched " . |
|
| 143 | + return new self("Entity ".self::objToStr($entity)." is not managed. An entity is managed if its fetched ". |
|
| 144 | 144 | "from the database or registered as new through EntityManager#persist"); |
| 145 | 145 | } |
| 146 | 146 | |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | */ |
| 153 | 153 | static public function entityHasNoIdentity($entity, $operation) |
| 154 | 154 | { |
| 155 | - return new self("Entity has no identity, therefore " . $operation ." cannot be performed. " . self::objToStr($entity)); |
|
| 155 | + return new self("Entity has no identity, therefore ".$operation." cannot be performed. ".self::objToStr($entity)); |
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | /** |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | */ |
| 164 | 164 | static public function entityIsRemoved($entity, $operation) |
| 165 | 165 | { |
| 166 | - return new self("Entity is removed, therefore " . $operation ." cannot be performed. " . self::objToStr($entity)); |
|
| 166 | + return new self("Entity is removed, therefore ".$operation." cannot be performed. ".self::objToStr($entity)); |
|
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | /** |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | */ |
| 175 | 175 | static public function detachedEntityCannot($entity, $operation) |
| 176 | 176 | { |
| 177 | - return new self("Detached entity " . self::objToStr($entity) . " cannot be " . $operation); |
|
| 177 | + return new self("Detached entity ".self::objToStr($entity)." cannot be ".$operation); |
|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | /** |
@@ -186,8 +186,8 @@ discard block |
||
| 186 | 186 | */ |
| 187 | 187 | public static function invalidObject($context, $given, $parameterIndex = 1) |
| 188 | 188 | { |
| 189 | - return new self($context . ' expects parameter ' . $parameterIndex . |
|
| 190 | - ' to be an entity object, '. gettype($given) . ' given.'); |
|
| 189 | + return new self($context.' expects parameter '.$parameterIndex. |
|
| 190 | + ' to be an entity object, '.gettype($given).' given.'); |
|
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | /** |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | */ |
| 196 | 196 | public static function invalidCompositeIdentifier() |
| 197 | 197 | { |
| 198 | - return new self("Binding an entity with a composite primary key to a query is not supported. " . |
|
| 198 | + return new self("Binding an entity with a composite primary key to a query is not supported. ". |
|
| 199 | 199 | "You should split the parameter into the explicit fields and bind them separately."); |
| 200 | 200 | } |
| 201 | 201 | |
@@ -262,15 +262,15 @@ discard block |
||
| 262 | 262 | private static function newEntityFoundThroughRelationshipMessage(array $associationMapping, $entity) : string |
| 263 | 263 | { |
| 264 | 264 | return 'A new entity was found through the relationship \'' |
| 265 | - . $associationMapping['sourceEntity'] . '#' . $associationMapping['fieldName'] . '\' that was not' |
|
| 266 | - . ' configured to cascade persist operations for entity: ' . self::objToStr($entity) . '.' |
|
| 265 | + . $associationMapping['sourceEntity'].'#'.$associationMapping['fieldName'].'\' that was not' |
|
| 266 | + . ' configured to cascade persist operations for entity: '.self::objToStr($entity).'.' |
|
| 267 | 267 | . ' To solve this issue: Either explicitly call EntityManager#persist()' |
| 268 | 268 | . ' on this unknown entity or configure cascade persist' |
| 269 | 269 | . ' this association in the mapping for example @ManyToOne(..,cascade={"persist"}).' |
| 270 | 270 | . (method_exists($entity, '__toString') |
| 271 | 271 | ? '' |
| 272 | 272 | : ' If you cannot find out which entity causes the problem implement \'' |
| 273 | - . $associationMapping['targetEntity'] . '#__toString()\' to get a clue.' |
|
| 273 | + . $associationMapping['targetEntity'].'#__toString()\' to get a clue.' |
|
| 274 | 274 | ); |
| 275 | 275 | } |
| 276 | 276 | } |
@@ -81,12 +81,12 @@ discard block |
||
| 81 | 81 | 'fieldName' => 'bar1', |
| 82 | 82 | 'targetEntity' => 'baz1', |
| 83 | 83 | ]; |
| 84 | - $association2 = [ |
|
| 84 | + $association2 = [ |
|
| 85 | 85 | 'sourceEntity' => 'foo2', |
| 86 | 86 | 'fieldName' => 'bar2', |
| 87 | 87 | 'targetEntity' => 'baz2', |
| 88 | 88 | ]; |
| 89 | - $association3 = [ |
|
| 89 | + $association3 = [ |
|
| 90 | 90 | 'sourceEntity' => 'foo3', |
| 91 | 91 | 'fieldName' => 'bar3', |
| 92 | 92 | 'targetEntity' => 'baz3', |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | ], |
| 104 | 104 | ], |
| 105 | 105 | 'A new entity was found through the relationship \'foo1#bar1\' that was not configured to cascade ' |
| 106 | - . 'persist operations for entity: stdClass@' . spl_object_hash($entity1) |
|
| 106 | + . 'persist operations for entity: stdClass@'.spl_object_hash($entity1) |
|
| 107 | 107 | . '. To solve this issue: Either explicitly call EntityManager#persist() on this unknown entity ' |
| 108 | 108 | . 'or configure cascade persist this association in the mapping for example ' |
| 109 | 109 | . '@ManyToOne(..,cascade={"persist"}). If you cannot find out which entity causes the problem ' |
@@ -120,15 +120,15 @@ discard block |
||
| 120 | 120 | $entity2, |
| 121 | 121 | ], |
| 122 | 122 | ], |
| 123 | - 'Multiple non-persisted new entities were found through the given association graph:' . "\n\n" |
|
| 123 | + 'Multiple non-persisted new entities were found through the given association graph:'."\n\n" |
|
| 124 | 124 | . ' * A new entity was found through the relationship \'foo1#bar1\' that was not configured to ' |
| 125 | - . 'cascade persist operations for entity: stdClass@' . spl_object_hash($entity1) . '. ' |
|
| 125 | + . 'cascade persist operations for entity: stdClass@'.spl_object_hash($entity1).'. ' |
|
| 126 | 126 | . 'To solve this issue: Either explicitly call EntityManager#persist() on this unknown entity ' |
| 127 | 127 | . 'or configure cascade persist this association in the mapping for example ' |
| 128 | 128 | . '@ManyToOne(..,cascade={"persist"}). If you cannot find out which entity causes the problem ' |
| 129 | - . 'implement \'baz1#__toString()\' to get a clue.' . "\n" |
|
| 129 | + . 'implement \'baz1#__toString()\' to get a clue.'."\n" |
|
| 130 | 130 | . ' * A new entity was found through the relationship \'foo2#bar2\' that was not configured to ' |
| 131 | - . 'cascade persist operations for entity: stdClass@' . spl_object_hash($entity2) . '. To solve ' |
|
| 131 | + . 'cascade persist operations for entity: stdClass@'.spl_object_hash($entity2).'. To solve ' |
|
| 132 | 132 | . 'this issue: Either explicitly call EntityManager#persist() on this unknown entity or ' |
| 133 | 133 | . 'configure cascade persist this association in the mapping for example ' |
| 134 | 134 | . '@ManyToOne(..,cascade={"persist"}). If you cannot find out which entity causes the problem ' |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | ], |
| 143 | 143 | ], |
| 144 | 144 | 'A new entity was found through the relationship \'foo3#bar3\' that was not configured to cascade ' |
| 145 | - . 'persist operations for entity: ' . $stringEntity3 |
|
| 145 | + . 'persist operations for entity: '.$stringEntity3 |
|
| 146 | 146 | . '. To solve this issue: Either explicitly call EntityManager#persist() on this unknown entity ' |
| 147 | 147 | . 'or configure cascade persist this association in the mapping for example ' |
| 148 | 148 | . '@ManyToOne(..,cascade={"persist"}).', |
@@ -43,8 +43,8 @@ discard block |
||
| 43 | 43 | for ($i = 1; $i <= 10000; ++$i) { |
| 44 | 44 | $user = new CMS\CmsUser; |
| 45 | 45 | $user->status = 'user'; |
| 46 | - $user->username = 'user' . $i; |
|
| 47 | - $user->name = 'Mr.Smith-' . $i; |
|
| 46 | + $user->username = 'user'.$i; |
|
| 47 | + $user->name = 'Mr.Smith-'.$i; |
|
| 48 | 48 | |
| 49 | 49 | $this->users[$i] = $user; |
| 50 | 50 | } |
@@ -57,12 +57,12 @@ discard block |
||
| 57 | 57 | // Yes, this is a lot of overhead, but I have no better solution other than |
| 58 | 58 | // completely mocking out the DB, which would be silly (query impact is |
| 59 | 59 | // necessarily part of our benchmarks) |
| 60 | - $this->entityManager->getConnection()->executeQuery('DELETE FROM ' . $this->tableName)->execute(); |
|
| 60 | + $this->entityManager->getConnection()->executeQuery('DELETE FROM '.$this->tableName)->execute(); |
|
| 61 | 61 | |
| 62 | 62 | foreach ($this->users as $key => $user) { |
| 63 | 63 | $this->entityManager->persist($user); |
| 64 | 64 | |
| 65 | - if (! ($key % 20)) { |
|
| 65 | + if ( ! ($key % 20)) { |
|
| 66 | 66 | $this->entityManager->flush(); |
| 67 | 67 | $this->entityManager->clear(); |
| 68 | 68 | } |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | { |
| 32 | 32 | public static function schemaToolFailure(string $sql, Throwable $e) : self |
| 33 | 33 | { |
| 34 | - return new self("Schema-Tool failed with Error '" . $e->getMessage() . "' while executing DDL: " . $sql, "0", $e); |
|
| 34 | + return new self("Schema-Tool failed with Error '".$e->getMessage()."' while executing DDL: ".$sql, "0", $e); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | /** |
@@ -118,11 +118,11 @@ discard block |
||
| 118 | 118 | */ |
| 119 | 119 | private $joinRootAliases = []; |
| 120 | 120 | |
| 121 | - /** |
|
| 122 | - * Whether to use second level cache, if available. |
|
| 123 | - * |
|
| 124 | - * @var boolean |
|
| 125 | - */ |
|
| 121 | + /** |
|
| 122 | + * Whether to use second level cache, if available. |
|
| 123 | + * |
|
| 124 | + * @var boolean |
|
| 125 | + */ |
|
| 126 | 126 | protected $cacheable = false; |
| 127 | 127 | |
| 128 | 128 | /** |
@@ -213,10 +213,10 @@ discard block |
||
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | /** |
| 216 | - * Obtain the name of the second level query cache region in which query results will be stored |
|
| 217 | - * |
|
| 218 | - * @return string|null The cache region name; NULL indicates the default region. |
|
| 219 | - */ |
|
| 216 | + * Obtain the name of the second level query cache region in which query results will be stored |
|
| 217 | + * |
|
| 218 | + * @return string|null The cache region name; NULL indicates the default region. |
|
| 219 | + */ |
|
| 220 | 220 | public function getCacheRegion() |
| 221 | 221 | { |
| 222 | 222 | return $this->cacheRegion; |
@@ -1373,10 +1373,10 @@ discard block |
||
| 1373 | 1373 | */ |
| 1374 | 1374 | private function _getDQLForDelete() |
| 1375 | 1375 | { |
| 1376 | - return 'DELETE' |
|
| 1377 | - . $this->_getReducedDQLQueryPart('from', ['pre' => ' ', 'separator' => ', ']) |
|
| 1378 | - . $this->_getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
| 1379 | - . $this->_getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
| 1376 | + return 'DELETE' |
|
| 1377 | + . $this->_getReducedDQLQueryPart('from', ['pre' => ' ', 'separator' => ', ']) |
|
| 1378 | + . $this->_getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
| 1379 | + . $this->_getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
| 1380 | 1380 | } |
| 1381 | 1381 | |
| 1382 | 1382 | /** |
@@ -1384,11 +1384,11 @@ discard block |
||
| 1384 | 1384 | */ |
| 1385 | 1385 | private function _getDQLForUpdate() |
| 1386 | 1386 | { |
| 1387 | - return 'UPDATE' |
|
| 1388 | - . $this->_getReducedDQLQueryPart('from', ['pre' => ' ', 'separator' => ', ']) |
|
| 1389 | - . $this->_getReducedDQLQueryPart('set', ['pre' => ' SET ', 'separator' => ', ']) |
|
| 1390 | - . $this->_getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
| 1391 | - . $this->_getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
| 1387 | + return 'UPDATE' |
|
| 1388 | + . $this->_getReducedDQLQueryPart('from', ['pre' => ' ', 'separator' => ', ']) |
|
| 1389 | + . $this->_getReducedDQLQueryPart('set', ['pre' => ' SET ', 'separator' => ', ']) |
|
| 1390 | + . $this->_getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
| 1391 | + . $this->_getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
| 1392 | 1392 | } |
| 1393 | 1393 | |
| 1394 | 1394 | /** |
@@ -1397,8 +1397,8 @@ discard block |
||
| 1397 | 1397 | private function _getDQLForSelect() |
| 1398 | 1398 | { |
| 1399 | 1399 | $dql = 'SELECT' |
| 1400 | - . ($this->_dqlParts['distinct']===true ? ' DISTINCT' : '') |
|
| 1401 | - . $this->_getReducedDQLQueryPart('select', ['pre' => ' ', 'separator' => ', ']); |
|
| 1400 | + . ($this->_dqlParts['distinct']===true ? ' DISTINCT' : '') |
|
| 1401 | + . $this->_getReducedDQLQueryPart('select', ['pre' => ' ', 'separator' => ', ']); |
|
| 1402 | 1402 | |
| 1403 | 1403 | $fromParts = $this->getDQLPart('from'); |
| 1404 | 1404 | $joinParts = $this->getDQLPart('join'); |
@@ -1422,10 +1422,10 @@ discard block |
||
| 1422 | 1422 | } |
| 1423 | 1423 | |
| 1424 | 1424 | $dql .= implode(', ', $fromClauses) |
| 1425 | - . $this->_getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
| 1426 | - . $this->_getReducedDQLQueryPart('groupBy', ['pre' => ' GROUP BY ', 'separator' => ', ']) |
|
| 1427 | - . $this->_getReducedDQLQueryPart('having', ['pre' => ' HAVING ']) |
|
| 1428 | - . $this->_getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
| 1425 | + . $this->_getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
| 1426 | + . $this->_getReducedDQLQueryPart('groupBy', ['pre' => ' GROUP BY ', 'separator' => ', ']) |
|
| 1427 | + . $this->_getReducedDQLQueryPart('having', ['pre' => ' HAVING ']) |
|
| 1428 | + . $this->_getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
| 1429 | 1429 | |
| 1430 | 1430 | return $dql; |
| 1431 | 1431 | } |
@@ -1445,8 +1445,8 @@ discard block |
||
| 1445 | 1445 | } |
| 1446 | 1446 | |
| 1447 | 1447 | return ($options['pre'] ?? '') |
| 1448 | - . (is_array($queryPart) ? implode($options['separator'], $queryPart) : $queryPart) |
|
| 1449 | - . ($options['post'] ?? ''); |
|
| 1448 | + . (is_array($queryPart) ? implode($options['separator'], $queryPart) : $queryPart) |
|
| 1449 | + . ($options['post'] ?? ''); |
|
| 1450 | 1450 | } |
| 1451 | 1451 | |
| 1452 | 1452 | /** |
@@ -603,7 +603,7 @@ discard block |
||
| 603 | 603 | public function getParameter($key) |
| 604 | 604 | { |
| 605 | 605 | $filteredParameters = $this->parameters->filter( |
| 606 | - function (Query\Parameter $parameter) use ($key) : bool { |
|
| 606 | + function(Query\Parameter $parameter) use ($key) : bool { |
|
| 607 | 607 | $parameterName = $parameter->getName(); |
| 608 | 608 | |
| 609 | 609 | return $key === $parameterName || (string) $key === (string) $parameterName; |
@@ -685,7 +685,7 @@ discard block |
||
| 685 | 685 | } |
| 686 | 686 | |
| 687 | 687 | $isMultiple = is_array($this->_dqlParts[$dqlPartName]) |
| 688 | - && !($dqlPartName == 'join' && !$append); |
|
| 688 | + && ! ($dqlPartName == 'join' && ! $append); |
|
| 689 | 689 | |
| 690 | 690 | // Allow adding any part retrieved from self::getDQLParts(). |
| 691 | 691 | if (is_array($dqlPart) && $dqlPartName != 'join') { |
@@ -902,7 +902,7 @@ discard block |
||
| 902 | 902 | { |
| 903 | 903 | $rootAliases = $this->getRootAliases(); |
| 904 | 904 | |
| 905 | - if (!in_array($alias, $rootAliases)) { |
|
| 905 | + if ( ! in_array($alias, $rootAliases)) { |
|
| 906 | 906 | throw new Query\QueryException( |
| 907 | 907 | sprintf('Specified root alias %s must be set before invoking indexBy().', $alias) |
| 908 | 908 | ); |
@@ -1304,15 +1304,15 @@ discard block |
||
| 1304 | 1304 | foreach ($criteria->getOrderings() as $sort => $order) { |
| 1305 | 1305 | |
| 1306 | 1306 | $hasValidAlias = false; |
| 1307 | - foreach($allAliases as $alias) { |
|
| 1308 | - if(strpos($sort . '.', $alias . '.') === 0) { |
|
| 1307 | + foreach ($allAliases as $alias) { |
|
| 1308 | + if (strpos($sort.'.', $alias.'.') === 0) { |
|
| 1309 | 1309 | $hasValidAlias = true; |
| 1310 | 1310 | break; |
| 1311 | 1311 | } |
| 1312 | 1312 | } |
| 1313 | 1313 | |
| 1314 | - if(!$hasValidAlias) { |
|
| 1315 | - $sort = $allAliases[0] . '.' . $sort; |
|
| 1314 | + if ( ! $hasValidAlias) { |
|
| 1315 | + $sort = $allAliases[0].'.'.$sort; |
|
| 1316 | 1316 | } |
| 1317 | 1317 | |
| 1318 | 1318 | $this->addOrderBy($sort, $order); |
@@ -1385,7 +1385,7 @@ discard block |
||
| 1385 | 1385 | private function _getDQLForSelect() |
| 1386 | 1386 | { |
| 1387 | 1387 | $dql = 'SELECT' |
| 1388 | - . ($this->_dqlParts['distinct']===true ? ' DISTINCT' : '') |
|
| 1388 | + . ($this->_dqlParts['distinct'] === true ? ' DISTINCT' : '') |
|
| 1389 | 1389 | . $this->_getReducedDQLQueryPart('select', ['pre' => ' ', 'separator' => ', ']); |
| 1390 | 1390 | |
| 1391 | 1391 | $fromParts = $this->getDQLPart('from'); |
@@ -1401,7 +1401,7 @@ discard block |
||
| 1401 | 1401 | |
| 1402 | 1402 | if ($from instanceof Expr\From && isset($joinParts[$from->getAlias()])) { |
| 1403 | 1403 | foreach ($joinParts[$from->getAlias()] as $join) { |
| 1404 | - $fromClause .= ' ' . ((string) $join); |
|
| 1404 | + $fromClause .= ' '.((string) $join); |
|
| 1405 | 1405 | } |
| 1406 | 1406 | } |
| 1407 | 1407 | |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | { |
| 204 | 204 | switch ($mode) { |
| 205 | 205 | case self::COLUMN_RENAMING_INCREMENT: |
| 206 | - return $columnName . $this->sqlCounter++; |
|
| 206 | + return $columnName.$this->sqlCounter++; |
|
| 207 | 207 | |
| 208 | 208 | case self::COLUMN_RENAMING_CUSTOM: |
| 209 | 209 | return $customRenameColumns[$columnName] ?? $columnName; |
@@ -325,19 +325,19 @@ discard block |
||
| 325 | 325 | $counter = 0; |
| 326 | 326 | $resultMapping = $class->getSqlResultSetMapping($resultSetMappingName); |
| 327 | 327 | $rootShortName = $class->reflClass->getShortName(); |
| 328 | - $rootAlias = strtolower($rootShortName[0]) . $counter; |
|
| 328 | + $rootAlias = strtolower($rootShortName[0]).$counter; |
|
| 329 | 329 | |
| 330 | 330 | |
| 331 | 331 | if (isset($resultMapping['entities'])) { |
| 332 | 332 | foreach ($resultMapping['entities'] as $key => $entityMapping) { |
| 333 | - $classMetadata = $this->em->getClassMetadata($entityMapping['entityClass']); |
|
| 333 | + $classMetadata = $this->em->getClassMetadata($entityMapping['entityClass']); |
|
| 334 | 334 | |
| 335 | 335 | if ($class->reflClass->name == $classMetadata->reflClass->name) { |
| 336 | 336 | $this->addEntityResult($classMetadata->name, $rootAlias); |
| 337 | 337 | $this->addNamedNativeQueryEntityResultMapping($classMetadata, $entityMapping, $rootAlias); |
| 338 | 338 | } else { |
| 339 | 339 | $shortName = $classMetadata->reflClass->getShortName(); |
| 340 | - $joinAlias = strtolower($shortName[0]) . ++ $counter; |
|
| 340 | + $joinAlias = strtolower($shortName[0]).++ $counter; |
|
| 341 | 341 | $associations = $class->getAssociationsByTargetClass($classMetadata->name); |
| 342 | 342 | |
| 343 | 343 | $this->addNamedNativeQueryEntityResultMapping($classMetadata, $entityMapping, $joinAlias); |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | $this->addMetaResult($alias, $discriminatorColumn, $discriminatorColumn, false, $discriminatorType); |
| 386 | 386 | } |
| 387 | 387 | |
| 388 | - if (isset($entityMapping['fields']) && !empty($entityMapping['fields'])) { |
|
| 388 | + if (isset($entityMapping['fields']) && ! empty($entityMapping['fields'])) { |
|
| 389 | 389 | foreach ($entityMapping['fields'] as $field) { |
| 390 | 390 | $fieldName = $field['name']; |
| 391 | 391 | $relation = null; |
@@ -446,7 +446,7 @@ discard block |
||
| 446 | 446 | $sql .= ", "; |
| 447 | 447 | } |
| 448 | 448 | |
| 449 | - $sql .= $tableAlias . "."; |
|
| 449 | + $sql .= $tableAlias."."; |
|
| 450 | 450 | |
| 451 | 451 | if (isset($this->fieldMappings[$columnName])) { |
| 452 | 452 | $class = $this->em->getClassMetadata($this->declaringClasses[$columnName]); |
@@ -457,7 +457,7 @@ discard block |
||
| 457 | 457 | $sql .= $this->discriminatorColumns[$dqlAlias]; |
| 458 | 458 | } |
| 459 | 459 | |
| 460 | - $sql .= " AS " . $columnName; |
|
| 460 | + $sql .= " AS ".$columnName; |
|
| 461 | 461 | } |
| 462 | 462 | |
| 463 | 463 | return $sql; |
@@ -14,16 +14,16 @@ |
||
| 14 | 14 | public function providerParameterTypeInferer() |
| 15 | 15 | { |
| 16 | 16 | $data = [ |
| 17 | - [1, Type::INTEGER], |
|
| 18 | - ["bar", PDO::PARAM_STR], |
|
| 19 | - ["1", PDO::PARAM_STR], |
|
| 20 | - [new \DateTime, Type::DATETIME], |
|
| 17 | + [1, Type::INTEGER], |
|
| 18 | + ["bar", PDO::PARAM_STR], |
|
| 19 | + ["1", PDO::PARAM_STR], |
|
| 20 | + [new \DateTime, Type::DATETIME], |
|
| 21 | 21 | [new \DateInterval('P1D'), Type::DATEINTERVAL], |
| 22 | - [[2], Connection::PARAM_INT_ARRAY], |
|
| 23 | - [["foo"], Connection::PARAM_STR_ARRAY], |
|
| 24 | - [["1","2"], Connection::PARAM_STR_ARRAY], |
|
| 25 | - [[], Connection::PARAM_STR_ARRAY], |
|
| 26 | - [true, Type::BOOLEAN], |
|
| 22 | + [[2], Connection::PARAM_INT_ARRAY], |
|
| 23 | + [["foo"], Connection::PARAM_STR_ARRAY], |
|
| 24 | + [["1", "2"], Connection::PARAM_STR_ARRAY], |
|
| 25 | + [[], Connection::PARAM_STR_ARRAY], |
|
| 26 | + [true, Type::BOOLEAN], |
|
| 27 | 27 | ]; |
| 28 | 28 | |
| 29 | 29 | if (PHP_VERSION_ID >= 50500) { |
@@ -60,13 +60,13 @@ discard block |
||
| 60 | 60 | $em = $this->createMock(EntityManagerInterface::class); |
| 61 | 61 | |
| 62 | 62 | $mappingDriver->method('getAllClassNames') |
| 63 | - ->willReturn([]); |
|
| 63 | + ->willReturn([]); |
|
| 64 | 64 | |
| 65 | 65 | $configuration->method('getMetadataDriverImpl') |
| 66 | - ->willReturn($mappingDriver); |
|
| 66 | + ->willReturn($mappingDriver); |
|
| 67 | 67 | |
| 68 | 68 | $em->method('getConfiguration') |
| 69 | - ->willReturn($configuration); |
|
| 69 | + ->willReturn($configuration); |
|
| 70 | 70 | |
| 71 | 71 | $application = new Application(); |
| 72 | 72 | $application->setHelperSet(new HelperSet(['em' => new EntityManagerHelper($em)])); |
@@ -95,17 +95,17 @@ discard block |
||
| 95 | 95 | $em = $this->createMock(EntityManagerInterface::class); |
| 96 | 96 | |
| 97 | 97 | $mappingDriver->method('getAllClassNames') |
| 98 | - ->willReturn(['InvalidEntity']); |
|
| 98 | + ->willReturn(['InvalidEntity']); |
|
| 99 | 99 | |
| 100 | 100 | $configuration->method('getMetadataDriverImpl') |
| 101 | - ->willReturn($mappingDriver); |
|
| 101 | + ->willReturn($mappingDriver); |
|
| 102 | 102 | |
| 103 | 103 | $em->method('getConfiguration') |
| 104 | - ->willReturn($configuration); |
|
| 104 | + ->willReturn($configuration); |
|
| 105 | 105 | |
| 106 | 106 | $em->method('getClassMetadata') |
| 107 | - ->with('InvalidEntity') |
|
| 108 | - ->willThrowException(new MappingException('exception message')); |
|
| 107 | + ->with('InvalidEntity') |
|
| 108 | + ->willThrowException(new MappingException('exception message')); |
|
| 109 | 109 | |
| 110 | 110 | $application = new Application(); |
| 111 | 111 | $application->setHelperSet(new HelperSet(['em' => new EntityManagerHelper($em)])); |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | $this->tester->execute( |
| 63 | 63 | [ |
| 64 | 64 | 'command' => $this->command->getName(), |
| 65 | - 'dql' => 'SELECT e FROM ' . DateTimeModel::class . ' e', |
|
| 65 | + 'dql' => 'SELECT e FROM '.DateTimeModel::class.' e', |
|
| 66 | 66 | ] |
| 67 | 67 | ) |
| 68 | 68 | ); |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | $this->tester->execute( |
| 81 | 81 | [ |
| 82 | 82 | 'command' => $this->command->getName(), |
| 83 | - 'dql' => 'SELECT e FROM ' . DateTimeModel::class . ' e', |
|
| 83 | + 'dql' => 'SELECT e FROM '.DateTimeModel::class.' e', |
|
| 84 | 84 | '--show-sql' => 'true', |
| 85 | 85 | ] |
| 86 | 86 | ) |