@@ -207,7 +207,6 @@ |
||
| 207 | 207 | |
| 208 | 208 | /** |
| 209 | 209 | * @param ClassMetadata $targetClass |
| 210 | - * @param array $assoc |
|
| 211 | 210 | * @param mixed $actualValue |
| 212 | 211 | * |
| 213 | 212 | * @return self |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM; |
| 6 | 6 | use Doctrine\ORM\Mapping\AssociationMetadata; |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | static public function scheduleInsertForManagedEntity($entity) |
| 23 | 23 | { |
| 24 | - return new self("A managed+dirty entity " . self::objToStr($entity) . " can not be scheduled for insertion."); |
|
| 24 | + return new self("A managed+dirty entity ".self::objToStr($entity)." can not be scheduled for insertion."); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | /** |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | static public function scheduleInsertForRemovedEntity($entity) |
| 33 | 33 | { |
| 34 | - return new self("Removed entity " . self::objToStr($entity) . " can not be scheduled for insertion."); |
|
| 34 | + return new self("Removed entity ".self::objToStr($entity)." can not be scheduled for insertion."); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | /** |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | */ |
| 42 | 42 | static public function scheduleInsertTwice($entity) |
| 43 | 43 | { |
| 44 | - return new self("Entity " . self::objToStr($entity) . " can not be scheduled for insertion twice."); |
|
| 44 | + return new self("Entity ".self::objToStr($entity)." can not be scheduled for insertion twice."); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | /** |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | static public function entityWithoutIdentity($className, $entity) |
| 54 | 54 | { |
| 55 | 55 | return new self( |
| 56 | - "The given entity of type '" . $className . "' (".self::objToStr($entity).") has no identity/no " . |
|
| 56 | + "The given entity of type '".$className."' (".self::objToStr($entity).") has no identity/no ". |
|
| 57 | 57 | "id values set. It cannot be added to the identity map." |
| 58 | 58 | ); |
| 59 | 59 | } |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | static public function readOnlyRequiresManagedEntity($entity) |
| 67 | 67 | { |
| 68 | - return new self("Only managed entities can be marked or checked as read only. But " . self::objToStr($entity) . " is not"); |
|
| 68 | + return new self("Only managed entities can be marked or checked as read only. But ".self::objToStr($entity)." is not"); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | /** |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | static public function newEntitiesFoundThroughRelationships($newEntitiesWithAssociations) |
| 77 | 77 | { |
| 78 | 78 | $errorMessages = array_map( |
| 79 | - function (array $newEntityWithAssociation) : string { |
|
| 79 | + function(array $newEntityWithAssociation) : string { |
|
| 80 | 80 | [$associationMetadata, $entity] = $newEntityWithAssociation; |
| 81 | 81 | |
| 82 | 82 | return self::newEntityFoundThroughRelationshipMessage($associationMetadata, $entity); |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | */ |
| 149 | 149 | static public function entityNotManaged($entity) |
| 150 | 150 | { |
| 151 | - return new self("Entity " . self::objToStr($entity) . " is not managed. An entity is managed if its fetched " . |
|
| 151 | + return new self("Entity ".self::objToStr($entity)." is not managed. An entity is managed if its fetched ". |
|
| 152 | 152 | "from the database or registered as new through EntityManager#persist"); |
| 153 | 153 | } |
| 154 | 154 | |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | */ |
| 161 | 161 | static public function entityHasNoIdentity($entity, $operation) |
| 162 | 162 | { |
| 163 | - return new self("Entity has no identity, therefore " . $operation ." cannot be performed. " . self::objToStr($entity)); |
|
| 163 | + return new self("Entity has no identity, therefore ".$operation." cannot be performed. ".self::objToStr($entity)); |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | /** |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | */ |
| 172 | 172 | static public function entityIsRemoved($entity, $operation) |
| 173 | 173 | { |
| 174 | - return new self("Entity is removed, therefore " . $operation ." cannot be performed. " . self::objToStr($entity)); |
|
| 174 | + return new self("Entity is removed, therefore ".$operation." cannot be performed. ".self::objToStr($entity)); |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | /** |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | */ |
| 183 | 183 | static public function detachedEntityCannot($entity, $operation) |
| 184 | 184 | { |
| 185 | - return new self("Detached entity " . self::objToStr($entity) . " cannot be " . $operation); |
|
| 185 | + return new self("Detached entity ".self::objToStr($entity)." cannot be ".$operation); |
|
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | /** |
@@ -194,8 +194,8 @@ discard block |
||
| 194 | 194 | */ |
| 195 | 195 | public static function invalidObject($context, $given, $parameterIndex = 1) |
| 196 | 196 | { |
| 197 | - return new self($context . ' expects parameter ' . $parameterIndex . |
|
| 198 | - ' to be an entity object, '. gettype($given) . ' given.'); |
|
| 197 | + return new self($context.' expects parameter '.$parameterIndex. |
|
| 198 | + ' to be an entity object, '.gettype($given).' given.'); |
|
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | /** |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | */ |
| 204 | 204 | public static function invalidCompositeIdentifier() |
| 205 | 205 | { |
| 206 | - return new self("Binding an entity with a composite primary key to a query is not supported. " . |
|
| 206 | + return new self("Binding an entity with a composite primary key to a query is not supported. ". |
|
| 207 | 207 | "You should split the parameter into the explicit fields and bind them separately."); |
| 208 | 208 | } |
| 209 | 209 | |
@@ -260,15 +260,15 @@ discard block |
||
| 260 | 260 | private static function newEntityFoundThroughRelationshipMessage(AssociationMetadata $association, $entity) : string |
| 261 | 261 | { |
| 262 | 262 | return 'A new entity was found through the relationship \'' |
| 263 | - . $association->getSourceEntity() . '#' . $association->getName() . '\' that was not' |
|
| 264 | - . ' configured to cascade persist operations for entity: ' . self::objToStr($entity) . '.' |
|
| 263 | + . $association->getSourceEntity().'#'.$association->getName().'\' that was not' |
|
| 264 | + . ' configured to cascade persist operations for entity: '.self::objToStr($entity).'.' |
|
| 265 | 265 | . ' To solve this issue: Either explicitly call EntityManager#persist()' |
| 266 | 266 | . ' on this unknown entity or configure cascade persist' |
| 267 | 267 | . ' this association in the mapping for example @ManyToOne(..,cascade={"persist"}).' |
| 268 | 268 | . (method_exists($entity, '__toString') |
| 269 | 269 | ? '' |
| 270 | 270 | : ' If you cannot find out which entity causes the problem implement \'' |
| 271 | - . $association->getTargetEntity() . '#__toString()\' to get a clue.' |
|
| 271 | + . $association->getTargetEntity().'#__toString()\' to get a clue.' |
|
| 272 | 272 | ); |
| 273 | 273 | } |
| 274 | 274 | } |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | * @param string $field |
| 121 | 121 | * @param array $args |
| 122 | 122 | * |
| 123 | - * @return object |
|
| 123 | + * @return PersistentObject |
|
| 124 | 124 | * |
| 125 | 125 | * @throws \BadMethodCallException When no persistent field exists by that name. |
| 126 | 126 | * @throws \InvalidArgumentException When the wrong target object type is passed to an association. |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | * @param string $field |
| 208 | 208 | * @param array $args |
| 209 | 209 | * |
| 210 | - * @return object |
|
| 210 | + * @return PersistentObject |
|
| 211 | 211 | * |
| 212 | 212 | * @throws \BadMethodCallException |
| 213 | 213 | * @throws \InvalidArgumentException |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM; |
| 6 | 6 | |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | { |
| 90 | 90 | if ($entityManager !== self::$entityManager) { |
| 91 | 91 | throw new \RuntimeException( |
| 92 | - "Trying to use PersistentObject with different EntityManager instances. " . |
|
| 92 | + "Trying to use PersistentObject with different EntityManager instances. ". |
|
| 93 | 93 | "Was PersistentObject::setEntityManager() called?" |
| 94 | 94 | ); |
| 95 | 95 | } |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | |
| 115 | 115 | $property = $this->cm->getProperty($field); |
| 116 | 116 | |
| 117 | - if (! $property) { |
|
| 117 | + if ( ! $property) { |
|
| 118 | 118 | throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getClassName()."'"); |
| 119 | 119 | } |
| 120 | 120 | |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | |
| 154 | 154 | $property = $this->cm->getProperty($field); |
| 155 | 155 | |
| 156 | - if (! $property) { |
|
| 156 | + if ( ! $property) { |
|
| 157 | 157 | throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getClassName()."'"); |
| 158 | 158 | } |
| 159 | 159 | |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | $mappedByField = $property->getMappedBy(); |
| 180 | 180 | $targetMetadata = self::$entityManager->getClassMetadata($property->getTargetEntity()); |
| 181 | 181 | $targetProperty = $targetMetadata->getProperty($mappedByField); |
| 182 | - $setterMethodName = ($targetProperty instanceof ToManyAssociationMetadata ? 'add' : 'set') . $mappedByField; |
|
| 182 | + $setterMethodName = ($targetProperty instanceof ToManyAssociationMetadata ? 'add' : 'set').$mappedByField; |
|
| 183 | 183 | |
| 184 | 184 | $targetObject->$setterMethodName($this); |
| 185 | 185 | } |
@@ -201,21 +201,21 @@ discard block |
||
| 201 | 201 | |
| 202 | 202 | $property = $this->cm->getProperty($field); |
| 203 | 203 | |
| 204 | - if (! $property) { |
|
| 204 | + if ( ! $property) { |
|
| 205 | 205 | throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getClassName()."'"); |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | - if (! ($property instanceof ToManyAssociationMetadata)) { |
|
| 208 | + if ( ! ($property instanceof ToManyAssociationMetadata)) { |
|
| 209 | 209 | throw new \BadMethodCallException("There is no method add".$field."() on ".$this->cm->getClassName()); |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | $targetClassName = $property->getTargetEntity(); |
| 213 | 213 | |
| 214 | - if (! ($args[0] instanceof $targetClassName)) { |
|
| 214 | + if ( ! ($args[0] instanceof $targetClassName)) { |
|
| 215 | 215 | throw new \InvalidArgumentException("Expected persistent object of type '".$targetClassName."'"); |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | - if (! ($this->$field instanceof Collection)) { |
|
| 218 | + if ( ! ($this->$field instanceof Collection)) { |
|
| 219 | 219 | $this->$field = new ArrayCollection($this->$field ?: []); |
| 220 | 220 | } |
| 221 | 221 | |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | return; |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | - if (!self::$entityManager) { |
|
| 242 | + if ( ! self::$entityManager) { |
|
| 243 | 243 | throw new \RuntimeException("No runtime entity manager set. Call PersistentObject#setEntityManager()."); |
| 244 | 244 | } |
| 245 | 245 | |
@@ -22,7 +22,6 @@ |
||
| 22 | 22 | namespace Doctrine\ORM\Persisters\Collection; |
| 23 | 23 | |
| 24 | 24 | use Doctrine\Common\Collections\Criteria; |
| 25 | -use Doctrine\ORM\Mapping\ColumnMetadata; |
|
| 26 | 25 | use Doctrine\ORM\Mapping\InheritanceType; |
| 27 | 26 | use Doctrine\ORM\Mapping\ToManyAssociationMetadata; |
| 28 | 27 | use Doctrine\ORM\PersistentCollection; |
@@ -145,9 +145,9 @@ discard block |
||
| 145 | 145 | return (bool) $persister->count($criteria); |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | - /** |
|
| 149 | - * {@inheritdoc} |
|
| 150 | - */ |
|
| 148 | + /** |
|
| 149 | + * {@inheritdoc} |
|
| 150 | + */ |
|
| 151 | 151 | public function contains(PersistentCollection $collection, $element) |
| 152 | 152 | { |
| 153 | 153 | if ( ! $this->isValidEntityState($element)) { |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | |
| 266 | 266 | // 2) Build insert table records into temporary table |
| 267 | 267 | $dql = ' SELECT t0.' . implode(', t0.', $rootClass->getIdentifierFieldNames()) |
| 268 | - . ' FROM ' . $targetClass->getClassName() . ' t0 WHERE t0.' . $association->getMappedBy() . ' = :owner'; |
|
| 268 | + . ' FROM ' . $targetClass->getClassName() . ' t0 WHERE t0.' . $association->getMappedBy() . ' = :owner'; |
|
| 269 | 269 | $query = $this->em->createQuery($dql)->setParameter('owner', $collection->getOwner()); |
| 270 | 270 | |
| 271 | 271 | $statement = 'INSERT INTO ' . $tempTable . ' (' . $idColumnNameList . ') ' . $query->getSQL(); |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM\Persisters\Collection; |
| 6 | 6 | |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | // the entire collection with a new would trigger this operation. |
| 31 | 31 | $association = $collection->getMapping(); |
| 32 | 32 | |
| 33 | - if (! $association->isOrphanRemoval()) { |
|
| 33 | + if ( ! $association->isOrphanRemoval()) { |
|
| 34 | 34 | // Handling non-orphan removal should never happen, as @OneToMany |
| 35 | 35 | // can only be inverse side. For owning side one to many, it is |
| 36 | 36 | // required to have a join table, which would classify as a ManyToManyPersister. |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | { |
| 63 | 63 | $association = $collection->getMapping(); |
| 64 | 64 | |
| 65 | - if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
| 65 | + if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
| 66 | 66 | throw new \BadMethodCallException("Selecting a collection by index is only supported on indexed collections."); |
| 67 | 67 | } |
| 68 | 68 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | { |
| 112 | 112 | $association = $collection->getMapping(); |
| 113 | 113 | |
| 114 | - if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
| 114 | + if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
| 115 | 115 | throw new \BadMethodCallException("Selecting a collection by index is only supported on indexed collections."); |
| 116 | 116 | } |
| 117 | 117 | |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | // only works with single id identifier entities. Will throw an |
| 121 | 121 | // exception in Entity Persisters if that is not the case for the |
| 122 | 122 | // 'mappedBy' field. |
| 123 | - $criteria = [ |
|
| 123 | + $criteria = [ |
|
| 124 | 124 | $association->getMappedBy() => $collection->getOwner(), |
| 125 | 125 | $association->getIndexedBy() => $key, |
| 126 | 126 | ]; |
@@ -157,12 +157,12 @@ discard block |
||
| 157 | 157 | { |
| 158 | 158 | $association = $collection->getMapping(); |
| 159 | 159 | |
| 160 | - if (! $association->isOrphanRemoval()) { |
|
| 160 | + if ( ! $association->isOrphanRemoval()) { |
|
| 161 | 161 | // no-op: this is not the owning side, therefore no operations should be applied |
| 162 | 162 | return false; |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | - if (! $this->isValidEntityState($element)) { |
|
| 165 | + if ( ! $this->isValidEntityState($element)) { |
|
| 166 | 166 | return false; |
| 167 | 167 | } |
| 168 | 168 | |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | $tableName = $targetClass->table->getQuotedQualifiedName($this->platform); |
| 205 | - $statement = 'DELETE FROM ' . $tableName . ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?'; |
|
| 205 | + $statement = 'DELETE FROM '.$tableName.' WHERE '.implode(' = ? AND ', $columns).' = ?'; |
|
| 206 | 206 | |
| 207 | 207 | return $this->conn->executeUpdate($statement, $parameters); |
| 208 | 208 | } |
@@ -241,17 +241,17 @@ discard block |
||
| 241 | 241 | ]; |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | - $statement = $this->platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable |
|
| 245 | - . ' (' . $this->platform->getColumnDeclarationListSQL($columnDefinitions) . ')'; |
|
| 244 | + $statement = $this->platform->getCreateTemporaryTableSnippetSQL().' '.$tempTable |
|
| 245 | + . ' ('.$this->platform->getColumnDeclarationListSQL($columnDefinitions).')'; |
|
| 246 | 246 | |
| 247 | 247 | $this->conn->executeUpdate($statement); |
| 248 | 248 | |
| 249 | 249 | // 2) Build insert table records into temporary table |
| 250 | - $dql = ' SELECT t0.' . implode(', t0.', $rootClass->getIdentifierFieldNames()) |
|
| 251 | - . ' FROM ' . $targetClass->getClassName() . ' t0 WHERE t0.' . $association->getMappedBy() . ' = :owner'; |
|
| 250 | + $dql = ' SELECT t0.'.implode(', t0.', $rootClass->getIdentifierFieldNames()) |
|
| 251 | + . ' FROM '.$targetClass->getClassName().' t0 WHERE t0.'.$association->getMappedBy().' = :owner'; |
|
| 252 | 252 | $query = $this->em->createQuery($dql)->setParameter('owner', $collection->getOwner()); |
| 253 | 253 | |
| 254 | - $statement = 'INSERT INTO ' . $tempTable . ' (' . $idColumnNameList . ') ' . $query->getSQL(); |
|
| 254 | + $statement = 'INSERT INTO '.$tempTable.' ('.$idColumnNameList.') '.$query->getSQL(); |
|
| 255 | 255 | $parameters = array_values($sourcePersister->getIdentifier($collection->getOwner())); |
| 256 | 256 | $numDeleted = $this->conn->executeUpdate($statement, $parameters); |
| 257 | 257 | |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | // 4) Delete records on each table in the hierarchy |
| 267 | 267 | $hierarchyClasses = array_merge( |
| 268 | 268 | array_map( |
| 269 | - function ($className) { return $this->em->getClassMetadata($className); }, |
|
| 269 | + function($className) { return $this->em->getClassMetadata($className); }, |
|
| 270 | 270 | array_reverse($targetClass->getSubClasses()) |
| 271 | 271 | ), |
| 272 | 272 | [$targetClass], |
@@ -1409,7 +1409,6 @@ |
||
| 1409 | 1409 | * Gets the SQL join fragment used when selecting entities from a |
| 1410 | 1410 | * many-to-many association. |
| 1411 | 1411 | * |
| 1412 | - * @param ManyToManyAssociationMetadata $manyToMany |
|
| 1413 | 1412 | * |
| 1414 | 1413 | * @return string |
| 1415 | 1414 | */ |
@@ -323,8 +323,8 @@ discard block |
||
| 323 | 323 | |
| 324 | 324 | // FIXME: Order with composite keys might not be correct |
| 325 | 325 | $sql = 'SELECT ' . $columnName |
| 326 | - . ' FROM ' . $tableName |
|
| 327 | - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
| 326 | + . ' FROM ' . $tableName |
|
| 327 | + . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
| 328 | 328 | |
| 329 | 329 | $flattenedId = $this->em->getIdentifierFlattener()->flattenIdentifier($versionedClass, $id); |
| 330 | 330 | $versionType = $versionProperty->getType(); |
@@ -457,8 +457,8 @@ discard block |
||
| 457 | 457 | } |
| 458 | 458 | |
| 459 | 459 | $sql = 'UPDATE ' . $quotedTableName |
| 460 | - . ' SET ' . implode(', ', $set) |
|
| 461 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
| 460 | + . ' SET ' . implode(', ', $set) |
|
| 461 | + . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
| 462 | 462 | |
| 463 | 463 | $result = $this->conn->executeUpdate($sql, $params, $types); |
| 464 | 464 | |
@@ -1626,9 +1626,9 @@ discard block |
||
| 1626 | 1626 | $lock = $this->getLockTablesSql($lockMode); |
| 1627 | 1627 | $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
| 1628 | 1628 | $sql = 'SELECT 1 ' |
| 1629 | - . $lock |
|
| 1630 | - . $where |
|
| 1631 | - . $lockSql; |
|
| 1629 | + . $lock |
|
| 1630 | + . $where |
|
| 1631 | + . $lockSql; |
|
| 1632 | 1632 | |
| 1633 | 1633 | list($params, $types) = $this->expandParameters($criteria); |
| 1634 | 1634 | |
@@ -2107,8 +2107,8 @@ discard block |
||
| 2107 | 2107 | $alias = $this->getSQLTableAlias($this->class->getTableName()); |
| 2108 | 2108 | |
| 2109 | 2109 | $sql = 'SELECT 1 ' |
| 2110 | - . $this->getLockTablesSql(null) |
|
| 2111 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
| 2110 | + . $this->getLockTablesSql(null) |
|
| 2111 | + . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
| 2112 | 2112 | |
| 2113 | 2113 | list($params, $types) = $this->expandParameters($criteria); |
| 2114 | 2114 | |
@@ -2142,9 +2142,9 @@ discard block |
||
| 2142 | 2142 | |
| 2143 | 2143 | // if one of the join columns is nullable, return left join |
| 2144 | 2144 | foreach ($association->getJoinColumns() as $joinColumn) { |
| 2145 | - if (! $joinColumn->isNullable()) { |
|
| 2146 | - continue; |
|
| 2147 | - } |
|
| 2145 | + if (! $joinColumn->isNullable()) { |
|
| 2146 | + continue; |
|
| 2147 | + } |
|
| 2148 | 2148 | |
| 2149 | 2149 | return 'LEFT JOIN'; |
| 2150 | 2150 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM\Persisters\Entity; |
| 6 | 6 | |
@@ -302,14 +302,14 @@ discard block |
||
| 302 | 302 | $tableName = $versionedClass->table->getQuotedQualifiedName($this->platform); |
| 303 | 303 | $columnName = $this->platform->quoteIdentifier($versionProperty->getColumnName()); |
| 304 | 304 | $identifier = array_map( |
| 305 | - function ($columnName) { return $this->platform->quoteIdentifier($columnName); }, |
|
| 305 | + function($columnName) { return $this->platform->quoteIdentifier($columnName); }, |
|
| 306 | 306 | array_keys($versionedClass->getIdentifierColumns($this->em)) |
| 307 | 307 | ); |
| 308 | 308 | |
| 309 | 309 | // FIXME: Order with composite keys might not be correct |
| 310 | - $sql = 'SELECT ' . $columnName |
|
| 311 | - . ' FROM ' . $tableName |
|
| 312 | - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
| 310 | + $sql = 'SELECT '.$columnName |
|
| 311 | + . ' FROM '.$tableName |
|
| 312 | + . ' WHERE '.implode(' = ? AND ', $identifier).' = ?'; |
|
| 313 | 313 | |
| 314 | 314 | $flattenedId = $this->em->getIdentifierFlattener()->flattenIdentifier($versionedClass, $id); |
| 315 | 315 | $versionType = $versionProperty->getType(); |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | |
| 396 | 396 | if (($value = $identifier[$field]) !== null) { |
| 397 | 397 | // @todo guilhermeblanco Make sure we do not have flat association values. |
| 398 | - if (! is_array($value)) { |
|
| 398 | + if ( ! is_array($value)) { |
|
| 399 | 399 | $value = [$targetClass->identifier[0] => $value]; |
| 400 | 400 | } |
| 401 | 401 | |
@@ -408,7 +408,7 @@ discard block |
||
| 408 | 408 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 409 | 409 | $targetField = $targetClass->fieldNames[$referencedColumnName]; |
| 410 | 410 | |
| 411 | - if (! $joinColumn->getType()) { |
|
| 411 | + if ( ! $joinColumn->getType()) { |
|
| 412 | 412 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 413 | 413 | } |
| 414 | 414 | |
@@ -476,7 +476,7 @@ discard block |
||
| 476 | 476 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 477 | 477 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 478 | 478 | |
| 479 | - if (! $joinColumn->getType()) { |
|
| 479 | + if ( ! $joinColumn->getType()) { |
|
| 480 | 480 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 481 | 481 | } |
| 482 | 482 | |
@@ -503,18 +503,18 @@ discard block |
||
| 503 | 503 | case Type::SMALLINT: |
| 504 | 504 | case Type::INTEGER: |
| 505 | 505 | case Type::BIGINT: |
| 506 | - $set[] = $versionColumnName . ' = ' . $versionColumnName . ' + 1'; |
|
| 506 | + $set[] = $versionColumnName.' = '.$versionColumnName.' + 1'; |
|
| 507 | 507 | break; |
| 508 | 508 | |
| 509 | 509 | case Type::DATETIME: |
| 510 | - $set[] = $versionColumnName . ' = CURRENT_TIMESTAMP'; |
|
| 510 | + $set[] = $versionColumnName.' = CURRENT_TIMESTAMP'; |
|
| 511 | 511 | break; |
| 512 | 512 | } |
| 513 | 513 | } |
| 514 | 514 | |
| 515 | - $sql = 'UPDATE ' . $quotedTableName |
|
| 516 | - . ' SET ' . implode(', ', $set) |
|
| 517 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
| 515 | + $sql = 'UPDATE '.$quotedTableName |
|
| 516 | + . ' SET '.implode(', ', $set) |
|
| 517 | + . ' WHERE '.implode(' = ? AND ', $where).' = ?'; |
|
| 518 | 518 | |
| 519 | 519 | $result = $this->conn->executeUpdate($sql, $params, $types); |
| 520 | 520 | |
@@ -533,7 +533,7 @@ discard block |
||
| 533 | 533 | protected function deleteJoinTableRecords($identifier) |
| 534 | 534 | { |
| 535 | 535 | foreach ($this->class->getDeclaredPropertiesIterator() as $association) { |
| 536 | - if (! ($association instanceof ManyToManyAssociationMetadata)) { |
|
| 536 | + if ( ! ($association instanceof ManyToManyAssociationMetadata)) { |
|
| 537 | 537 | continue; |
| 538 | 538 | } |
| 539 | 539 | |
@@ -546,7 +546,7 @@ discard block |
||
| 546 | 546 | $keys = []; |
| 547 | 547 | |
| 548 | 548 | if ( ! $owningAssociation->isOwningSide()) { |
| 549 | - $class = $this->em->getClassMetadata($association->getTargetEntity()); |
|
| 549 | + $class = $this->em->getClassMetadata($association->getTargetEntity()); |
|
| 550 | 550 | $owningAssociation = $class->getProperty($association->getMappedBy()); |
| 551 | 551 | } |
| 552 | 552 | |
@@ -658,7 +658,7 @@ discard block |
||
| 658 | 658 | } |
| 659 | 659 | |
| 660 | 660 | // Only owning side of x-1 associations can have a FK column. |
| 661 | - if (! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
| 661 | + if ( ! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
| 662 | 662 | continue; |
| 663 | 663 | } |
| 664 | 664 | |
@@ -678,7 +678,7 @@ discard block |
||
| 678 | 678 | /** @var JoinColumnMetadata $joinColumn */ |
| 679 | 679 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 680 | 680 | |
| 681 | - if (! $joinColumn->getType()) { |
|
| 681 | + if ( ! $joinColumn->getType()) { |
|
| 682 | 682 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 683 | 683 | } |
| 684 | 684 | |
@@ -707,7 +707,7 @@ discard block |
||
| 707 | 707 | $propertyName = $this->class->fieldNames[$columnName]; |
| 708 | 708 | $property = $this->class->getProperty($propertyName); |
| 709 | 709 | |
| 710 | - if (! $property) { |
|
| 710 | + if ( ! $property) { |
|
| 711 | 711 | return null; |
| 712 | 712 | } |
| 713 | 713 | |
@@ -726,7 +726,7 @@ discard block |
||
| 726 | 726 | /** @var JoinColumnMetadata $joinColumn */ |
| 727 | 727 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 728 | 728 | |
| 729 | - if (! $joinColumn->getType()) { |
|
| 729 | + if ( ! $joinColumn->getType()) { |
|
| 730 | 730 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 731 | 731 | } |
| 732 | 732 | |
@@ -1063,7 +1063,7 @@ discard block |
||
| 1063 | 1063 | $criteria = []; |
| 1064 | 1064 | $parameters = []; |
| 1065 | 1065 | |
| 1066 | - if (! $association->isOwningSide()) { |
|
| 1066 | + if ( ! $association->isOwningSide()) { |
|
| 1067 | 1067 | $class = $this->em->getClassMetadata($association->getTargetEntity()); |
| 1068 | 1068 | $owningAssoc = $class->getProperty($association->getMappedBy()); |
| 1069 | 1069 | } |
@@ -1091,7 +1091,7 @@ discard block |
||
| 1091 | 1091 | $value = $value[$targetClass->identifier[0]]; |
| 1092 | 1092 | } |
| 1093 | 1093 | |
| 1094 | - $criteria[$joinTableName . '.' . $quotedColumnName] = $value; |
|
| 1094 | + $criteria[$joinTableName.'.'.$quotedColumnName] = $value; |
|
| 1095 | 1095 | $parameters[] = [ |
| 1096 | 1096 | 'value' => $value, |
| 1097 | 1097 | 'field' => $fieldName, |
@@ -1142,11 +1142,11 @@ discard block |
||
| 1142 | 1142 | |
| 1143 | 1143 | switch ($lockMode) { |
| 1144 | 1144 | case LockMode::PESSIMISTIC_READ: |
| 1145 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
| 1145 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
| 1146 | 1146 | break; |
| 1147 | 1147 | |
| 1148 | 1148 | case LockMode::PESSIMISTIC_WRITE: |
| 1149 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
| 1149 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
| 1150 | 1150 | break; |
| 1151 | 1151 | } |
| 1152 | 1152 | |
@@ -1157,14 +1157,14 @@ discard block |
||
| 1157 | 1157 | |
| 1158 | 1158 | if ('' !== $filterSql) { |
| 1159 | 1159 | $conditionSql = $conditionSql |
| 1160 | - ? $conditionSql . ' AND ' . $filterSql |
|
| 1160 | + ? $conditionSql.' AND '.$filterSql |
|
| 1161 | 1161 | : $filterSql; |
| 1162 | 1162 | } |
| 1163 | 1163 | |
| 1164 | - $select = 'SELECT ' . $columnList; |
|
| 1165 | - $from = ' FROM ' . $tableName . ' '. $tableAlias; |
|
| 1166 | - $join = $this->currentPersisterContext->selectJoinSql . $joinSql; |
|
| 1167 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : ''); |
|
| 1164 | + $select = 'SELECT '.$columnList; |
|
| 1165 | + $from = ' FROM '.$tableName.' '.$tableAlias; |
|
| 1166 | + $join = $this->currentPersisterContext->selectJoinSql.$joinSql; |
|
| 1167 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : ''); |
|
| 1168 | 1168 | $lock = $this->platform->appendLockHint($from, $lockMode); |
| 1169 | 1169 | $query = $select |
| 1170 | 1170 | . $lock |
@@ -1172,7 +1172,7 @@ discard block |
||
| 1172 | 1172 | . $where |
| 1173 | 1173 | . $orderBySql; |
| 1174 | 1174 | |
| 1175 | - return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql; |
|
| 1175 | + return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql; |
|
| 1176 | 1176 | } |
| 1177 | 1177 | |
| 1178 | 1178 | /** |
@@ -1191,13 +1191,13 @@ discard block |
||
| 1191 | 1191 | |
| 1192 | 1192 | if ('' !== $filterSql) { |
| 1193 | 1193 | $conditionSql = $conditionSql |
| 1194 | - ? $conditionSql . ' AND ' . $filterSql |
|
| 1194 | + ? $conditionSql.' AND '.$filterSql |
|
| 1195 | 1195 | : $filterSql; |
| 1196 | 1196 | } |
| 1197 | 1197 | |
| 1198 | 1198 | $sql = 'SELECT COUNT(*) ' |
| 1199 | - . 'FROM ' . $tableName . ' ' . $tableAlias |
|
| 1200 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
| 1199 | + . 'FROM '.$tableName.' '.$tableAlias |
|
| 1200 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
| 1201 | 1201 | |
| 1202 | 1202 | return $sql; |
| 1203 | 1203 | } |
@@ -1214,7 +1214,7 @@ discard block |
||
| 1214 | 1214 | */ |
| 1215 | 1215 | protected final function getOrderBySQL(array $orderBy, $baseTableAlias) |
| 1216 | 1216 | { |
| 1217 | - if (! $orderBy) { |
|
| 1217 | + if ( ! $orderBy) { |
|
| 1218 | 1218 | return ''; |
| 1219 | 1219 | } |
| 1220 | 1220 | |
@@ -1223,7 +1223,7 @@ discard block |
||
| 1223 | 1223 | foreach ($orderBy as $fieldName => $orientation) { |
| 1224 | 1224 | $orientation = strtoupper(trim($orientation)); |
| 1225 | 1225 | |
| 1226 | - if (! in_array($orientation, ['ASC', 'DESC'])) { |
|
| 1226 | + if ( ! in_array($orientation, ['ASC', 'DESC'])) { |
|
| 1227 | 1227 | throw ORMException::invalidOrientation($this->class->getClassName(), $fieldName); |
| 1228 | 1228 | } |
| 1229 | 1229 | |
@@ -1233,11 +1233,11 @@ discard block |
||
| 1233 | 1233 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
| 1234 | 1234 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
| 1235 | 1235 | |
| 1236 | - $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation; |
|
| 1236 | + $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation; |
|
| 1237 | 1237 | |
| 1238 | 1238 | continue; |
| 1239 | 1239 | } else if ($property instanceof AssociationMetadata) { |
| 1240 | - if (! $property->isOwningSide()) { |
|
| 1240 | + if ( ! $property->isOwningSide()) { |
|
| 1241 | 1241 | throw InvalidFindByCall::fromInverseSideUsage( |
| 1242 | 1242 | $this->class->getClassName(), |
| 1243 | 1243 | $fieldName |
@@ -1253,7 +1253,7 @@ discard block |
||
| 1253 | 1253 | /* @var JoinColumnMetadata $joinColumn */ |
| 1254 | 1254 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 1255 | 1255 | |
| 1256 | - $orderByList[] = $tableAlias . '.' . $quotedColumnName . ' ' . $orientation; |
|
| 1256 | + $orderByList[] = $tableAlias.'.'.$quotedColumnName.' '.$orientation; |
|
| 1257 | 1257 | } |
| 1258 | 1258 | |
| 1259 | 1259 | continue; |
@@ -1262,7 +1262,7 @@ discard block |
||
| 1262 | 1262 | throw ORMException::unrecognizedField($fieldName); |
| 1263 | 1263 | } |
| 1264 | 1264 | |
| 1265 | - return ' ORDER BY ' . implode(', ', $orderByList); |
|
| 1265 | + return ' ORDER BY '.implode(', ', $orderByList); |
|
| 1266 | 1266 | } |
| 1267 | 1267 | |
| 1268 | 1268 | /** |
@@ -1284,7 +1284,7 @@ discard block |
||
| 1284 | 1284 | |
| 1285 | 1285 | |
| 1286 | 1286 | $this->currentPersisterContext->rsm->addEntityResult($this->class->getClassName(), 'r'); // r for root |
| 1287 | - $this->currentPersisterContext->selectJoinSql = ''; |
|
| 1287 | + $this->currentPersisterContext->selectJoinSql = ''; |
|
| 1288 | 1288 | |
| 1289 | 1289 | $eagerAliasCounter = 0; |
| 1290 | 1290 | $columnList = []; |
@@ -1320,7 +1320,7 @@ discard block |
||
| 1320 | 1320 | break; // now this is why you shouldn't use inheritance |
| 1321 | 1321 | } |
| 1322 | 1322 | |
| 1323 | - $assocAlias = 'e' . ($eagerAliasCounter++); |
|
| 1323 | + $assocAlias = 'e'.($eagerAliasCounter++); |
|
| 1324 | 1324 | |
| 1325 | 1325 | $this->currentPersisterContext->rsm->addJoinedEntityResult($targetEntity, $assocAlias, 'r', $fieldName); |
| 1326 | 1326 | |
@@ -1345,14 +1345,14 @@ discard block |
||
| 1345 | 1345 | $this->currentPersisterContext->rsm->addIndexBy($assocAlias, $property->getIndexedBy()); |
| 1346 | 1346 | } |
| 1347 | 1347 | |
| 1348 | - if (! $property->isOwningSide()) { |
|
| 1348 | + if ( ! $property->isOwningSide()) { |
|
| 1349 | 1349 | $owningAssociation = $eagerEntity->getProperty($property->getMappedBy()); |
| 1350 | 1350 | } |
| 1351 | 1351 | |
| 1352 | 1352 | $joinTableAlias = $this->getSQLTableAlias($eagerEntity->getTableName(), $assocAlias); |
| 1353 | 1353 | $joinTableName = $eagerEntity->table->getQuotedQualifiedName($this->platform); |
| 1354 | 1354 | |
| 1355 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $this->getJoinSQLForAssociation($property); |
|
| 1355 | + $this->currentPersisterContext->selectJoinSql .= ' '.$this->getJoinSQLForAssociation($property); |
|
| 1356 | 1356 | |
| 1357 | 1357 | $sourceClass = $this->em->getClassMetadata($owningAssociation->getSourceEntity()); |
| 1358 | 1358 | $targetClass = $this->em->getClassMetadata($owningAssociation->getTargetEntity()); |
@@ -1374,7 +1374,7 @@ discard block |
||
| 1374 | 1374 | $joinCondition[] = $filterSql; |
| 1375 | 1375 | } |
| 1376 | 1376 | |
| 1377 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $joinTableName . ' ' . $joinTableAlias . ' ON '; |
|
| 1377 | + $this->currentPersisterContext->selectJoinSql .= ' '.$joinTableName.' '.$joinTableAlias.' ON '; |
|
| 1378 | 1378 | $this->currentPersisterContext->selectJoinSql .= implode(' AND ', $joinCondition); |
| 1379 | 1379 | |
| 1380 | 1380 | break; |
@@ -1398,7 +1398,7 @@ discard block |
||
| 1398 | 1398 | */ |
| 1399 | 1399 | protected function getSelectColumnAssociationSQL($field, AssociationMetadata $association, ClassMetadata $class, $alias = 'r') |
| 1400 | 1400 | { |
| 1401 | - if (! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
| 1401 | + if ( ! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
| 1402 | 1402 | return ''; |
| 1403 | 1403 | } |
| 1404 | 1404 | |
@@ -1413,7 +1413,7 @@ discard block |
||
| 1413 | 1413 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 1414 | 1414 | $resultColumnName = $this->getSQLColumnAlias(); |
| 1415 | 1415 | |
| 1416 | - if (! $joinColumn->getType()) { |
|
| 1416 | + if ( ! $joinColumn->getType()) { |
|
| 1417 | 1417 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 1418 | 1418 | } |
| 1419 | 1419 | |
@@ -1445,7 +1445,7 @@ discard block |
||
| 1445 | 1445 | $owningAssociation = $association; |
| 1446 | 1446 | $sourceTableAlias = $this->getSQLTableAlias($this->class->getTableName()); |
| 1447 | 1447 | |
| 1448 | - if (! $association->isOwningSide()) { |
|
| 1448 | + if ( ! $association->isOwningSide()) { |
|
| 1449 | 1449 | $targetEntity = $this->em->getClassMetadata($association->getTargetEntity()); |
| 1450 | 1450 | $owningAssociation = $targetEntity->getProperty($association->getMappedBy()); |
| 1451 | 1451 | } |
@@ -1467,7 +1467,7 @@ discard block |
||
| 1467 | 1467 | ); |
| 1468 | 1468 | } |
| 1469 | 1469 | |
| 1470 | - return ' INNER JOIN ' . $joinTableName . ' ON ' . implode(' AND ', $conditions); |
|
| 1470 | + return ' INNER JOIN '.$joinTableName.' ON '.implode(' AND ', $conditions); |
|
| 1471 | 1471 | } |
| 1472 | 1472 | |
| 1473 | 1473 | /** |
@@ -1562,7 +1562,7 @@ discard block |
||
| 1562 | 1562 | $columnName = $joinColumn->getColumnName(); |
| 1563 | 1563 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 1564 | 1564 | |
| 1565 | - if (! $joinColumn->getType()) { |
|
| 1565 | + if ( ! $joinColumn->getType()) { |
|
| 1566 | 1566 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 1567 | 1567 | } |
| 1568 | 1568 | |
@@ -1601,7 +1601,7 @@ discard block |
||
| 1601 | 1601 | |
| 1602 | 1602 | $this->currentPersisterContext->rsm->addFieldResult($alias, $columnAlias, $field, $class->getClassName()); |
| 1603 | 1603 | |
| 1604 | - return $property->getType()->convertToPHPValueSQL($sql, $this->platform) . ' AS ' . $columnAlias; |
|
| 1604 | + return $property->getType()->convertToPHPValueSQL($sql, $this->platform).' AS '.$columnAlias; |
|
| 1605 | 1605 | } |
| 1606 | 1606 | |
| 1607 | 1607 | /** |
@@ -1615,14 +1615,14 @@ discard block |
||
| 1615 | 1615 | protected function getSQLTableAlias($tableName, $assocName = '') |
| 1616 | 1616 | { |
| 1617 | 1617 | if ($tableName) { |
| 1618 | - $tableName .= '#' . $assocName; |
|
| 1618 | + $tableName .= '#'.$assocName; |
|
| 1619 | 1619 | } |
| 1620 | 1620 | |
| 1621 | 1621 | if (isset($this->currentPersisterContext->sqlTableAliases[$tableName])) { |
| 1622 | 1622 | return $this->currentPersisterContext->sqlTableAliases[$tableName]; |
| 1623 | 1623 | } |
| 1624 | 1624 | |
| 1625 | - $tableAlias = 't' . $this->currentPersisterContext->sqlAliasCounter++; |
|
| 1625 | + $tableAlias = 't'.$this->currentPersisterContext->sqlAliasCounter++; |
|
| 1626 | 1626 | |
| 1627 | 1627 | $this->currentPersisterContext->sqlTableAliases[$tableName] = $tableAlias; |
| 1628 | 1628 | |
@@ -1649,7 +1649,7 @@ discard block |
||
| 1649 | 1649 | } |
| 1650 | 1650 | |
| 1651 | 1651 | $lock = $this->getLockTablesSql($lockMode); |
| 1652 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
|
| 1652 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : '').' '; |
|
| 1653 | 1653 | $sql = 'SELECT 1 ' |
| 1654 | 1654 | . $lock |
| 1655 | 1655 | . $where |
@@ -1672,7 +1672,7 @@ discard block |
||
| 1672 | 1672 | $tableName = $this->class->table->getQuotedQualifiedName($this->platform); |
| 1673 | 1673 | |
| 1674 | 1674 | return $this->platform->appendLockHint( |
| 1675 | - 'FROM ' . $tableName . ' ' . $this->getSQLTableAlias($this->class->getTableName()), |
|
| 1675 | + 'FROM '.$tableName.' '.$this->getSQLTableAlias($this->class->getTableName()), |
|
| 1676 | 1676 | $lockMode |
| 1677 | 1677 | ); |
| 1678 | 1678 | } |
@@ -1725,19 +1725,19 @@ discard block |
||
| 1725 | 1725 | |
| 1726 | 1726 | if (null !== $comparison) { |
| 1727 | 1727 | // special case null value handling |
| 1728 | - if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && null ===$value) { |
|
| 1729 | - $selectedColumns[] = $column . ' IS NULL'; |
|
| 1728 | + if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && null === $value) { |
|
| 1729 | + $selectedColumns[] = $column.' IS NULL'; |
|
| 1730 | 1730 | |
| 1731 | 1731 | continue; |
| 1732 | 1732 | } |
| 1733 | 1733 | |
| 1734 | 1734 | if ($comparison === Comparison::NEQ && null === $value) { |
| 1735 | - $selectedColumns[] = $column . ' IS NOT NULL'; |
|
| 1735 | + $selectedColumns[] = $column.' IS NOT NULL'; |
|
| 1736 | 1736 | |
| 1737 | 1737 | continue; |
| 1738 | 1738 | } |
| 1739 | 1739 | |
| 1740 | - $selectedColumns[] = $column . ' ' . sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
| 1740 | + $selectedColumns[] = $column.' '.sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
| 1741 | 1741 | |
| 1742 | 1742 | continue; |
| 1743 | 1743 | } |
@@ -1786,7 +1786,7 @@ discard block |
||
| 1786 | 1786 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
| 1787 | 1787 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
| 1788 | 1788 | |
| 1789 | - return [$tableAlias . '.' . $columnName]; |
|
| 1789 | + return [$tableAlias.'.'.$columnName]; |
|
| 1790 | 1790 | } |
| 1791 | 1791 | |
| 1792 | 1792 | if ($property instanceof AssociationMetadata) { |
@@ -1795,7 +1795,7 @@ discard block |
||
| 1795 | 1795 | |
| 1796 | 1796 | // Many-To-Many requires join table check for joinColumn |
| 1797 | 1797 | if ($owningAssociation instanceof ManyToManyAssociationMetadata) { |
| 1798 | - if (! $owningAssociation->isOwningSide()) { |
|
| 1798 | + if ( ! $owningAssociation->isOwningSide()) { |
|
| 1799 | 1799 | $owningAssociation = $association; |
| 1800 | 1800 | } |
| 1801 | 1801 | |
@@ -1809,18 +1809,18 @@ discard block |
||
| 1809 | 1809 | foreach ($joinColumns as $joinColumn) { |
| 1810 | 1810 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 1811 | 1811 | |
| 1812 | - $columns[] = $joinTableName . '.' . $quotedColumnName; |
|
| 1812 | + $columns[] = $joinTableName.'.'.$quotedColumnName; |
|
| 1813 | 1813 | } |
| 1814 | 1814 | |
| 1815 | 1815 | } else { |
| 1816 | - if (! $owningAssociation->isOwningSide()) { |
|
| 1816 | + if ( ! $owningAssociation->isOwningSide()) { |
|
| 1817 | 1817 | throw InvalidFindByCall::fromInverseSideUsage( |
| 1818 | 1818 | $this->class->getClassName(), |
| 1819 | 1819 | $field |
| 1820 | 1820 | ); |
| 1821 | 1821 | } |
| 1822 | 1822 | |
| 1823 | - $class = $this->class->isInheritedProperty($field) |
|
| 1823 | + $class = $this->class->isInheritedProperty($field) |
|
| 1824 | 1824 | ? $owningAssociation->getDeclaringClass() |
| 1825 | 1825 | : $this->class |
| 1826 | 1826 | ; |
@@ -1829,7 +1829,7 @@ discard block |
||
| 1829 | 1829 | foreach ($owningAssociation->getJoinColumns() as $joinColumn) { |
| 1830 | 1830 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 1831 | 1831 | |
| 1832 | - $columns[] = $tableAlias . '.' . $quotedColumnName; |
|
| 1832 | + $columns[] = $tableAlias.'.'.$quotedColumnName; |
|
| 1833 | 1833 | } |
| 1834 | 1834 | } |
| 1835 | 1835 | |
@@ -1942,7 +1942,7 @@ discard block |
||
| 1942 | 1942 | $value = $value[$targetClass->identifier[0]]; |
| 1943 | 1943 | } |
| 1944 | 1944 | |
| 1945 | - $criteria[$tableAlias . "." . $quotedColumnName] = $value; |
|
| 1945 | + $criteria[$tableAlias.".".$quotedColumnName] = $value; |
|
| 1946 | 1946 | $parameters[] = [ |
| 1947 | 1947 | 'value' => $value, |
| 1948 | 1948 | 'field' => $fieldName, |
@@ -2029,7 +2029,7 @@ discard block |
||
| 2029 | 2029 | case ($property instanceof AssociationMetadata): |
| 2030 | 2030 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
| 2031 | 2031 | |
| 2032 | - if (! $property->isOwningSide()) { |
|
| 2032 | + if ( ! $property->isOwningSide()) { |
|
| 2033 | 2033 | $property = $class->getProperty($property->getMappedBy()); |
| 2034 | 2034 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
| 2035 | 2035 | } |
@@ -2043,7 +2043,7 @@ discard block |
||
| 2043 | 2043 | /** @var JoinColumnMetadata $joinColumn */ |
| 2044 | 2044 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 2045 | 2045 | |
| 2046 | - if (! $joinColumn->getType()) { |
|
| 2046 | + if ( ! $joinColumn->getType()) { |
|
| 2047 | 2047 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em)); |
| 2048 | 2048 | } |
| 2049 | 2049 | |
@@ -2058,7 +2058,7 @@ discard block |
||
| 2058 | 2058 | } |
| 2059 | 2059 | |
| 2060 | 2060 | if (is_array($value)) { |
| 2061 | - return array_map(function ($type) { |
|
| 2061 | + return array_map(function($type) { |
|
| 2062 | 2062 | return $type->getBindingType() + Connection::ARRAY_PARAM_OFFSET; |
| 2063 | 2063 | }, $types); |
| 2064 | 2064 | } |
@@ -2137,12 +2137,12 @@ discard block |
||
| 2137 | 2137 | |
| 2138 | 2138 | $sql = 'SELECT 1 ' |
| 2139 | 2139 | . $this->getLockTablesSql(null) |
| 2140 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
| 2140 | + . ' WHERE '.$this->getSelectConditionSQL($criteria); |
|
| 2141 | 2141 | |
| 2142 | 2142 | list($params, $types) = $this->expandParameters($criteria); |
| 2143 | 2143 | |
| 2144 | 2144 | if (null !== $extraConditions) { |
| 2145 | - $sql .= ' AND ' . $this->getSelectConditionCriteriaSQL($extraConditions); |
|
| 2145 | + $sql .= ' AND '.$this->getSelectConditionCriteriaSQL($extraConditions); |
|
| 2146 | 2146 | list($criteriaParams, $criteriaTypes) = $this->expandCriteriaParameters($extraConditions); |
| 2147 | 2147 | |
| 2148 | 2148 | $params = array_merge($params, $criteriaParams); |
@@ -2150,7 +2150,7 @@ discard block |
||
| 2150 | 2150 | } |
| 2151 | 2151 | |
| 2152 | 2152 | if ($filterSql = $this->generateFilterConditionSQL($this->class, $alias)) { |
| 2153 | - $sql .= ' AND ' . $filterSql; |
|
| 2153 | + $sql .= ' AND '.$filterSql; |
|
| 2154 | 2154 | } |
| 2155 | 2155 | |
| 2156 | 2156 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
@@ -2165,13 +2165,13 @@ discard block |
||
| 2165 | 2165 | */ |
| 2166 | 2166 | protected function getJoinSQLForAssociation(AssociationMetadata $association) |
| 2167 | 2167 | { |
| 2168 | - if (! $association->isOwningSide()) { |
|
| 2168 | + if ( ! $association->isOwningSide()) { |
|
| 2169 | 2169 | return 'LEFT JOIN'; |
| 2170 | 2170 | } |
| 2171 | 2171 | |
| 2172 | 2172 | // if one of the join columns is nullable, return left join |
| 2173 | 2173 | foreach ($association->getJoinColumns() as $joinColumn) { |
| 2174 | - if (! $joinColumn->isNullable()) { |
|
| 2174 | + if ( ! $joinColumn->isNullable()) { |
|
| 2175 | 2175 | continue; |
| 2176 | 2176 | } |
| 2177 | 2177 | |
@@ -2188,7 +2188,7 @@ discard block |
||
| 2188 | 2188 | */ |
| 2189 | 2189 | public function getSQLColumnAlias() |
| 2190 | 2190 | { |
| 2191 | - return $this->platform->getSQLResultCasing('c' . $this->currentPersisterContext->sqlAliasCounter++); |
|
| 2191 | + return $this->platform->getSQLResultCasing('c'.$this->currentPersisterContext->sqlAliasCounter++); |
|
| 2192 | 2192 | } |
| 2193 | 2193 | |
| 2194 | 2194 | /** |
@@ -2205,13 +2205,13 @@ discard block |
||
| 2205 | 2205 | |
| 2206 | 2206 | foreach ($this->em->getFilters()->getEnabledFilters() as $filter) { |
| 2207 | 2207 | if ('' !== $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) { |
| 2208 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
| 2208 | + $filterClauses[] = '('.$filterExpr.')'; |
|
| 2209 | 2209 | } |
| 2210 | 2210 | } |
| 2211 | 2211 | |
| 2212 | 2212 | $sql = implode(' AND ', $filterClauses); |
| 2213 | 2213 | |
| 2214 | - return $sql ? "(" . $sql . ")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
| 2214 | + return $sql ? "(".$sql.")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
| 2215 | 2215 | } |
| 2216 | 2216 | |
| 2217 | 2217 | /** |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | * @param string $entityName Full or partial entity name |
| 166 | 166 | * @param EntityManagerInterface $entityManager |
| 167 | 167 | * |
| 168 | - * @return \Doctrine\ORM\Mapping\ClassMetadata |
|
| 168 | + * @return \Doctrine\Common\Persistence\Mapping\ClassMetadata |
|
| 169 | 169 | */ |
| 170 | 170 | private function getClassMetadata($entityName, EntityManagerInterface $entityManager) |
| 171 | 171 | { |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | * @param string $label Label for the value |
| 249 | 249 | * @param mixed $value A Value to show |
| 250 | 250 | * |
| 251 | - * @return array |
|
| 251 | + * @return string[] |
|
| 252 | 252 | */ |
| 253 | 253 | private function formatField($label, $value) |
| 254 | 254 | { |
@@ -347,7 +347,7 @@ discard block |
||
| 347 | 347 | * |
| 348 | 348 | * @param array $entityListeners |
| 349 | 349 | * |
| 350 | - * @return array |
|
| 350 | + * @return string[] |
|
| 351 | 351 | */ |
| 352 | 352 | private function formatEntityListeners(array $entityListeners) |
| 353 | 353 | { |
@@ -298,7 +298,7 @@ |
||
| 298 | 298 | |
| 299 | 299 | if ($property instanceof FieldMetadata) { |
| 300 | 300 | $output = array_merge($output, $this->formatColumn($property)); |
| 301 | - } else if ($property instanceof AssociationMetadata) { |
|
| 301 | + } else if ($property instanceof AssociationMetadata) { |
|
| 302 | 302 | // @todo guilhermeblanco Fix me! We are trying to iterate through an AssociationMetadata instance |
| 303 | 303 | foreach ($property as $field => $value) { |
| 304 | 304 | $output[] = $this->formatField(sprintf(' %s', $field), $this->formatValue($value)); |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM\Tools\Console\Command; |
| 6 | 6 | |
@@ -165,8 +165,8 @@ discard block |
||
| 165 | 165 | |
| 166 | 166 | $matches = array_filter( |
| 167 | 167 | $this->getMappedEntities($entityManager), |
| 168 | - function ($mappedEntity) use ($entityName) { |
|
| 169 | - return preg_match('{' . preg_quote($entityName) . '}', $mappedEntity); |
|
| 168 | + function($mappedEntity) use ($entityName) { |
|
| 169 | + return preg_match('{'.preg_quote($entityName).'}', $mappedEntity); |
|
| 170 | 170 | } |
| 171 | 171 | ); |
| 172 | 172 | |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | |
| 224 | 224 | $output[] = $this->formatField( |
| 225 | 225 | sprintf(' %s', $parentClass->getParent()), |
| 226 | - ($parentClass->isRootEntity() ? '(Root) ' : '') . $this->formatValue($attributes) |
|
| 226 | + ($parentClass->isRootEntity() ? '(Root) ' : '').$this->formatValue($attributes) |
|
| 227 | 227 | ); |
| 228 | 228 | } |
| 229 | 229 | |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | if (is_bool($value)) { |
| 251 | - return '<comment>' . ($value ? 'True' : 'False') . '</comment>'; |
|
| 251 | + return '<comment>'.($value ? 'True' : 'False').'</comment>'; |
|
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | if (empty($value)) { |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | |
| 331 | 331 | if ($property instanceof FieldMetadata) { |
| 332 | 332 | $output = array_merge($output, $this->formatColumn($property)); |
| 333 | - } else if ($property instanceof AssociationMetadata) { |
|
| 333 | + } else if ($property instanceof AssociationMetadata) { |
|
| 334 | 334 | // @todo guilhermeblanco Fix me! We are trying to iterate through an AssociationMetadata instance |
| 335 | 335 | foreach ($property as $field => $value) { |
| 336 | 336 | $output[] = $this->formatField(sprintf(' %s', $field), $this->formatValue($value)); |
@@ -386,7 +386,7 @@ discard block |
||
| 386 | 386 | return $this->formatField( |
| 387 | 387 | 'Entity listeners', |
| 388 | 388 | array_map( |
| 389 | - function ($entityListener) { |
|
| 389 | + function($entityListener) { |
|
| 390 | 390 | return get_class($entityListener); |
| 391 | 391 | }, |
| 392 | 392 | $entityListeners |
@@ -1757,7 +1757,7 @@ discard block |
||
| 1757 | 1757 | /** |
| 1758 | 1758 | * @param integer $type The inheritance type used by the class and its subclasses. |
| 1759 | 1759 | * |
| 1760 | - * @return string The literal string for the inheritance type. |
|
| 1760 | + * @return integer The literal string for the inheritance type. |
|
| 1761 | 1761 | * |
| 1762 | 1762 | * @throws \InvalidArgumentException When the inheritance type does not exist. |
| 1763 | 1763 | */ |
@@ -1773,7 +1773,7 @@ discard block |
||
| 1773 | 1773 | /** |
| 1774 | 1774 | * @param integer $type The policy used for change-tracking for the mapped class. |
| 1775 | 1775 | * |
| 1776 | - * @return string The literal string for the change-tracking type. |
|
| 1776 | + * @return integer The literal string for the change-tracking type. |
|
| 1777 | 1777 | * |
| 1778 | 1778 | * @throws \InvalidArgumentException When the change-tracking type does not exist. |
| 1779 | 1779 | */ |
@@ -1789,7 +1789,7 @@ discard block |
||
| 1789 | 1789 | /** |
| 1790 | 1790 | * @param integer $type The generator to use for the mapped class. |
| 1791 | 1791 | * |
| 1792 | - * @return string The literal string for the generator type. |
|
| 1792 | + * @return integer The literal string for the generator type. |
|
| 1793 | 1793 | * |
| 1794 | 1794 | * @throws \InvalidArgumentException When the generator type does not exist. |
| 1795 | 1795 | */ |
@@ -1343,14 +1343,14 @@ |
||
| 1343 | 1343 | } |
| 1344 | 1344 | |
| 1345 | 1345 | $replacements = [ |
| 1346 | - '<description>' => ucfirst($type) . ' ' . $variableName . '.', |
|
| 1347 | - '<methodTypeHint>' => $methodTypeHint, |
|
| 1348 | - '<variableType>' => $variableType . (null !== $defaultValue ? ('|' . $defaultValue) : ''), |
|
| 1349 | - '<variableName>' => $variableName, |
|
| 1350 | - '<methodName>' => $methodName, |
|
| 1351 | - '<fieldName>' => $fieldName, |
|
| 1352 | - '<variableDefault>' => ($defaultValue !== null ) ? (' = ' . $defaultValue) : '', |
|
| 1353 | - '<entity>' => $this->getClassName($metadata) |
|
| 1346 | + '<description>' => ucfirst($type) . ' ' . $variableName . '.', |
|
| 1347 | + '<methodTypeHint>' => $methodTypeHint, |
|
| 1348 | + '<variableType>' => $variableType . (null !== $defaultValue ? ('|' . $defaultValue) : ''), |
|
| 1349 | + '<variableName>' => $variableName, |
|
| 1350 | + '<methodName>' => $methodName, |
|
| 1351 | + '<fieldName>' => $fieldName, |
|
| 1352 | + '<variableDefault>' => ($defaultValue !== null ) ? (' = ' . $defaultValue) : '', |
|
| 1353 | + '<entity>' => $this->getClassName($metadata) |
|
| 1354 | 1354 | ]; |
| 1355 | 1355 | |
| 1356 | 1356 | $method = str_replace( |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM\Tools; |
| 6 | 6 | |
@@ -328,7 +328,7 @@ discard block |
||
| 328 | 328 | */ |
| 329 | 329 | public function writeEntityClass(ClassMetadata $metadata, $outputDirectory) |
| 330 | 330 | { |
| 331 | - $path = $outputDirectory . '/' . str_replace('\\', DIRECTORY_SEPARATOR, $metadata->getClassName()) . $this->extension; |
|
| 331 | + $path = $outputDirectory.'/'.str_replace('\\', DIRECTORY_SEPARATOR, $metadata->getClassName()).$this->extension; |
|
| 332 | 332 | $dir = dirname($path); |
| 333 | 333 | |
| 334 | 334 | if ( ! is_dir($dir)) { |
@@ -344,8 +344,8 @@ discard block |
||
| 344 | 344 | } |
| 345 | 345 | |
| 346 | 346 | if ($this->backupExisting && file_exists($path)) { |
| 347 | - $backupPath = dirname($path) . DIRECTORY_SEPARATOR . basename($path) . "~"; |
|
| 348 | - if (!copy($path, $backupPath)) { |
|
| 347 | + $backupPath = dirname($path).DIRECTORY_SEPARATOR.basename($path)."~"; |
|
| 348 | + if ( ! copy($path, $backupPath)) { |
|
| 349 | 349 | throw new \RuntimeException("Attempt to backup overwritten entity file but copy operation failed."); |
| 350 | 350 | } |
| 351 | 351 | } |
@@ -407,7 +407,7 @@ discard block |
||
| 407 | 407 | $body = str_replace('<spaces>', $this->spaces, $body); |
| 408 | 408 | $last = strrpos($currentCode, '}'); |
| 409 | 409 | |
| 410 | - return substr($currentCode, 0, $last) . $body . ($body ? "\n" : '') . "}\n"; |
|
| 410 | + return substr($currentCode, 0, $last).$body.($body ? "\n" : '')."}\n"; |
|
| 411 | 411 | } |
| 412 | 412 | |
| 413 | 413 | /** |
@@ -471,7 +471,7 @@ discard block |
||
| 471 | 471 | public function setFieldVisibility($visibility) |
| 472 | 472 | { |
| 473 | 473 | if ($visibility !== static::FIELD_VISIBLE_PRIVATE && $visibility !== static::FIELD_VISIBLE_PROTECTED) { |
| 474 | - throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): ' . $visibility); |
|
| 474 | + throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): '.$visibility); |
|
| 475 | 475 | } |
| 476 | 476 | |
| 477 | 477 | $this->fieldVisibility = $visibility; |
@@ -568,11 +568,11 @@ discard block |
||
| 568 | 568 | */ |
| 569 | 569 | protected function generateEntityNamespace(ClassMetadata $metadata) |
| 570 | 570 | { |
| 571 | - if (! $this->hasNamespace($metadata)) { |
|
| 571 | + if ( ! $this->hasNamespace($metadata)) { |
|
| 572 | 572 | return ''; |
| 573 | 573 | } |
| 574 | 574 | |
| 575 | - return 'namespace ' . $this->getNamespace($metadata) .';'; |
|
| 575 | + return 'namespace '.$this->getNamespace($metadata).';'; |
|
| 576 | 576 | } |
| 577 | 577 | |
| 578 | 578 | /** |
@@ -594,8 +594,8 @@ discard block |
||
| 594 | 594 | */ |
| 595 | 595 | protected function generateEntityClassName(ClassMetadata $metadata) |
| 596 | 596 | { |
| 597 | - return 'class ' . $this->getClassName($metadata) . |
|
| 598 | - ($this->extendsClass() ? ' extends ' . $this->getClassToExtendName() : null); |
|
| 597 | + return 'class '.$this->getClassName($metadata). |
|
| 598 | + ($this->extendsClass() ? ' extends '.$this->getClassToExtendName() : null); |
|
| 599 | 599 | } |
| 600 | 600 | |
| 601 | 601 | /** |
@@ -680,7 +680,7 @@ discard block |
||
| 680 | 680 | $optionalFields = []; |
| 681 | 681 | |
| 682 | 682 | foreach ($metadata->getDeclaredPropertiesIterator() as $property) { |
| 683 | - if (! $property->isNullable()) { |
|
| 683 | + if ( ! $property->isNullable()) { |
|
| 684 | 684 | $requiredFields[] = $property; |
| 685 | 685 | |
| 686 | 686 | continue; |
@@ -709,13 +709,13 @@ discard block |
||
| 709 | 709 | $fieldName = $property->getName(); |
| 710 | 710 | $fieldType = $property->getTypeName(); |
| 711 | 711 | $mappedType = $this->getType($fieldType); |
| 712 | - $param = '$' . $fieldName; |
|
| 712 | + $param = '$'.$fieldName; |
|
| 713 | 713 | |
| 714 | - $paramTypes[] = $mappedType . ($property->isNullable() ? '|null' : ''); |
|
| 714 | + $paramTypes[] = $mappedType.($property->isNullable() ? '|null' : ''); |
|
| 715 | 715 | $paramVariables[] = $param; |
| 716 | 716 | |
| 717 | 717 | if ($fieldType === 'datetime') { |
| 718 | - $param = $mappedType . ' ' . $param; |
|
| 718 | + $param = $mappedType.' '.$param; |
|
| 719 | 719 | } |
| 720 | 720 | |
| 721 | 721 | if ($property->isNullable()) { |
@@ -724,13 +724,13 @@ discard block |
||
| 724 | 724 | |
| 725 | 725 | $params[] = $param; |
| 726 | 726 | |
| 727 | - $fields[] = '$this->' . $fieldName . ' = $' . $fieldName . ';'; |
|
| 727 | + $fields[] = '$this->'.$fieldName.' = $'.$fieldName.';'; |
|
| 728 | 728 | } |
| 729 | 729 | |
| 730 | 730 | $maxParamTypeLength = max(array_map('strlen', $paramTypes)); |
| 731 | 731 | $paramTags = array_map( |
| 732 | - function ($type, $variable) use ($maxParamTypeLength) { |
|
| 733 | - return '@param ' . $type . str_repeat(' ', $maxParamTypeLength - strlen($type) + 1) . $variable; |
|
| 732 | + function($type, $variable) use ($maxParamTypeLength) { |
|
| 733 | + return '@param '.$type.str_repeat(' ', $maxParamTypeLength - strlen($type) + 1).$variable; |
|
| 734 | 734 | }, |
| 735 | 735 | $paramTypes, |
| 736 | 736 | $paramVariables |
@@ -738,8 +738,8 @@ discard block |
||
| 738 | 738 | |
| 739 | 739 | // Generate multi line constructor if the signature exceeds 120 characters. |
| 740 | 740 | if (array_sum(array_map('strlen', $params)) + count($params) * 2 + 29 > 120) { |
| 741 | - $delimiter = "\n" . $this->spaces; |
|
| 742 | - $params = $delimiter . implode(',' . $delimiter, $params) . "\n"; |
|
| 741 | + $delimiter = "\n".$this->spaces; |
|
| 742 | + $params = $delimiter.implode(','.$delimiter, $params)."\n"; |
|
| 743 | 743 | } else { |
| 744 | 744 | $params = implode(', ', $params); |
| 745 | 745 | } |
@@ -747,7 +747,7 @@ discard block |
||
| 747 | 747 | $replacements = [ |
| 748 | 748 | '<paramTags>' => implode("\n * ", $paramTags), |
| 749 | 749 | '<params>' => $params, |
| 750 | - '<fields>' => implode("\n" . $this->spaces, $fields), |
|
| 750 | + '<fields>' => implode("\n".$this->spaces, $fields), |
|
| 751 | 751 | ]; |
| 752 | 752 | |
| 753 | 753 | $constructor = str_replace( |
@@ -792,7 +792,7 @@ discard block |
||
| 792 | 792 | |
| 793 | 793 | if ($inClass) { |
| 794 | 794 | $inClass = false; |
| 795 | - $lastSeenClass = $lastSeenNamespace . ($lastSeenNamespace ? '\\' : '') . $token[1]; |
|
| 795 | + $lastSeenClass = $lastSeenNamespace.($lastSeenNamespace ? '\\' : '').$token[1]; |
|
| 796 | 796 | $this->staticReflection[$lastSeenClass]['properties'] = []; |
| 797 | 797 | $this->staticReflection[$lastSeenClass]['methods'] = []; |
| 798 | 798 | } |
@@ -800,16 +800,16 @@ discard block |
||
| 800 | 800 | if (T_NAMESPACE === $token[0]) { |
| 801 | 801 | $lastSeenNamespace = ''; |
| 802 | 802 | $inNamespace = true; |
| 803 | - } elseif (T_CLASS === $token[0] && T_DOUBLE_COLON !== $tokens[$i-1][0]) { |
|
| 803 | + } elseif (T_CLASS === $token[0] && T_DOUBLE_COLON !== $tokens[$i - 1][0]) { |
|
| 804 | 804 | $inClass = true; |
| 805 | 805 | } elseif (T_FUNCTION === $token[0]) { |
| 806 | - if (T_STRING === $tokens[$i+2][0]) { |
|
| 807 | - $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+2][1]); |
|
| 808 | - } elseif ($tokens[$i+2] == '&' && T_STRING === $tokens[$i+3][0]) { |
|
| 809 | - $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+3][1]); |
|
| 806 | + if (T_STRING === $tokens[$i + 2][0]) { |
|
| 807 | + $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 2][1]); |
|
| 808 | + } elseif ($tokens[$i + 2] == '&' && T_STRING === $tokens[$i + 3][0]) { |
|
| 809 | + $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 3][1]); |
|
| 810 | 810 | } |
| 811 | - } elseif (in_array($token[0], [T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED], true) && T_FUNCTION !== $tokens[$i+2][0]) { |
|
| 812 | - $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i+2][1], 1); |
|
| 811 | + } elseif (in_array($token[0], [T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED], true) && T_FUNCTION !== $tokens[$i + 2][0]) { |
|
| 812 | + $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i + 2][1], 1); |
|
| 813 | 813 | } |
| 814 | 814 | } |
| 815 | 815 | } |
@@ -822,7 +822,7 @@ discard block |
||
| 822 | 822 | */ |
| 823 | 823 | protected function hasProperty($property, ClassMetadata $metadata) |
| 824 | 824 | { |
| 825 | - if ($this->extendsClass() || (!$this->isNew && class_exists($metadata->getClassName()))) { |
|
| 825 | + if ($this->extendsClass() || ( ! $this->isNew && class_exists($metadata->getClassName()))) { |
|
| 826 | 826 | // don't generate property if its already on the base class. |
| 827 | 827 | $reflClass = new \ReflectionClass($this->getClassToExtend() ?: $metadata->getClassName()); |
| 828 | 828 | |
@@ -852,7 +852,7 @@ discard block |
||
| 852 | 852 | */ |
| 853 | 853 | protected function hasMethod($method, ClassMetadata $metadata) |
| 854 | 854 | { |
| 855 | - if ($this->extendsClass() || (!$this->isNew && class_exists($metadata->getClassName()))) { |
|
| 855 | + if ($this->extendsClass() || ( ! $this->isNew && class_exists($metadata->getClassName()))) { |
|
| 856 | 856 | // don't generate method if its already on the base class. |
| 857 | 857 | $reflClass = new \ReflectionClass($this->getClassToExtend() ?: $metadata->getClassName()); |
| 858 | 858 | |
@@ -883,7 +883,7 @@ discard block |
||
| 883 | 883 | */ |
| 884 | 884 | protected function getTraits(ClassMetadata $metadata) |
| 885 | 885 | { |
| 886 | - if (! ($metadata->getReflectionClass() !== null || class_exists($metadata->getClassName()))) { |
|
| 886 | + if ( ! ($metadata->getReflectionClass() !== null || class_exists($metadata->getClassName()))) { |
|
| 887 | 887 | return []; |
| 888 | 888 | } |
| 889 | 889 | |
@@ -932,7 +932,7 @@ discard block |
||
| 932 | 932 | { |
| 933 | 933 | $refl = new \ReflectionClass($this->getClassToExtend()); |
| 934 | 934 | |
| 935 | - return '\\' . $refl->getName(); |
|
| 935 | + return '\\'.$refl->getName(); |
|
| 936 | 936 | } |
| 937 | 937 | |
| 938 | 938 | /** |
@@ -965,7 +965,7 @@ discard block |
||
| 965 | 965 | { |
| 966 | 966 | $lines = []; |
| 967 | 967 | $lines[] = '/**'; |
| 968 | - $lines[] = ' * ' . $this->getClassName($metadata); |
|
| 968 | + $lines[] = ' * '.$this->getClassName($metadata); |
|
| 969 | 969 | |
| 970 | 970 | if ($this->generateAnnotations) { |
| 971 | 971 | $lines[] = ' *'; |
@@ -981,12 +981,12 @@ discard block |
||
| 981 | 981 | |
| 982 | 982 | foreach ($methods as $method) { |
| 983 | 983 | if ($code = $this->$method($metadata)) { |
| 984 | - $lines[] = ' * ' . $code; |
|
| 984 | + $lines[] = ' * '.$code; |
|
| 985 | 985 | } |
| 986 | 986 | } |
| 987 | 987 | |
| 988 | 988 | if (isset($metadata->lifecycleCallbacks) && $metadata->lifecycleCallbacks) { |
| 989 | - $lines[] = ' * @' . $this->annotationsPrefix . 'HasLifecycleCallbacks'; |
|
| 989 | + $lines[] = ' * @'.$this->annotationsPrefix.'HasLifecycleCallbacks'; |
|
| 990 | 990 | } |
| 991 | 991 | } |
| 992 | 992 | |
@@ -1002,17 +1002,17 @@ discard block |
||
| 1002 | 1002 | */ |
| 1003 | 1003 | protected function generateEntityAnnotation(ClassMetadata $metadata) |
| 1004 | 1004 | { |
| 1005 | - $prefix = '@' . $this->annotationsPrefix; |
|
| 1005 | + $prefix = '@'.$this->annotationsPrefix; |
|
| 1006 | 1006 | |
| 1007 | 1007 | if ($metadata->isEmbeddedClass) { |
| 1008 | - return $prefix . 'Embeddable'; |
|
| 1008 | + return $prefix.'Embeddable'; |
|
| 1009 | 1009 | } |
| 1010 | 1010 | |
| 1011 | 1011 | $customRepository = $metadata->getCustomRepositoryClassName() |
| 1012 | - ? '(repositoryClass="' . $metadata->getCustomRepositoryClassName() . '")' |
|
| 1012 | + ? '(repositoryClass="'.$metadata->getCustomRepositoryClassName().'")' |
|
| 1013 | 1013 | : ''; |
| 1014 | 1014 | |
| 1015 | - return $prefix . ($metadata->isMappedSuperclass ? 'MappedSuperclass' : 'Entity') . $customRepository; |
|
| 1015 | + return $prefix.($metadata->isMappedSuperclass ? 'MappedSuperclass' : 'Entity').$customRepository; |
|
| 1016 | 1016 | } |
| 1017 | 1017 | |
| 1018 | 1018 | /** |
@@ -1029,28 +1029,28 @@ discard block |
||
| 1029 | 1029 | $table = []; |
| 1030 | 1030 | |
| 1031 | 1031 | if ($metadata->table->getSchema()) { |
| 1032 | - $table[] = 'schema="' . $metadata->table->getSchema() . '"'; |
|
| 1032 | + $table[] = 'schema="'.$metadata->table->getSchema().'"'; |
|
| 1033 | 1033 | } |
| 1034 | 1034 | |
| 1035 | 1035 | if ($metadata->table->getName()) { |
| 1036 | - $table[] = 'name="' . $metadata->table->getName() . '"'; |
|
| 1036 | + $table[] = 'name="'.$metadata->table->getName().'"'; |
|
| 1037 | 1037 | } |
| 1038 | 1038 | |
| 1039 | 1039 | if ($metadata->table->getOptions()) { |
| 1040 | - $table[] = 'options={' . $this->exportTableOptions($metadata->table->getOptions()) . '}'; |
|
| 1040 | + $table[] = 'options={'.$this->exportTableOptions($metadata->table->getOptions()).'}'; |
|
| 1041 | 1041 | } |
| 1042 | 1042 | |
| 1043 | 1043 | if ($metadata->table->getUniqueConstraints()) { |
| 1044 | 1044 | $constraints = $this->generateTableConstraints('UniqueConstraint', $metadata->table->getUniqueConstraints()); |
| 1045 | - $table[] = 'uniqueConstraints={' . $constraints . '}'; |
|
| 1045 | + $table[] = 'uniqueConstraints={'.$constraints.'}'; |
|
| 1046 | 1046 | } |
| 1047 | 1047 | |
| 1048 | 1048 | if ($metadata->table->getIndexes()) { |
| 1049 | 1049 | $constraints = $this->generateTableConstraints('Index', $metadata->table->getIndexes()); |
| 1050 | - $table[] = 'indexes={' . $constraints . '}'; |
|
| 1050 | + $table[] = 'indexes={'.$constraints.'}'; |
|
| 1051 | 1051 | } |
| 1052 | 1052 | |
| 1053 | - return '@' . $this->annotationsPrefix . 'Table(' . implode(', ', $table) . ')'; |
|
| 1053 | + return '@'.$this->annotationsPrefix.'Table('.implode(', ', $table).')'; |
|
| 1054 | 1054 | } |
| 1055 | 1055 | |
| 1056 | 1056 | /** |
@@ -1067,10 +1067,10 @@ discard block |
||
| 1067 | 1067 | $columns = []; |
| 1068 | 1068 | |
| 1069 | 1069 | foreach ($constraint['columns'] as $column) { |
| 1070 | - $columns[] = '"' . $column . '"'; |
|
| 1070 | + $columns[] = '"'.$column.'"'; |
|
| 1071 | 1071 | } |
| 1072 | 1072 | |
| 1073 | - $annotations[] = '@' . $this->annotationsPrefix . $constraintName . '(name="' . $name . '", columns={' . implode(', ', $columns) . '})'; |
|
| 1073 | + $annotations[] = '@'.$this->annotationsPrefix.$constraintName.'(name="'.$name.'", columns={'.implode(', ', $columns).'})'; |
|
| 1074 | 1074 | } |
| 1075 | 1075 | |
| 1076 | 1076 | return implode(', ', $annotations); |
@@ -1084,7 +1084,7 @@ discard block |
||
| 1084 | 1084 | protected function generateInheritanceAnnotation(ClassMetadata $metadata) |
| 1085 | 1085 | { |
| 1086 | 1086 | if ($metadata->inheritanceType !== InheritanceType::NONE) { |
| 1087 | - return '@' . $this->annotationsPrefix . 'InheritanceType("'.$this->getInheritanceTypeString($metadata->inheritanceType).'")'; |
|
| 1087 | + return '@'.$this->annotationsPrefix.'InheritanceType("'.$this->getInheritanceTypeString($metadata->inheritanceType).'")'; |
|
| 1088 | 1088 | } |
| 1089 | 1089 | } |
| 1090 | 1090 | |
@@ -1105,7 +1105,7 @@ discard block |
||
| 1105 | 1105 | $discrColumn->getLength() |
| 1106 | 1106 | ); |
| 1107 | 1107 | |
| 1108 | - return '@' . $this->annotationsPrefix . 'DiscriminatorColumn(' . $columnDefinition . ')'; |
|
| 1108 | + return '@'.$this->annotationsPrefix.'DiscriminatorColumn('.$columnDefinition.')'; |
|
| 1109 | 1109 | } |
| 1110 | 1110 | } |
| 1111 | 1111 | |
@@ -1120,10 +1120,10 @@ discard block |
||
| 1120 | 1120 | $inheritanceClassMap = []; |
| 1121 | 1121 | |
| 1122 | 1122 | foreach ($metadata->discriminatorMap as $type => $class) { |
| 1123 | - $inheritanceClassMap[] .= '"' . $type . '" = "' . $class . '"'; |
|
| 1123 | + $inheritanceClassMap[] .= '"'.$type.'" = "'.$class.'"'; |
|
| 1124 | 1124 | } |
| 1125 | 1125 | |
| 1126 | - return '@' . $this->annotationsPrefix . 'DiscriminatorMap({' . implode(', ', $inheritanceClassMap) . '})'; |
|
| 1126 | + return '@'.$this->annotationsPrefix.'DiscriminatorMap({'.implode(', ', $inheritanceClassMap).'})'; |
|
| 1127 | 1127 | } |
| 1128 | 1128 | } |
| 1129 | 1129 | |
@@ -1154,7 +1154,7 @@ discard block |
||
| 1154 | 1154 | |
| 1155 | 1155 | foreach ($metadata->getDeclaredPropertiesIterator() as $fieldName => $property) { |
| 1156 | 1156 | if ($property instanceof FieldMetadata) { |
| 1157 | - $nullable = $property->isNullable() ? 'null' : null; |
|
| 1157 | + $nullable = $property->isNullable() ? 'null' : null; |
|
| 1158 | 1158 | |
| 1159 | 1159 | if ($code = $this->generateEntityStubMethod($metadata, 'get', $fieldName, $property->getTypeName(), $nullable)) { |
| 1160 | 1160 | $methods[] = $code; |
@@ -1210,7 +1210,7 @@ discard block |
||
| 1210 | 1210 | ; |
| 1211 | 1211 | |
| 1212 | 1212 | foreach ($joinColumns as $joinColumn) { |
| 1213 | - if (! $joinColumn->isNullable()) { |
|
| 1213 | + if ( ! $joinColumn->isNullable()) { |
|
| 1214 | 1214 | return false; |
| 1215 | 1215 | } |
| 1216 | 1216 | } |
@@ -1259,7 +1259,7 @@ discard block |
||
| 1259 | 1259 | |
| 1260 | 1260 | if ($property instanceof FieldMetadata) { |
| 1261 | 1261 | $options = $property->getOptions(); |
| 1262 | - $defaultValue = isset($options['default']) ? ' = ' . var_export($options['default'], true) : null; |
|
| 1262 | + $defaultValue = isset($options['default']) ? ' = '.var_export($options['default'], true) : null; |
|
| 1263 | 1263 | |
| 1264 | 1264 | $lines[] = $this->generateFieldMappingPropertyDocBlock($property, $metadata); |
| 1265 | 1265 | } else { |
@@ -1268,7 +1268,7 @@ discard block |
||
| 1268 | 1268 | $lines[] = $this->generateAssociationMappingPropertyDocBlock($property, $metadata); |
| 1269 | 1269 | } |
| 1270 | 1270 | |
| 1271 | - $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $fieldName . $defaultValue . ";\n"; |
|
| 1271 | + $lines[] = $this->spaces.$this->fieldVisibility.' $'.$fieldName.$defaultValue.";\n"; |
|
| 1272 | 1272 | } |
| 1273 | 1273 | |
| 1274 | 1274 | return implode("\n", $lines); |
@@ -1306,7 +1306,7 @@ discard block |
||
| 1306 | 1306 | */ |
| 1307 | 1307 | protected function generateEntityStubMethod(ClassMetadata $metadata, $type, $fieldName, $typeHint = null, $defaultValue = null) |
| 1308 | 1308 | { |
| 1309 | - $methodName = $type . Inflector::classify($fieldName); |
|
| 1309 | + $methodName = $type.Inflector::classify($fieldName); |
|
| 1310 | 1310 | $variableName = Inflector::camelize($fieldName); |
| 1311 | 1311 | |
| 1312 | 1312 | if (in_array($type, ["add", "remove"])) { |
@@ -1327,18 +1327,18 @@ discard block |
||
| 1327 | 1327 | $variableType = $typeHint ? $this->getType($typeHint) : null; |
| 1328 | 1328 | |
| 1329 | 1329 | if ($typeHint && ! isset($types[$typeHint])) { |
| 1330 | - $variableType = '\\' . ltrim($variableType, '\\'); |
|
| 1331 | - $methodTypeHint = '\\' . $typeHint . ' '; |
|
| 1330 | + $variableType = '\\'.ltrim($variableType, '\\'); |
|
| 1331 | + $methodTypeHint = '\\'.$typeHint.' '; |
|
| 1332 | 1332 | } |
| 1333 | 1333 | |
| 1334 | 1334 | $replacements = [ |
| 1335 | - '<description>' => ucfirst($type) . ' ' . $variableName . '.', |
|
| 1335 | + '<description>' => ucfirst($type).' '.$variableName.'.', |
|
| 1336 | 1336 | '<methodTypeHint>' => $methodTypeHint, |
| 1337 | - '<variableType>' => $variableType . (null !== $defaultValue ? ('|' . $defaultValue) : ''), |
|
| 1337 | + '<variableType>' => $variableType.(null !== $defaultValue ? ('|'.$defaultValue) : ''), |
|
| 1338 | 1338 | '<variableName>' => $variableName, |
| 1339 | 1339 | '<methodName>' => $methodName, |
| 1340 | 1340 | '<fieldName>' => $fieldName, |
| 1341 | - '<variableDefault>' => ($defaultValue !== null ) ? (' = ' . $defaultValue) : '', |
|
| 1341 | + '<variableDefault>' => ($defaultValue !== null) ? (' = '.$defaultValue) : '', |
|
| 1342 | 1342 | '<entity>' => $this->getClassName($metadata) |
| 1343 | 1343 | ]; |
| 1344 | 1344 | |
@@ -1367,7 +1367,7 @@ discard block |
||
| 1367 | 1367 | $this->staticReflection[$metadata->getClassName()]['methods'][] = $methodName; |
| 1368 | 1368 | |
| 1369 | 1369 | $replacements = [ |
| 1370 | - '<name>' => $this->annotationsPrefix . ucfirst($name), |
|
| 1370 | + '<name>' => $this->annotationsPrefix.ucfirst($name), |
|
| 1371 | 1371 | '<methodName>' => $methodName, |
| 1372 | 1372 | ]; |
| 1373 | 1373 | |
@@ -1387,25 +1387,25 @@ discard block |
||
| 1387 | 1387 | */ |
| 1388 | 1388 | protected function generateIdentifierAnnotation(Property $metadata) |
| 1389 | 1389 | { |
| 1390 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Id'; |
|
| 1390 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Id'; |
|
| 1391 | 1391 | |
| 1392 | 1392 | if ($metadata instanceof FieldMetadata) { |
| 1393 | 1393 | if ($generatorType = $this->getIdGeneratorTypeString($metadata->getValueGenerator()->getType())) { |
| 1394 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'GeneratedValue(strategy="' . $generatorType . '")'; |
|
| 1394 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'GeneratedValue(strategy="'.$generatorType.'")'; |
|
| 1395 | 1395 | } |
| 1396 | 1396 | |
| 1397 | 1397 | if ($metadata->getValueGenerator()->getType()) { |
| 1398 | 1398 | $generator = []; |
| 1399 | 1399 | |
| 1400 | 1400 | if (isset($metadata->getValueGenerator()->getDefinition()['sequenceName'])) { |
| 1401 | - $generator[] = 'sequenceName="' . $metadata->getValueGenerator()->getDefinition()['sequenceName'] . '"'; |
|
| 1401 | + $generator[] = 'sequenceName="'.$metadata->getValueGenerator()->getDefinition()['sequenceName'].'"'; |
|
| 1402 | 1402 | } |
| 1403 | 1403 | |
| 1404 | 1404 | if (isset($metadata->getValueGenerator()->getDefinition()['allocationSize'])) { |
| 1405 | - $generator[] = 'allocationSize=' . $metadata->getValueGenerator()->getDefinition()['allocationSize']; |
|
| 1405 | + $generator[] = 'allocationSize='.$metadata->getValueGenerator()->getDefinition()['allocationSize']; |
|
| 1406 | 1406 | } |
| 1407 | 1407 | |
| 1408 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'SequenceGenerator(' . implode(', ', $generator) . ')'; |
|
| 1408 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'SequenceGenerator('.implode(', ', $generator).')'; |
|
| 1409 | 1409 | } |
| 1410 | 1410 | } |
| 1411 | 1411 | |
@@ -1421,34 +1421,34 @@ discard block |
||
| 1421 | 1421 | { |
| 1422 | 1422 | $lines = []; |
| 1423 | 1423 | $joinTableAnnot = []; |
| 1424 | - $joinTableAnnot[] = 'name="' . $joinTable->getName() . '"'; |
|
| 1424 | + $joinTableAnnot[] = 'name="'.$joinTable->getName().'"'; |
|
| 1425 | 1425 | |
| 1426 | - if (! empty($joinTable->getSchema())) { |
|
| 1427 | - $joinTableAnnot[] = 'schema="' . $joinTable->getSchema() . '"'; |
|
| 1426 | + if ( ! empty($joinTable->getSchema())) { |
|
| 1427 | + $joinTableAnnot[] = 'schema="'.$joinTable->getSchema().'"'; |
|
| 1428 | 1428 | } |
| 1429 | 1429 | |
| 1430 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'JoinTable(' . implode(', ', $joinTableAnnot) . ','; |
|
| 1431 | - $lines[] = $this->spaces . ' * joinColumns={'; |
|
| 1430 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'JoinTable('.implode(', ', $joinTableAnnot).','; |
|
| 1431 | + $lines[] = $this->spaces.' * joinColumns={'; |
|
| 1432 | 1432 | |
| 1433 | 1433 | $joinColumnsLines = []; |
| 1434 | 1434 | |
| 1435 | 1435 | foreach ($joinTable->getJoinColumns() as $joinColumn) { |
| 1436 | - $joinColumnsLines[] = $this->spaces . ' * ' . $this->generateJoinColumnAnnotation($joinColumn); |
|
| 1436 | + $joinColumnsLines[] = $this->spaces.' * '.$this->generateJoinColumnAnnotation($joinColumn); |
|
| 1437 | 1437 | } |
| 1438 | 1438 | |
| 1439 | - $lines[] = implode(",". PHP_EOL, $joinColumnsLines); |
|
| 1440 | - $lines[] = $this->spaces . ' * },'; |
|
| 1441 | - $lines[] = $this->spaces . ' * inverseJoinColumns={'; |
|
| 1439 | + $lines[] = implode(",".PHP_EOL, $joinColumnsLines); |
|
| 1440 | + $lines[] = $this->spaces.' * },'; |
|
| 1441 | + $lines[] = $this->spaces.' * inverseJoinColumns={'; |
|
| 1442 | 1442 | |
| 1443 | 1443 | $inverseJoinColumnsLines = []; |
| 1444 | 1444 | |
| 1445 | 1445 | foreach ($joinTable->getInverseJoinColumns() as $joinColumn) { |
| 1446 | - $inverseJoinColumnsLines[] = $this->spaces . ' * ' . $this->generateJoinColumnAnnotation($joinColumn); |
|
| 1446 | + $inverseJoinColumnsLines[] = $this->spaces.' * '.$this->generateJoinColumnAnnotation($joinColumn); |
|
| 1447 | 1447 | } |
| 1448 | 1448 | |
| 1449 | - $lines[] = implode(",". PHP_EOL, $inverseJoinColumnsLines); |
|
| 1450 | - $lines[] = $this->spaces . ' * }'; |
|
| 1451 | - $lines[] = $this->spaces . ' * )'; |
|
| 1449 | + $lines[] = implode(",".PHP_EOL, $inverseJoinColumnsLines); |
|
| 1450 | + $lines[] = $this->spaces.' * }'; |
|
| 1451 | + $lines[] = $this->spaces.' * )'; |
|
| 1452 | 1452 | |
| 1453 | 1453 | return implode(PHP_EOL, $lines); |
| 1454 | 1454 | } |
@@ -1462,23 +1462,23 @@ discard block |
||
| 1462 | 1462 | { |
| 1463 | 1463 | $joinColumnAnnot = []; |
| 1464 | 1464 | |
| 1465 | - $joinColumnAnnot[] = 'name="' . $joinColumn->getColumnName() . '"'; |
|
| 1466 | - $joinColumnAnnot[] = 'referencedColumnName="' . $joinColumn->getReferencedColumnName() . '"'; |
|
| 1465 | + $joinColumnAnnot[] = 'name="'.$joinColumn->getColumnName().'"'; |
|
| 1466 | + $joinColumnAnnot[] = 'referencedColumnName="'.$joinColumn->getReferencedColumnName().'"'; |
|
| 1467 | 1467 | |
| 1468 | 1468 | if ($joinColumn->isUnique()) { |
| 1469 | 1469 | $joinColumnAnnot[] = 'unique=true'; |
| 1470 | 1470 | } |
| 1471 | 1471 | |
| 1472 | - if (!$joinColumn->isNullable()) { |
|
| 1472 | + if ( ! $joinColumn->isNullable()) { |
|
| 1473 | 1473 | $joinColumnAnnot[] = 'nullable=false'; |
| 1474 | 1474 | } |
| 1475 | 1475 | |
| 1476 | - if (!empty($joinColumn->getOnDelete())) { |
|
| 1477 | - $joinColumnAnnot[] = 'onDelete="' . $joinColumn->getOnDelete() . '"'; |
|
| 1476 | + if ( ! empty($joinColumn->getOnDelete())) { |
|
| 1477 | + $joinColumnAnnot[] = 'onDelete="'.$joinColumn->getOnDelete().'"'; |
|
| 1478 | 1478 | } |
| 1479 | 1479 | |
| 1480 | 1480 | if ($joinColumn->getColumnDefinition()) { |
| 1481 | - $joinColumnAnnot[] = 'columnDefinition="' . $joinColumn->getColumnDefinition() . '"'; |
|
| 1481 | + $joinColumnAnnot[] = 'columnDefinition="'.$joinColumn->getColumnDefinition().'"'; |
|
| 1482 | 1482 | } |
| 1483 | 1483 | |
| 1484 | 1484 | $options = []; |
@@ -1493,7 +1493,7 @@ discard block |
||
| 1493 | 1493 | $joinColumnAnnot[] = 'options={'.implode(',', $options).'}'; |
| 1494 | 1494 | } |
| 1495 | 1495 | |
| 1496 | - return '@' . $this->annotationsPrefix . 'JoinColumn(' . implode(', ', $joinColumnAnnot) . ')'; |
|
| 1496 | + return '@'.$this->annotationsPrefix.'JoinColumn('.implode(', ', $joinColumnAnnot).')'; |
|
| 1497 | 1497 | } |
| 1498 | 1498 | |
| 1499 | 1499 | /** |
@@ -1505,16 +1505,16 @@ discard block |
||
| 1505 | 1505 | protected function generateAssociationMappingPropertyDocBlock(AssociationMetadata $association, ClassMetadata $metadata) |
| 1506 | 1506 | { |
| 1507 | 1507 | $lines = []; |
| 1508 | - $lines[] = $this->spaces . '/**'; |
|
| 1508 | + $lines[] = $this->spaces.'/**'; |
|
| 1509 | 1509 | |
| 1510 | 1510 | if ($association instanceof ToManyAssociationMetadata) { |
| 1511 | - $lines[] = $this->spaces . ' * @var \Doctrine\Common\Collections\Collection'; |
|
| 1511 | + $lines[] = $this->spaces.' * @var \Doctrine\Common\Collections\Collection'; |
|
| 1512 | 1512 | } else { |
| 1513 | - $lines[] = $this->spaces . ' * @var \\' . ltrim($association->getTargetEntity(), '\\'); |
|
| 1513 | + $lines[] = $this->spaces.' * @var \\'.ltrim($association->getTargetEntity(), '\\'); |
|
| 1514 | 1514 | } |
| 1515 | 1515 | |
| 1516 | 1516 | if ($this->generateAnnotations) { |
| 1517 | - $lines[] = $this->spaces . ' *'; |
|
| 1517 | + $lines[] = $this->spaces.' *'; |
|
| 1518 | 1518 | |
| 1519 | 1519 | if ($association->isPrimaryKey()) { |
| 1520 | 1520 | $lines[] = $this->generateIdentifierAnnotation($association); |
@@ -1534,18 +1534,18 @@ discard block |
||
| 1534 | 1534 | |
| 1535 | 1535 | $typeOptions = []; |
| 1536 | 1536 | |
| 1537 | - $typeOptions[] = 'targetEntity="' . $association->getTargetEntity() . '"'; |
|
| 1537 | + $typeOptions[] = 'targetEntity="'.$association->getTargetEntity().'"'; |
|
| 1538 | 1538 | |
| 1539 | 1539 | if ($association->getMappedBy()) { |
| 1540 | - $typeOptions[] = 'mappedBy="' . $association->getMappedBy() . '"'; |
|
| 1540 | + $typeOptions[] = 'mappedBy="'.$association->getMappedBy().'"'; |
|
| 1541 | 1541 | } |
| 1542 | 1542 | |
| 1543 | 1543 | if ($association->getInversedBy()) { |
| 1544 | - $typeOptions[] = 'inversedBy="' . $association->getInversedBy() . '"'; |
|
| 1544 | + $typeOptions[] = 'inversedBy="'.$association->getInversedBy().'"'; |
|
| 1545 | 1545 | } |
| 1546 | 1546 | |
| 1547 | 1547 | if ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy()) { |
| 1548 | - $typeOptions[] = 'indexBy="' . $association->getIndexedBy() . '"'; |
|
| 1548 | + $typeOptions[] = 'indexBy="'.$association->getIndexedBy().'"'; |
|
| 1549 | 1549 | } |
| 1550 | 1550 | |
| 1551 | 1551 | if ($association->isOrphanRemoval()) { |
@@ -1565,28 +1565,28 @@ discard block |
||
| 1565 | 1565 | $cascades = ['"all"']; |
| 1566 | 1566 | } |
| 1567 | 1567 | |
| 1568 | - $typeOptions[] = 'cascade={' . implode(',', $cascades) . '}'; |
|
| 1568 | + $typeOptions[] = 'cascade={'.implode(',', $cascades).'}'; |
|
| 1569 | 1569 | } |
| 1570 | 1570 | |
| 1571 | 1571 | if ($association->getFetchMode() !== FetchMode::LAZY) { |
| 1572 | - $typeOptions[] = 'fetch="' . $association->getFetchMode() . '"'; |
|
| 1572 | + $typeOptions[] = 'fetch="'.$association->getFetchMode().'"'; |
|
| 1573 | 1573 | } |
| 1574 | 1574 | |
| 1575 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . '' . $type . '(' . implode(', ', $typeOptions) . ')'; |
|
| 1575 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.''.$type.'('.implode(', ', $typeOptions).')'; |
|
| 1576 | 1576 | |
| 1577 | 1577 | if ($association instanceof ToOneAssociationMetadata && $association->getJoinColumns()) { |
| 1578 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'JoinColumns({'; |
|
| 1578 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'JoinColumns({'; |
|
| 1579 | 1579 | |
| 1580 | 1580 | $joinColumnsLines = []; |
| 1581 | 1581 | |
| 1582 | 1582 | foreach ($association->getJoinColumns() as $joinColumn) { |
| 1583 | 1583 | if ($joinColumnAnnot = $this->generateJoinColumnAnnotation($joinColumn)) { |
| 1584 | - $joinColumnsLines[] = $this->spaces . ' * ' . $joinColumnAnnot; |
|
| 1584 | + $joinColumnsLines[] = $this->spaces.' * '.$joinColumnAnnot; |
|
| 1585 | 1585 | } |
| 1586 | 1586 | } |
| 1587 | 1587 | |
| 1588 | 1588 | $lines[] = implode(",\n", $joinColumnsLines); |
| 1589 | - $lines[] = $this->spaces . ' * })'; |
|
| 1589 | + $lines[] = $this->spaces.' * })'; |
|
| 1590 | 1590 | } |
| 1591 | 1591 | |
| 1592 | 1592 | if ($association instanceof ToManyAssociationMetadata) { |
@@ -1595,20 +1595,20 @@ discard block |
||
| 1595 | 1595 | } |
| 1596 | 1596 | |
| 1597 | 1597 | if ($association->getOrderBy()) { |
| 1598 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'OrderBy({'; |
|
| 1598 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'OrderBy({'; |
|
| 1599 | 1599 | $orderBy = []; |
| 1600 | 1600 | |
| 1601 | 1601 | foreach ($association->getOrderBy() as $name => $direction) { |
| 1602 | - $orderBy[] = $this->spaces . ' * "' . $name . '"="' . $direction . '"'; |
|
| 1602 | + $orderBy[] = $this->spaces.' * "'.$name.'"="'.$direction.'"'; |
|
| 1603 | 1603 | } |
| 1604 | 1604 | |
| 1605 | - $lines[] = implode(',' . PHP_EOL, $orderBy); |
|
| 1606 | - $lines[] = $this->spaces . ' * })'; |
|
| 1605 | + $lines[] = implode(','.PHP_EOL, $orderBy); |
|
| 1606 | + $lines[] = $this->spaces.' * })'; |
|
| 1607 | 1607 | } |
| 1608 | 1608 | } |
| 1609 | 1609 | } |
| 1610 | 1610 | |
| 1611 | - $lines[] = $this->spaces . ' */'; |
|
| 1611 | + $lines[] = $this->spaces.' */'; |
|
| 1612 | 1612 | |
| 1613 | 1613 | return implode("\n", $lines); |
| 1614 | 1614 | } |
@@ -1625,43 +1625,43 @@ discard block |
||
| 1625 | 1625 | |
| 1626 | 1626 | $lines = []; |
| 1627 | 1627 | |
| 1628 | - $lines[] = $this->spaces . '/**'; |
|
| 1629 | - $lines[] = $this->spaces . ' * @var ' |
|
| 1628 | + $lines[] = $this->spaces.'/**'; |
|
| 1629 | + $lines[] = $this->spaces.' * @var ' |
|
| 1630 | 1630 | . $this->getType($fieldType) |
| 1631 | 1631 | . ($propertyMetadata->isNullable() ? '|null' : ''); |
| 1632 | 1632 | |
| 1633 | 1633 | if ($this->generateAnnotations) { |
| 1634 | 1634 | $column = []; |
| 1635 | - $lines[] = $this->spaces . ' *'; |
|
| 1635 | + $lines[] = $this->spaces.' *'; |
|
| 1636 | 1636 | |
| 1637 | 1637 | if ($propertyMetadata->getColumnName()) { |
| 1638 | - $column[] = 'name="' . $propertyMetadata->getColumnName() . '"'; |
|
| 1638 | + $column[] = 'name="'.$propertyMetadata->getColumnName().'"'; |
|
| 1639 | 1639 | } |
| 1640 | 1640 | |
| 1641 | - $column[] = 'type="' . $fieldType . '"'; |
|
| 1641 | + $column[] = 'type="'.$fieldType.'"'; |
|
| 1642 | 1642 | |
| 1643 | 1643 | if (is_int($propertyMetadata->getLength())) { |
| 1644 | - $column[] = 'length=' . $propertyMetadata->getLength(); |
|
| 1644 | + $column[] = 'length='.$propertyMetadata->getLength(); |
|
| 1645 | 1645 | } |
| 1646 | 1646 | |
| 1647 | 1647 | if (is_int($propertyMetadata->getPrecision())) { |
| 1648 | - $column[] = 'precision=' . $propertyMetadata->getPrecision(); |
|
| 1648 | + $column[] = 'precision='.$propertyMetadata->getPrecision(); |
|
| 1649 | 1649 | } |
| 1650 | 1650 | |
| 1651 | 1651 | if (is_int($propertyMetadata->getScale())) { |
| 1652 | - $column[] = 'scale=' . $propertyMetadata->getScale(); |
|
| 1652 | + $column[] = 'scale='.$propertyMetadata->getScale(); |
|
| 1653 | 1653 | } |
| 1654 | 1654 | |
| 1655 | 1655 | if ($propertyMetadata->isNullable()) { |
| 1656 | - $column[] = 'nullable=' . var_export($propertyMetadata->isNullable(), true); |
|
| 1656 | + $column[] = 'nullable='.var_export($propertyMetadata->isNullable(), true); |
|
| 1657 | 1657 | } |
| 1658 | 1658 | |
| 1659 | 1659 | if ($propertyMetadata->isUnique()) { |
| 1660 | - $column[] = 'unique=' . var_export($propertyMetadata->isUnique(), true); |
|
| 1660 | + $column[] = 'unique='.var_export($propertyMetadata->isUnique(), true); |
|
| 1661 | 1661 | } |
| 1662 | 1662 | |
| 1663 | 1663 | if ($propertyMetadata->getColumnDefinition()) { |
| 1664 | - $column[] = 'columnDefinition="' . $propertyMetadata->getColumnDefinition() . '"'; |
|
| 1664 | + $column[] = 'columnDefinition="'.$propertyMetadata->getColumnDefinition().'"'; |
|
| 1665 | 1665 | } |
| 1666 | 1666 | |
| 1667 | 1667 | $options = []; |
@@ -1676,18 +1676,18 @@ discard block |
||
| 1676 | 1676 | $column[] = 'options={'.implode(',', $options).'}'; |
| 1677 | 1677 | } |
| 1678 | 1678 | |
| 1679 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Column(' . implode(', ', $column) . ')'; |
|
| 1679 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Column('.implode(', ', $column).')'; |
|
| 1680 | 1680 | |
| 1681 | 1681 | if ($propertyMetadata->isPrimaryKey()) { |
| 1682 | 1682 | $lines[] = $this->generateIdentifierAnnotation($propertyMetadata); |
| 1683 | 1683 | } |
| 1684 | 1684 | |
| 1685 | 1685 | if ($metadata->isVersioned() && $metadata->versionProperty->getName() === $propertyMetadata->getName()) { |
| 1686 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Version'; |
|
| 1686 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Version'; |
|
| 1687 | 1687 | } |
| 1688 | 1688 | } |
| 1689 | 1689 | |
| 1690 | - $lines[] = $this->spaces . ' */'; |
|
| 1690 | + $lines[] = $this->spaces.' */'; |
|
| 1691 | 1691 | |
| 1692 | 1692 | return implode("\n", $lines); |
| 1693 | 1693 | } |
@@ -1700,27 +1700,27 @@ discard block |
||
| 1700 | 1700 | protected function generateEmbeddedPropertyDocBlock(array $embeddedClass) |
| 1701 | 1701 | { |
| 1702 | 1702 | $lines = []; |
| 1703 | - $lines[] = $this->spaces . '/**'; |
|
| 1704 | - $lines[] = $this->spaces . ' * @var \\' . ltrim($embeddedClass['class'], '\\'); |
|
| 1703 | + $lines[] = $this->spaces.'/**'; |
|
| 1704 | + $lines[] = $this->spaces.' * @var \\'.ltrim($embeddedClass['class'], '\\'); |
|
| 1705 | 1705 | |
| 1706 | 1706 | if ($this->generateAnnotations) { |
| 1707 | - $lines[] = $this->spaces . ' *'; |
|
| 1707 | + $lines[] = $this->spaces.' *'; |
|
| 1708 | 1708 | |
| 1709 | - $embedded = ['class="' . $embeddedClass['class'] . '"']; |
|
| 1709 | + $embedded = ['class="'.$embeddedClass['class'].'"']; |
|
| 1710 | 1710 | |
| 1711 | 1711 | if (isset($embeddedClass['columnPrefix'])) { |
| 1712 | 1712 | if (is_string($embeddedClass['columnPrefix'])) { |
| 1713 | - $embedded[] = 'columnPrefix="' . $embeddedClass['columnPrefix'] . '"'; |
|
| 1713 | + $embedded[] = 'columnPrefix="'.$embeddedClass['columnPrefix'].'"'; |
|
| 1714 | 1714 | } else { |
| 1715 | - $embedded[] = 'columnPrefix=' . var_export($embeddedClass['columnPrefix'], true); |
|
| 1715 | + $embedded[] = 'columnPrefix='.var_export($embeddedClass['columnPrefix'], true); |
|
| 1716 | 1716 | } |
| 1717 | 1717 | } |
| 1718 | 1718 | |
| 1719 | - $lines[] = $this->spaces . ' * @' . |
|
| 1720 | - $this->annotationsPrefix . 'Embedded(' . implode(', ', $embedded) . ')'; |
|
| 1719 | + $lines[] = $this->spaces.' * @'. |
|
| 1720 | + $this->annotationsPrefix.'Embedded('.implode(', ', $embedded).')'; |
|
| 1721 | 1721 | } |
| 1722 | 1722 | |
| 1723 | - $lines[] = $this->spaces . ' */'; |
|
| 1723 | + $lines[] = $this->spaces.' */'; |
|
| 1724 | 1724 | |
| 1725 | 1725 | return implode("\n", $lines); |
| 1726 | 1726 | } |
@@ -1734,13 +1734,13 @@ discard block |
||
| 1734 | 1734 | $processedClasses = []; |
| 1735 | 1735 | foreach ($metadata->entityListeners as $event => $eventListeners) { |
| 1736 | 1736 | foreach ($eventListeners as $eventListener) { |
| 1737 | - $processedClasses[] = '"' . $eventListener['class'] . '"'; |
|
| 1737 | + $processedClasses[] = '"'.$eventListener['class'].'"'; |
|
| 1738 | 1738 | } |
| 1739 | 1739 | } |
| 1740 | 1740 | |
| 1741 | 1741 | return \sprintf( |
| 1742 | 1742 | '%s%s({%s})', |
| 1743 | - '@' . $this->annotationsPrefix, |
|
| 1743 | + '@'.$this->annotationsPrefix, |
|
| 1744 | 1744 | 'EntityListeners', |
| 1745 | 1745 | \implode(',', \array_unique($processedClasses)) |
| 1746 | 1746 | ); |
@@ -1758,7 +1758,7 @@ discard block |
||
| 1758 | 1758 | |
| 1759 | 1759 | foreach ($lines as $key => $value) { |
| 1760 | 1760 | if ( ! empty($value)) { |
| 1761 | - $lines[$key] = str_repeat($this->spaces, $num) . $lines[$key]; |
|
| 1761 | + $lines[$key] = str_repeat($this->spaces, $num).$lines[$key]; |
|
| 1762 | 1762 | } |
| 1763 | 1763 | } |
| 1764 | 1764 | |
@@ -1826,8 +1826,8 @@ discard block |
||
| 1826 | 1826 | |
| 1827 | 1827 | foreach ($options as $name => $option) { |
| 1828 | 1828 | $optionValue = is_array($option) |
| 1829 | - ? '{' . $this->exportTableOptions($option) . '}' |
|
| 1830 | - : '"' . (string) $option . '"' |
|
| 1829 | + ? '{'.$this->exportTableOptions($option).'}' |
|
| 1830 | + : '"'.(string) $option.'"' |
|
| 1831 | 1831 | ; |
| 1832 | 1832 | |
| 1833 | 1833 | $optionsStr[] = sprintf('"%s"=%s', $name, $optionValue); |
@@ -298,6 +298,9 @@ |
||
| 298 | 298 | $lines[] = '}'; |
| 299 | 299 | } |
| 300 | 300 | |
| 301 | + /** |
|
| 302 | + * @param string $variableName |
|
| 303 | + */ |
|
| 301 | 304 | private function exportJoinColumns(array $joinColumns, array &$lines, $variableName) |
| 302 | 305 | { |
| 303 | 306 | $lines[] = '$' . $variableName . ' = array();'; |
@@ -28,7 +28,6 @@ |
||
| 28 | 28 | use Doctrine\ORM\Mapping\ManyToOneAssociationMetadata; |
| 29 | 29 | use Doctrine\ORM\Mapping\OneToManyAssociationMetadata; |
| 30 | 30 | use Doctrine\ORM\Mapping\OneToOneAssociationMetadata; |
| 31 | -use Doctrine\ORM\Mapping\ToOneAssociationMetadata; |
|
| 32 | 31 | |
| 33 | 32 | /** |
| 34 | 33 | * ClassMetadata exporter for PHP code. |
@@ -62,11 +62,11 @@ discard block |
||
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | if ($metadata->inheritanceType) { |
| 65 | - $lines[] = '$metadata->setInheritanceType(Mapping\InheritanceType::' . $metadata->inheritanceType . ');'; |
|
| 65 | + $lines[] = '$metadata->setInheritanceType(Mapping\InheritanceType::'.$metadata->inheritanceType.');'; |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | if ($metadata->customRepositoryClassName) { |
| 69 | - $lines[] = '$metadata->customRepositoryClassName = "' . $metadata->customRepositoryClassName . '";'; |
|
| 69 | + $lines[] = '$metadata->customRepositoryClassName = "'.$metadata->customRepositoryClassName.'";'; |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | if ($metadata->table) { |
@@ -75,19 +75,19 @@ discard block |
||
| 75 | 75 | $lines[] = '$table = new Mapping\TableMetadata();'; |
| 76 | 76 | $lines[] = null; |
| 77 | 77 | |
| 78 | - if (! empty($table->getSchema())) { |
|
| 79 | - $lines[] = '$table->setSchema("' . $table->getSchema() . '");'; |
|
| 78 | + if ( ! empty($table->getSchema())) { |
|
| 79 | + $lines[] = '$table->setSchema("'.$table->getSchema().'");'; |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | - $lines[] = '$table->setName("' . $table->getName() . '");'; |
|
| 83 | - $lines[] = '$table->setOptions(' . $this->varExport($table->getOptions()) . ');'; |
|
| 82 | + $lines[] = '$table->setName("'.$table->getName().'");'; |
|
| 83 | + $lines[] = '$table->setOptions('.$this->varExport($table->getOptions()).');'; |
|
| 84 | 84 | |
| 85 | 85 | foreach ($table->getIndexes() as $index) { |
| 86 | - $lines[] = '$table->addIndex(' . $this->varExport($index) . ');'; |
|
| 86 | + $lines[] = '$table->addIndex('.$this->varExport($index).');'; |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | foreach ($table->getUniqueConstraints() as $constraint) { |
| 90 | - $lines[] = '$table->addUniqueConstraint(' . $this->varExport($constraint) . ');'; |
|
| 90 | + $lines[] = '$table->addUniqueConstraint('.$this->varExport($constraint).');'; |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | $lines[] = null; |
@@ -99,51 +99,51 @@ discard block |
||
| 99 | 99 | |
| 100 | 100 | $lines[] = '$discrColumn = new Mapping\DiscriminatorColumnMetadata();'; |
| 101 | 101 | $lines[] = null; |
| 102 | - $lines[] = '$discrColumn->setColumnName("' . $discrColumn->getColumnName() . '");'; |
|
| 103 | - $lines[] = '$discrColumn->setType(Type::getType("' . $discrColumn->getTypeName() . '"));'; |
|
| 104 | - $lines[] = '$discrColumn->setTableName("' . $discrColumn->getTableName() . '");'; |
|
| 102 | + $lines[] = '$discrColumn->setColumnName("'.$discrColumn->getColumnName().'");'; |
|
| 103 | + $lines[] = '$discrColumn->setType(Type::getType("'.$discrColumn->getTypeName().'"));'; |
|
| 104 | + $lines[] = '$discrColumn->setTableName("'.$discrColumn->getTableName().'");'; |
|
| 105 | 105 | |
| 106 | - if (! empty($discrColumn->getColumnDefinition())) { |
|
| 107 | - $lines[] = '$property->setColumnDefinition("' . $discrColumn->getColumnDefinition() . '");'; |
|
| 106 | + if ( ! empty($discrColumn->getColumnDefinition())) { |
|
| 107 | + $lines[] = '$property->setColumnDefinition("'.$discrColumn->getColumnDefinition().'");'; |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | - if (! empty($discrColumn->getLength())) { |
|
| 111 | - $lines[] = '$property->setLength(' . $discrColumn->getLength() . ');'; |
|
| 110 | + if ( ! empty($discrColumn->getLength())) { |
|
| 111 | + $lines[] = '$property->setLength('.$discrColumn->getLength().');'; |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | - if (! empty($discrColumn->getScale())) { |
|
| 115 | - $lines[] = '$property->setScale(' . $discrColumn->getScale() . ');'; |
|
| 114 | + if ( ! empty($discrColumn->getScale())) { |
|
| 115 | + $lines[] = '$property->setScale('.$discrColumn->getScale().');'; |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | - if (! empty($discrColumn->getPrecision())) { |
|
| 119 | - $lines[] = '$property->setPrecision(' . $discrColumn->getPrecision() . ');'; |
|
| 118 | + if ( ! empty($discrColumn->getPrecision())) { |
|
| 119 | + $lines[] = '$property->setPrecision('.$discrColumn->getPrecision().');'; |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | - $lines[] = '$discrColumn->setOptions(' . $this->varExport($discrColumn->getOptions()) . ');'; |
|
| 123 | - $lines[] = '$discrColumn->setNullable(' . $this->varExport($discrColumn->isNullable()) . ');'; |
|
| 124 | - $lines[] = '$discrColumn->setUnique(' . $this->varExport($discrColumn->isUnique()) . ');'; |
|
| 122 | + $lines[] = '$discrColumn->setOptions('.$this->varExport($discrColumn->getOptions()).');'; |
|
| 123 | + $lines[] = '$discrColumn->setNullable('.$this->varExport($discrColumn->isNullable()).');'; |
|
| 124 | + $lines[] = '$discrColumn->setUnique('.$this->varExport($discrColumn->isUnique()).');'; |
|
| 125 | 125 | $lines[] = null; |
| 126 | 126 | $lines[] = '$metadata->setDiscriminatorColumn($discrColumn);'; |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if ($metadata->discriminatorMap) { |
| 130 | - $lines[] = '$metadata->setDiscriminatorMap(' . $this->varExport($metadata->discriminatorMap) . ');'; |
|
| 130 | + $lines[] = '$metadata->setDiscriminatorMap('.$this->varExport($metadata->discriminatorMap).');'; |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | if ($metadata->changeTrackingPolicy) { |
| 134 | - $lines[] = '$metadata->setChangeTrackingPolicy(Mapping\ChangeTrackingPolicy::' . $metadata->changeTrackingPolicy . ');'; |
|
| 134 | + $lines[] = '$metadata->setChangeTrackingPolicy(Mapping\ChangeTrackingPolicy::'.$metadata->changeTrackingPolicy.');'; |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | if ($metadata->lifecycleCallbacks) { |
| 138 | 138 | foreach ($metadata->lifecycleCallbacks as $event => $callbacks) { |
| 139 | 139 | foreach ($callbacks as $callback) { |
| 140 | - $lines[] = '$metadata->addLifecycleCallback("' . $callback . '", "' . $event . '");'; |
|
| 140 | + $lines[] = '$metadata->addLifecycleCallback("'.$callback.'", "'.$event.'");'; |
|
| 141 | 141 | } |
| 142 | 142 | } |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | - if (! $metadata->isIdentifierComposite()) { |
|
| 146 | - $lines[] = '$metadata->setIdGeneratorType(Mapping\GeneratorType::' . $metadata->generatorType . ');'; |
|
| 145 | + if ( ! $metadata->isIdentifierComposite()) { |
|
| 146 | + $lines[] = '$metadata->setIdGeneratorType(Mapping\GeneratorType::'.$metadata->generatorType.');'; |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | foreach ($metadata->getProperties() as $property) { |
@@ -166,30 +166,30 @@ discard block |
||
| 166 | 166 | ); |
| 167 | 167 | |
| 168 | 168 | $lines[] = null; |
| 169 | - $lines[] = '$property->setColumnName("' . $property->getColumnName() . '");'; |
|
| 170 | - $lines[] = '$property->setType(Type::getType("' . $property->getTypeName() . '"));'; |
|
| 171 | - $lines[] = '$property->setTableName("' . $property->getTableName() . '");'; |
|
| 169 | + $lines[] = '$property->setColumnName("'.$property->getColumnName().'");'; |
|
| 170 | + $lines[] = '$property->setType(Type::getType("'.$property->getTypeName().'"));'; |
|
| 171 | + $lines[] = '$property->setTableName("'.$property->getTableName().'");'; |
|
| 172 | 172 | |
| 173 | - if (! empty($property->getColumnDefinition())) { |
|
| 174 | - $lines[] = '$property->setColumnDefinition("' . $property->getColumnDefinition() . '");'; |
|
| 173 | + if ( ! empty($property->getColumnDefinition())) { |
|
| 174 | + $lines[] = '$property->setColumnDefinition("'.$property->getColumnDefinition().'");'; |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | - if (! empty($property->getLength())) { |
|
| 178 | - $lines[] = '$property->setLength(' . $property->getLength() . ');'; |
|
| 177 | + if ( ! empty($property->getLength())) { |
|
| 178 | + $lines[] = '$property->setLength('.$property->getLength().');'; |
|
| 179 | 179 | } |
| 180 | 180 | |
| 181 | - if (! empty($property->getScale())) { |
|
| 182 | - $lines[] = '$property->setScale(' . $property->getScale() . ');'; |
|
| 181 | + if ( ! empty($property->getScale())) { |
|
| 182 | + $lines[] = '$property->setScale('.$property->getScale().');'; |
|
| 183 | 183 | } |
| 184 | 184 | |
| 185 | - if (! empty($property->getPrecision())) { |
|
| 186 | - $lines[] = '$property->setPrecision(' . $property->getPrecision() . ');'; |
|
| 185 | + if ( ! empty($property->getPrecision())) { |
|
| 186 | + $lines[] = '$property->setPrecision('.$property->getPrecision().');'; |
|
| 187 | 187 | } |
| 188 | 188 | |
| 189 | - $lines[] = '$property->setOptions(' . $this->varExport($property->getOptions()) . ');'; |
|
| 190 | - $lines[] = '$property->setPrimaryKey(' . $this->varExport($property->isPrimaryKey()) . ');'; |
|
| 191 | - $lines[] = '$property->setNullable(' . $this->varExport($property->isNullable()) . ');'; |
|
| 192 | - $lines[] = '$property->setUnique(' . $this->varExport($property->isUnique()) . ');'; |
|
| 189 | + $lines[] = '$property->setOptions('.$this->varExport($property->getOptions()).');'; |
|
| 190 | + $lines[] = '$property->setPrimaryKey('.$this->varExport($property->isPrimaryKey()).');'; |
|
| 191 | + $lines[] = '$property->setNullable('.$this->varExport($property->isNullable()).');'; |
|
| 192 | + $lines[] = '$property->setUnique('.$this->varExport($property->isUnique()).');'; |
|
| 193 | 193 | $lines[] = null; |
| 194 | 194 | $lines[] = '$metadata->addProperty($property);'; |
| 195 | 195 | } |
@@ -211,25 +211,25 @@ discard block |
||
| 211 | 211 | if ($association instanceof OneToOneAssociationMetadata) { |
| 212 | 212 | $this->exportJoinColumns($association->getJoinColumns(), $lines, 'joinColumns'); |
| 213 | 213 | |
| 214 | - $lines[] = '$association = new Mapping\OneToOneAssociationMetadata("' . $association->getName() . '");'; |
|
| 214 | + $lines[] = '$association = new Mapping\OneToOneAssociationMetadata("'.$association->getName().'");'; |
|
| 215 | 215 | $lines[] = null; |
| 216 | 216 | $lines[] = '$association->setJoinColumns($joinColumns);'; |
| 217 | 217 | } else if ($association instanceof ManyToOneAssociationMetadata) { |
| 218 | 218 | $this->exportJoinColumns($association->getJoinColumns(), $lines, 'joinColumns'); |
| 219 | 219 | |
| 220 | - $lines[] = '$association = new Mapping\ManyToOneAssociationMetadata("' . $association->getName() . '");'; |
|
| 220 | + $lines[] = '$association = new Mapping\ManyToOneAssociationMetadata("'.$association->getName().'");'; |
|
| 221 | 221 | $lines[] = null; |
| 222 | 222 | $lines[] = '$association->setJoinColumns($joinColumns);'; |
| 223 | 223 | } else if ($association instanceof OneToManyAssociationMetadata) { |
| 224 | - $lines[] = '$association = new Mapping\OneToManyAssociationMetadata("' . $association->getName() . '");'; |
|
| 224 | + $lines[] = '$association = new Mapping\OneToManyAssociationMetadata("'.$association->getName().'");'; |
|
| 225 | 225 | $lines[] = null; |
| 226 | - $lines[] = '$association->setOrderBy(' . $this->varExport($association->getOrderBy()) . ');'; |
|
| 226 | + $lines[] = '$association->setOrderBy('.$this->varExport($association->getOrderBy()).');'; |
|
| 227 | 227 | } else if ($association instanceof ManyToManyAssociationMetadata) { |
| 228 | 228 | if ($association->getJoinTable()) { |
| 229 | 229 | $this->exportJoinTable($association->getJoinTable(), $lines); |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | - $lines[] = '$association = new Mapping\ManyToManyAssociationMetadata("' . $association->getName() . '");'; |
|
| 232 | + $lines[] = '$association = new Mapping\ManyToManyAssociationMetadata("'.$association->getName().'");'; |
|
| 233 | 233 | $lines[] = null; |
| 234 | 234 | |
| 235 | 235 | if ($association->getJoinTable()) { |
@@ -237,26 +237,26 @@ discard block |
||
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | if ($association->getIndexedBy()) { |
| 240 | - $lines[] = '$association->setIndexedBy("' . $association->getIndexedBy() . '");'; |
|
| 240 | + $lines[] = '$association->setIndexedBy("'.$association->getIndexedBy().'");'; |
|
| 241 | 241 | } |
| 242 | 242 | |
| 243 | - $lines[] = '$association->setOrderBy(' . $this->varExport($association->getOrderBy()) . ');'; |
|
| 243 | + $lines[] = '$association->setOrderBy('.$this->varExport($association->getOrderBy()).');'; |
|
| 244 | 244 | } |
| 245 | 245 | |
| 246 | - $lines[] = '$association->setTargetEntity("' . $association->getTargetEntity() . '");'; |
|
| 247 | - $lines[] = '$association->setFetchMode("' . $association->getFetchMode() . '");'; |
|
| 246 | + $lines[] = '$association->setTargetEntity("'.$association->getTargetEntity().'");'; |
|
| 247 | + $lines[] = '$association->setFetchMode("'.$association->getFetchMode().'");'; |
|
| 248 | 248 | |
| 249 | 249 | if ($association->getMappedBy()) { |
| 250 | - $lines[] = '$association->setMappedBy("' . $association->getMappedBy() . '");'; |
|
| 250 | + $lines[] = '$association->setMappedBy("'.$association->getMappedBy().'");'; |
|
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | if ($association->getInversedBy()) { |
| 254 | - $lines[] = '$association->setInversedBy("' . $association->getInversedBy() . '");'; |
|
| 254 | + $lines[] = '$association->setInversedBy("'.$association->getInversedBy().'");'; |
|
| 255 | 255 | } |
| 256 | 256 | |
| 257 | - $lines[] = '$association->setCascade(' . $this->varExport($cascade) . ');'; |
|
| 258 | - $lines[] = '$association->setOrphanRemoval(' . $this->varExport($association->isOrphanRemoval()) . ');'; |
|
| 259 | - $lines[] = '$association->setPrimaryKey(' . $this->varExport($association->isPrimaryKey()) . ');'; |
|
| 257 | + $lines[] = '$association->setCascade('.$this->varExport($cascade).');'; |
|
| 258 | + $lines[] = '$association->setOrphanRemoval('.$this->varExport($association->isOrphanRemoval()).');'; |
|
| 259 | + $lines[] = '$association->setPrimaryKey('.$this->varExport($association->isPrimaryKey()).');'; |
|
| 260 | 260 | $lines[] = null; |
| 261 | 261 | $lines[] = '$metadata->addProperty($association);'; |
| 262 | 262 | } |
@@ -266,13 +266,13 @@ discard block |
||
| 266 | 266 | $lines[] = null; |
| 267 | 267 | $lines[] = '$joinTable = new Mapping\JoinTableMetadata();'; |
| 268 | 268 | $lines[] = null; |
| 269 | - $lines[] = '$joinTable->setName("' . $joinTable->getName() . '");'; |
|
| 269 | + $lines[] = '$joinTable->setName("'.$joinTable->getName().'");'; |
|
| 270 | 270 | |
| 271 | - if (! empty($joinTable->getSchema())) { |
|
| 272 | - $lines[] = '$joinTable->setSchema("' . $joinTable->getSchema() . '");'; |
|
| 271 | + if ( ! empty($joinTable->getSchema())) { |
|
| 272 | + $lines[] = '$joinTable->setSchema("'.$joinTable->getSchema().'");'; |
|
| 273 | 273 | } |
| 274 | 274 | |
| 275 | - $lines[] = '$joinTable->setOptions(' . $this->varExport($joinTable->getOptions()) . ');'; |
|
| 275 | + $lines[] = '$joinTable->setOptions('.$this->varExport($joinTable->getOptions()).');'; |
|
| 276 | 276 | |
| 277 | 277 | $this->exportJoinColumns($joinTable->getJoinColumns(), $lines, 'joinColumns'); |
| 278 | 278 | |
@@ -292,24 +292,24 @@ discard block |
||
| 292 | 292 | |
| 293 | 293 | private function exportJoinColumns(array $joinColumns, array &$lines, $variableName) |
| 294 | 294 | { |
| 295 | - $lines[] = '$' . $variableName . ' = array();'; |
|
| 295 | + $lines[] = '$'.$variableName.' = array();'; |
|
| 296 | 296 | |
| 297 | 297 | foreach ($joinColumns as $joinColumn) { |
| 298 | 298 | /** @var JoinColumnMetadata $joinColumn */ |
| 299 | 299 | $lines[] = '$joinColumn = new Mapping\JoinColumnMetadata();'; |
| 300 | 300 | $lines[] = null; |
| 301 | - $lines[] = '$joinColumn->setTableName("' . $joinColumn->getTableName() . '");'; |
|
| 302 | - $lines[] = '$joinColumn->setColumnName("' . $joinColumn->getColumnName() . '");'; |
|
| 303 | - $lines[] = '$joinColumn->setReferencedColumnName("' . $joinColumn->getReferencedColumnName() . '");'; |
|
| 304 | - $lines[] = '$joinColumn->setAliasedName("' . $joinColumn->getAliasedName() . '");'; |
|
| 305 | - $lines[] = '$joinColumn->setColumnDefinition("' . $joinColumn->getColumnDefinition() . '");'; |
|
| 306 | - $lines[] = '$joinColumn->setOnDelete("' . $joinColumn->getOnDelete() . '");'; |
|
| 307 | - $lines[] = '$joinColumn->setOptions(' . $this->varExport($joinColumn->getOptions()) . ');'; |
|
| 308 | - $lines[] = '$joinColumn->setNullable("' . $joinColumn->isNullable() . '");'; |
|
| 309 | - $lines[] = '$joinColumn->setUnique("' . $joinColumn->isUnique() . '");'; |
|
| 310 | - $lines[] = '$joinColumn->setPrimaryKey("' . $joinColumn->isPrimaryKey() . '");'; |
|
| 301 | + $lines[] = '$joinColumn->setTableName("'.$joinColumn->getTableName().'");'; |
|
| 302 | + $lines[] = '$joinColumn->setColumnName("'.$joinColumn->getColumnName().'");'; |
|
| 303 | + $lines[] = '$joinColumn->setReferencedColumnName("'.$joinColumn->getReferencedColumnName().'");'; |
|
| 304 | + $lines[] = '$joinColumn->setAliasedName("'.$joinColumn->getAliasedName().'");'; |
|
| 305 | + $lines[] = '$joinColumn->setColumnDefinition("'.$joinColumn->getColumnDefinition().'");'; |
|
| 306 | + $lines[] = '$joinColumn->setOnDelete("'.$joinColumn->getOnDelete().'");'; |
|
| 307 | + $lines[] = '$joinColumn->setOptions('.$this->varExport($joinColumn->getOptions()).');'; |
|
| 308 | + $lines[] = '$joinColumn->setNullable("'.$joinColumn->isNullable().'");'; |
|
| 309 | + $lines[] = '$joinColumn->setUnique("'.$joinColumn->isUnique().'");'; |
|
| 310 | + $lines[] = '$joinColumn->setPrimaryKey("'.$joinColumn->isPrimaryKey().'");'; |
|
| 311 | 311 | $lines[] = null; |
| 312 | - $lines[] = '$' . $variableName . '[] = $joinColumn;'; |
|
| 312 | + $lines[] = '$'.$variableName.'[] = $joinColumn;'; |
|
| 313 | 313 | } |
| 314 | 314 | } |
| 315 | 315 | |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | protected function varExport($var) |
| 322 | 322 | { |
| 323 | 323 | $export = var_export($var, true); |
| 324 | - $export = str_replace("\n", PHP_EOL . str_repeat(' ', 8), $export); |
|
| 324 | + $export = str_replace("\n", PHP_EOL.str_repeat(' ', 8), $export); |
|
| 325 | 325 | $export = str_replace(' ', ' ', $export); |
| 326 | 326 | $export = str_replace('array (', 'array(', $export); |
| 327 | 327 | $export = str_replace('array( ', 'array(', $export); |
@@ -21,9 +21,7 @@ |
||
| 21 | 21 | |
| 22 | 22 | namespace Doctrine\ORM\Tools\Pagination; |
| 23 | 23 | |
| 24 | -use Doctrine\DBAL\Types\Type; |
|
| 25 | 24 | use Doctrine\ORM\Mapping\AssociationMetadata; |
| 26 | -use Doctrine\ORM\Mapping\ClassMetadata; |
|
| 27 | 25 | use Doctrine\ORM\Mapping\ToManyAssociationMetadata; |
| 28 | 26 | use Doctrine\ORM\Query; |
| 29 | 27 | use Doctrine\ORM\Query\TreeWalkerAdapter; |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM\Tools\Pagination; |
| 6 | 6 | |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | if ($property instanceof AssociationMetadata) { |
| 74 | 74 | throw new \RuntimeException( |
| 75 | - "Paginating an entity with foreign key as identifier only works when using the Output Walkers. " . |
|
| 75 | + "Paginating an entity with foreign key as identifier only works when using the Output Walkers. ". |
|
| 76 | 76 | "Call Paginator#setUseOutputWalkers(true) before iterating the paginator." |
| 77 | 77 | ); |
| 78 | 78 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | |
| 100 | 100 | $AST->selectClause->selectExpressions[] = new SelectExpression( |
| 101 | 101 | $this->createSelectExpressionItem($item->expression), |
| 102 | - '_dctrn_ord' . $this->aliasCounter++ |
|
| 102 | + '_dctrn_ord'.$this->aliasCounter++ |
|
| 103 | 103 | ); |
| 104 | 104 | } |
| 105 | 105 | } |
@@ -29,7 +29,6 @@ |
||
| 29 | 29 | use Doctrine\ORM\Mapping\FieldMetadata; |
| 30 | 30 | use Doctrine\ORM\Mapping\ManyToManyAssociationMetadata; |
| 31 | 31 | use Doctrine\ORM\Mapping\ToOneAssociationMetadata; |
| 32 | -use Doctrine\ORM\Query\QueryException; |
|
| 33 | 32 | |
| 34 | 33 | /** |
| 35 | 34 | * The PersisterHelper contains logic to infer binding types which is used in |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | |
| 4 | -declare(strict_types=1); |
|
| 4 | +declare(strict_types = 1); |
|
| 5 | 5 | |
| 6 | 6 | namespace Doctrine\ORM\Utility; |
| 7 | 7 | |
@@ -62,14 +62,14 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | // iterate over association mappings |
| 64 | 64 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
| 65 | - if (! ($association instanceof AssociationMetadata)) { |
|
| 65 | + if ( ! ($association instanceof AssociationMetadata)) { |
|
| 66 | 66 | continue; |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | // resolve join columns over to-one or to-many |
| 70 | 70 | $targetClass = $em->getClassMetadata($association->getTargetEntity()); |
| 71 | 71 | |
| 72 | - if (! $association->isOwningSide()) { |
|
| 72 | + if ( ! $association->isOwningSide()) { |
|
| 73 | 73 | $association = $targetClass->getProperty($association->getMappedBy()); |
| 74 | 74 | $targetClass = $em->getClassMetadata($association->getTargetEntity()); |
| 75 | 75 | } |