@@ -12,7 +12,7 @@ |
||
| 12 | 12 | public static function fromClassAndAssociation(string $class, string $associationName) : self |
| 13 | 13 | { |
| 14 | 14 | return new self(sprintf( |
| 15 | - 'Cannot match on %s::%s with a non-object value. Matching objects by id is ' . |
|
| 15 | + 'Cannot match on %s::%s with a non-object value. Matching objects by id is '. |
|
| 16 | 16 | 'not compatible with matching on an in-memory collection, which compares objects by reference.', |
| 17 | 17 | $class, |
| 18 | 18 | $associationName |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | $this->currentPersisterContext->rsm->setDiscriminatorColumn('r', $resultColumnName); |
| 46 | 46 | $this->currentPersisterContext->rsm->addMetaResult('r', $resultColumnName, $discrColumnName, false, $discrColumnType); |
| 47 | 47 | |
| 48 | - $columnList[] = $discrColumnType->convertToDatabaseValueSQL($discrTableAlias . '.' . $quotedColumnName, $this->platform); |
|
| 48 | + $columnList[] = $discrColumnType->convertToDatabaseValueSQL($discrTableAlias.'.'.$quotedColumnName, $this->platform); |
|
| 49 | 49 | |
| 50 | 50 | // Append subclass columns |
| 51 | 51 | foreach ($this->class->getSubClasses() as $subClassName) { |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | /** @var JoinColumnMetadata $joinColumn */ |
| 70 | 70 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 71 | 71 | |
| 72 | - if (! $joinColumn->getType()) { |
|
| 72 | + if ( ! $joinColumn->getType()) { |
|
| 73 | 73 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 74 | 74 | } |
| 75 | 75 | |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | $conditionSql .= ' AND '; |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | - return $conditionSql . $this->getSelectConditionDiscriminatorValueSQL(); |
|
| 126 | + return $conditionSql.$this->getSelectConditionDiscriminatorValueSQL(); |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | /** |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | $conditionSql .= ' AND '; |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | - return $conditionSql . $this->getSelectConditionDiscriminatorValueSQL(); |
|
| 140 | + return $conditionSql.$this->getSelectConditionDiscriminatorValueSQL(); |
|
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | /** |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | |
| 165 | 165 | return sprintf( |
| 166 | 166 | '%s IN (%s)', |
| 167 | - $discrColumnType->convertToDatabaseValueSQL($tableAlias . '.' . $quotedColumnName, $this->platform), |
|
| 167 | + $discrColumnType->convertToDatabaseValueSQL($tableAlias.'.'.$quotedColumnName, $this->platform), |
|
| 168 | 168 | implode(', ', $values) |
| 169 | 169 | ); |
| 170 | 170 | } |
@@ -56,6 +56,6 @@ |
||
| 56 | 56 | $columnType |
| 57 | 57 | ); |
| 58 | 58 | |
| 59 | - return $columnType->convertToPHPValueSQL($sql, $this->platform) . ' AS ' . $columnAlias; |
|
| 59 | + return $columnType->convertToPHPValueSQL($sql, $this->platform).' AS '.$columnAlias; |
|
| 60 | 60 | } |
| 61 | 61 | } |
@@ -10,6 +10,6 @@ |
||
| 10 | 10 | { |
| 11 | 11 | public static function fromClassNameAndField(string $className, string $field) : self |
| 12 | 12 | { |
| 13 | - return new self('Invalid order by orientation specified for ' . $className . '#' . $field); |
|
| 13 | + return new self('Invalid order by orientation specified for '.$className.'#'.$field); |
|
| 14 | 14 | } |
| 15 | 15 | } |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | 'u__status' => 'developer', |
| 64 | 64 | 'u__username' => 'jwage', |
| 65 | 65 | 'u__name' => 'Jonathan', |
| 66 | - 'sclr0' => 'JWAGE' . $i, |
|
| 66 | + 'sclr0' => 'JWAGE'.$i, |
|
| 67 | 67 | 'p__phonenumber' => '91', |
| 68 | 68 | ]; |
| 69 | 69 | } |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | $isInitialized = $collection->isInitialized(); |
| 62 | 62 | $isDirty = $collection->isDirty(); |
| 63 | 63 | |
| 64 | - if (! $isInitialized && ! $isDirty) { |
|
| 64 | + if ( ! $isInitialized && ! $isDirty) { |
|
| 65 | 65 | return; |
| 66 | 66 | } |
| 67 | 67 | |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | $this->addToAssertionCount(1); |
| 30 | 30 | } catch (QueryException $e) { |
| 31 | 31 | if ($debug) { |
| 32 | - echo $e->getTraceAsString() . PHP_EOL; |
|
| 32 | + echo $e->getTraceAsString().PHP_EOL; |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | $this->fail($e->getMessage()); |
@@ -44,8 +44,8 @@ discard block |
||
| 44 | 44 | $this->fail('No syntax errors were detected, when syntax errors were expected'); |
| 45 | 45 | } catch (QueryException $e) { |
| 46 | 46 | if ($debug) { |
| 47 | - echo $e->getMessage() . PHP_EOL; |
|
| 48 | - echo $e->getTraceAsString() . PHP_EOL; |
|
| 47 | + echo $e->getMessage().PHP_EOL; |
|
| 48 | + echo $e->getTraceAsString().PHP_EOL; |
|
| 49 | 49 | } |
| 50 | 50 | $this->addToAssertionCount(1); |
| 51 | 51 | } |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | ['SELECT foo: FROM Doctrine\Tests\Models\CMS\CmsUser foo:'], |
| 108 | 108 | |
| 109 | 109 | /* Checks for invalid AbstractSchemaName */ |
| 110 | - ['SELECT u FROM UnknownClass u'], // unknown |
|
| 110 | + ['SELECT u FROM UnknownClass u'], // unknown |
|
| 111 | 111 | ['SELECT u FROM \Unknown\Class u'], // unknown, leading backslash |
| 112 | 112 | ['SELECT u FROM Unknown\\\\Class u'], // unknown, syntactically bogus (duplicate \\) |
| 113 | 113 | ['SELECT u FROM Unknown\Class\ u'], // unknown, syntactically bogus (trailing \) |
@@ -573,7 +573,7 @@ discard block |
||
| 573 | 573 | */ |
| 574 | 574 | public function testDQLKeywordInJoinIsAllowed() : void |
| 575 | 575 | { |
| 576 | - self::assertValidDQL('SELECT u FROM ' . __NAMESPACE__ . '\DQLKeywordsModelUser u JOIN u.group g'); |
|
| 576 | + self::assertValidDQL('SELECT u FROM '.__NAMESPACE__.'\DQLKeywordsModelUser u JOIN u.group g'); |
|
| 577 | 577 | } |
| 578 | 578 | |
| 579 | 579 | /** |
@@ -581,7 +581,7 @@ discard block |
||
| 581 | 581 | */ |
| 582 | 582 | public function testDQLKeywordInConditionIsAllowed() : void |
| 583 | 583 | { |
| 584 | - self::assertValidDQL('SELECT g FROM ' . __NAMESPACE__ . '\DQLKeywordsModelGroup g WHERE g.from=0'); |
|
| 584 | + self::assertValidDQL('SELECT g FROM '.__NAMESPACE__.'\DQLKeywordsModelGroup g WHERE g.from=0'); |
|
| 585 | 585 | } |
| 586 | 586 | |
| 587 | 587 | /* The exception is currently thrown in the SQLWalker, not earlier. |
@@ -686,7 +686,7 @@ discard block |
||
| 686 | 686 | */ |
| 687 | 687 | public function testNewLiteralExpression() : void |
| 688 | 688 | { |
| 689 | - self::assertValidDQL('SELECT new ' . __NAMESPACE__ . "\\DummyStruct(u.id, 'foo', 1, true) FROM Doctrine\Tests\Models\CMS\CmsUser u"); |
|
| 689 | + self::assertValidDQL('SELECT new '.__NAMESPACE__."\\DummyStruct(u.id, 'foo', 1, true) FROM Doctrine\Tests\Models\CMS\CmsUser u"); |
|
| 690 | 690 | } |
| 691 | 691 | |
| 692 | 692 | /** |
@@ -694,7 +694,7 @@ discard block |
||
| 694 | 694 | */ |
| 695 | 695 | public function testNewLiteralWithSubselectExpression() : void |
| 696 | 696 | { |
| 697 | - self::assertValidDQL('SELECT new ' . __NAMESPACE__ . "\\DummyStruct(u.id, 'foo', (SELECT 1 FROM Doctrine\Tests\Models\CMS\CmsUser su), true) FROM Doctrine\Tests\Models\CMS\CmsUser u"); |
|
| 697 | + self::assertValidDQL('SELECT new '.__NAMESPACE__."\\DummyStruct(u.id, 'foo', (SELECT 1 FROM Doctrine\Tests\Models\CMS\CmsUser su), true) FROM Doctrine\Tests\Models\CMS\CmsUser u"); |
|
| 698 | 698 | } |
| 699 | 699 | |
| 700 | 700 | public function testStringPrimaryAcceptsAggregateExpression() : void |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | { |
| 40 | 40 | $query = $this->em->createQuery( |
| 41 | 41 | 'SELECT CONCAT(e.type, MIN(e.version)) pair' |
| 42 | - . ' FROM ' . GH7286Entity::class . ' e' |
|
| 42 | + . ' FROM '.GH7286Entity::class.' e' |
|
| 43 | 43 | . ' WHERE e.type IS NOT NULL' |
| 44 | 44 | . ' GROUP BY e.type' |
| 45 | 45 | . ' ORDER BY e.type' |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | $query = $this->em->createQuery( |
| 65 | 65 | 'SELECT CC(e.type, MIN(e.version)) pair' |
| 66 | - . ' FROM ' . GH7286Entity::class . ' e' |
|
| 66 | + . ' FROM '.GH7286Entity::class.' e' |
|
| 67 | 67 | . ' WHERE e.type IS NOT NULL AND e.type != :type' |
| 68 | 68 | . ' GROUP BY e.type' |
| 69 | 69 | ); |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | */ |
| 31 | 31 | public static function scheduleInsertForManagedEntity($entity) |
| 32 | 32 | { |
| 33 | - return new self('A managed+dirty entity ' . self::objToStr($entity) . ' can not be scheduled for insertion.'); |
|
| 33 | + return new self('A managed+dirty entity '.self::objToStr($entity).' can not be scheduled for insertion.'); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | /** |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | public static function scheduleInsertForRemovedEntity($entity) |
| 42 | 42 | { |
| 43 | - return new self('Removed entity ' . self::objToStr($entity) . ' can not be scheduled for insertion.'); |
|
| 43 | + return new self('Removed entity '.self::objToStr($entity).' can not be scheduled for insertion.'); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | /** |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | public static function scheduleInsertTwice($entity) |
| 52 | 52 | { |
| 53 | - return new self('Entity ' . self::objToStr($entity) . ' can not be scheduled for insertion twice.'); |
|
| 53 | + return new self('Entity '.self::objToStr($entity).' can not be scheduled for insertion twice.'); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | /** |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | public static function entityWithoutIdentity($className, $entity) |
| 63 | 63 | { |
| 64 | 64 | return new self( |
| 65 | - "The given entity of type '" . $className . "' (" . self::objToStr($entity) . ') has no identity/no ' . |
|
| 65 | + "The given entity of type '".$className."' (".self::objToStr($entity).') has no identity/no '. |
|
| 66 | 66 | 'id values set. It cannot be added to the identity map.' |
| 67 | 67 | ); |
| 68 | 68 | } |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | */ |
| 75 | 75 | public static function readOnlyRequiresManagedEntity($entity) |
| 76 | 76 | { |
| 77 | - return new self('Only managed entities can be marked or checked as read only. But ' . self::objToStr($entity) . ' is not'); |
|
| 77 | + return new self('Only managed entities can be marked or checked as read only. But '.self::objToStr($entity).' is not'); |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | /** |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | public static function newEntitiesFoundThroughRelationships($newEntitiesWithAssociations) |
| 86 | 86 | { |
| 87 | 87 | $errorMessages = array_map( |
| 88 | - static function (array $newEntityWithAssociation) : string { |
|
| 88 | + static function(array $newEntityWithAssociation) : string { |
|
| 89 | 89 | [$associationMetadata, $entity] = $newEntityWithAssociation; |
| 90 | 90 | |
| 91 | 91 | 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 | } |