@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | $metadata = $this->em->getClassMetadata($className); |
56 | 56 | $persister = $this->uow->getEntityPersister($metadata->getRootClassName()); |
57 | 57 | |
58 | - if (! ($persister instanceof CachedPersister)) { |
|
58 | + if ( ! ($persister instanceof CachedPersister)) { |
|
59 | 59 | return null; |
60 | 60 | } |
61 | 61 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $metadata = $this->em->getClassMetadata($className); |
71 | 71 | $persister = $this->uow->getCollectionPersister($metadata->getProperty($association)); |
72 | 72 | |
73 | - if (! ($persister instanceof CachedPersister)) { |
|
73 | + if ( ! ($persister instanceof CachedPersister)) { |
|
74 | 74 | return null; |
75 | 75 | } |
76 | 76 | |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | $metadata = $this->em->getClassMetadata($className); |
86 | 86 | $persister = $this->uow->getEntityPersister($metadata->getRootClassName()); |
87 | 87 | |
88 | - if (! ($persister instanceof CachedPersister)) { |
|
88 | + if ( ! ($persister instanceof CachedPersister)) { |
|
89 | 89 | return false; |
90 | 90 | } |
91 | 91 | |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | $metadata = $this->em->getClassMetadata($className); |
101 | 101 | $persister = $this->uow->getEntityPersister($metadata->getRootClassName()); |
102 | 102 | |
103 | - if (! ($persister instanceof CachedPersister)) { |
|
103 | + if ( ! ($persister instanceof CachedPersister)) { |
|
104 | 104 | return; |
105 | 105 | } |
106 | 106 | |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | $metadata = $this->em->getClassMetadata($className); |
116 | 116 | $persister = $this->uow->getEntityPersister($metadata->getRootClassName()); |
117 | 117 | |
118 | - if (! ($persister instanceof CachedPersister)) { |
|
118 | + if ( ! ($persister instanceof CachedPersister)) { |
|
119 | 119 | return; |
120 | 120 | } |
121 | 121 | |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | foreach ($metadatas as $metadata) { |
133 | 133 | $persister = $this->uow->getEntityPersister($metadata->getRootClassName()); |
134 | 134 | |
135 | - if (! ($persister instanceof CachedPersister)) { |
|
135 | + if ( ! ($persister instanceof CachedPersister)) { |
|
136 | 136 | continue; |
137 | 137 | } |
138 | 138 | |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | $metadata = $this->em->getClassMetadata($className); |
149 | 149 | $persister = $this->uow->getCollectionPersister($metadata->getProperty($association)); |
150 | 150 | |
151 | - if (! ($persister instanceof CachedPersister)) { |
|
151 | + if ( ! ($persister instanceof CachedPersister)) { |
|
152 | 152 | return false; |
153 | 153 | } |
154 | 154 | |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | $metadata = $this->em->getClassMetadata($className); |
164 | 164 | $persister = $this->uow->getCollectionPersister($metadata->getProperty($association)); |
165 | 165 | |
166 | - if (! ($persister instanceof CachedPersister)) { |
|
166 | + if ( ! ($persister instanceof CachedPersister)) { |
|
167 | 167 | return; |
168 | 168 | } |
169 | 169 | |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | $metadata = $this->em->getClassMetadata($className); |
179 | 179 | $persister = $this->uow->getCollectionPersister($metadata->getProperty($association)); |
180 | 180 | |
181 | - if (! ($persister instanceof CachedPersister)) { |
|
181 | + if ( ! ($persister instanceof CachedPersister)) { |
|
182 | 182 | return; |
183 | 183 | } |
184 | 184 | |
@@ -194,13 +194,13 @@ discard block |
||
194 | 194 | |
195 | 195 | foreach ($metadatas as $metadata) { |
196 | 196 | foreach ($metadata->getPropertiesIterator() as $association) { |
197 | - if (! $association instanceof ToManyAssociationMetadata) { |
|
197 | + if ( ! $association instanceof ToManyAssociationMetadata) { |
|
198 | 198 | continue; |
199 | 199 | } |
200 | 200 | |
201 | 201 | $persister = $this->uow->getCollectionPersister($association); |
202 | 202 | |
203 | - if (! ($persister instanceof CachedPersister)) { |
|
203 | + if ( ! ($persister instanceof CachedPersister)) { |
|
204 | 204 | continue; |
205 | 205 | } |
206 | 206 | |
@@ -251,11 +251,10 @@ discard block |
||
251 | 251 | public function getQueryCache($regionName = null) |
252 | 252 | { |
253 | 253 | if ($regionName === null) { |
254 | - return $this->defaultQueryCache ?: |
|
255 | - $this->defaultQueryCache = $this->cacheFactory->buildQueryCache($this->em); |
|
254 | + return $this->defaultQueryCache ?: $this->defaultQueryCache = $this->cacheFactory->buildQueryCache($this->em); |
|
256 | 255 | } |
257 | 256 | |
258 | - if (! isset($this->queryCaches[$regionName])) { |
|
257 | + if ( ! isset($this->queryCaches[$regionName])) { |
|
259 | 258 | $this->queryCaches[$regionName] = $this->cacheFactory->buildQueryCache($this->em, $regionName); |
260 | 259 | } |
261 | 260 | |
@@ -270,7 +269,7 @@ discard block |
||
270 | 269 | */ |
271 | 270 | private function buildEntityCacheKey(ClassMetadata $metadata, $identifier) |
272 | 271 | { |
273 | - if (! is_array($identifier)) { |
|
272 | + if ( ! is_array($identifier)) { |
|
274 | 273 | $identifier = $this->toIdentifierArray($metadata, $identifier); |
275 | 274 | } |
276 | 275 | |
@@ -286,7 +285,7 @@ discard block |
||
286 | 285 | */ |
287 | 286 | private function buildCollectionCacheKey(ClassMetadata $metadata, $association, $ownerIdentifier) |
288 | 287 | { |
289 | - if (! is_array($ownerIdentifier)) { |
|
288 | + if ( ! is_array($ownerIdentifier)) { |
|
290 | 289 | $ownerIdentifier = $this->toIdentifierArray($metadata, $ownerIdentifier); |
291 | 290 | } |
292 | 291 |
@@ -54,11 +54,11 @@ discard block |
||
54 | 54 | } |
55 | 55 | |
56 | 56 | foreach ($metadata->getPropertiesIterator() as $name => $association) { |
57 | - if (! isset($data[$name]) || $association instanceof FieldMetadata) { |
|
57 | + if ( ! isset($data[$name]) || $association instanceof FieldMetadata) { |
|
58 | 58 | continue; |
59 | 59 | } |
60 | 60 | |
61 | - if (! $association instanceof ToOneAssociationMetadata) { |
|
61 | + if ( ! $association instanceof ToOneAssociationMetadata) { |
|
62 | 62 | unset($data[$name]); |
63 | 63 | |
64 | 64 | continue; |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $targetClassMetadata = $this->em->getClassMetadata($targetEntity); |
69 | 69 | $targetPersister = $this->uow->getEntityPersister($targetEntity); |
70 | 70 | |
71 | - if (! $association->getCache()) { |
|
71 | + if ( ! $association->getCache()) { |
|
72 | 72 | $owningAssociation = ! $association->isOwningSide() |
73 | 73 | ? $targetClassMetadata->getProperty($association->getMappedBy()) |
74 | 74 | : $association; |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | continue; |
117 | 117 | } |
118 | 118 | |
119 | - if (! $association->isPrimaryKey()) { |
|
119 | + if ( ! $association->isPrimaryKey()) { |
|
120 | 120 | $targetClass = StaticClassNameConverter::getClass($data[$name]); |
121 | 121 | $targetId = $this->uow->getEntityIdentifier($data[$name]); |
122 | 122 | $data[$name] = new AssociationCacheEntry($targetClass, $targetId); |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | ($association instanceof OneToOneAssociationMetadata && ! $association->isOwningSide()) |
166 | 166 | ); |
167 | 167 | |
168 | - if (! $isEagerLoad) { |
|
168 | + if ( ! $isEagerLoad) { |
|
169 | 169 | $data[$name] = $this->em->getReference($assocClass, $assocId); |
170 | 170 | |
171 | 171 | continue; |
@@ -82,11 +82,11 @@ discard block |
||
82 | 82 | $joinTableMetadata->setName($namingStrategy->joinTableName($souceEntity, $this->targetEntity, $this->fieldName)); |
83 | 83 | |
84 | 84 | if ($this->joinTableAnnotation !== null) { |
85 | - if (! empty($this->joinTableAnnotation->name)) { |
|
85 | + if ( ! empty($this->joinTableAnnotation->name)) { |
|
86 | 86 | $joinTableMetadata->setName($this->joinTableAnnotation->name); |
87 | 87 | } |
88 | 88 | |
89 | - if (! empty($this->joinTableAnnotation->schema)) { |
|
89 | + if ( ! empty($this->joinTableAnnotation->schema)) { |
|
90 | 90 | $joinTableMetadata->setSchema($this->joinTableAnnotation->schema); |
91 | 91 | } |
92 | 92 | |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | |
123 | 123 | $selfReferenceEntity = $souceEntity === $this->targetEntity; |
124 | 124 | |
125 | - if (! $joinTableMetadata->getJoinColumns()) { |
|
125 | + if ( ! $joinTableMetadata->getJoinColumns()) { |
|
126 | 126 | $joinColumnAnnotation = new Annotation\JoinColumn(); |
127 | 127 | |
128 | 128 | $joinColumnAnnotation->onDelete = 'CASCADE'; |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | $joinTableMetadata->addJoinColumn($this->joinColumnMetadataBuilder->build()); |
138 | 138 | } |
139 | 139 | |
140 | - if (! $joinTableMetadata->getInverseJoinColumns()) { |
|
140 | + if ( ! $joinTableMetadata->getInverseJoinColumns()) { |
|
141 | 141 | $joinColumnAnnotation = new Annotation\JoinColumn(); |
142 | 142 | |
143 | 143 | $joinColumnAnnotation->onDelete = 'CASCADE'; |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $namingStrategy = $this->metadataBuildingContext->getNamingStrategy(); |
60 | 60 | $joinColumnMetadata = new Mapping\JoinColumnMetadata(); |
61 | 61 | |
62 | - if (! $this->componentMetadata->isMappedSuperclass) { |
|
62 | + if ( ! $this->componentMetadata->isMappedSuperclass) { |
|
63 | 63 | $joinColumnMetadata->setTableName($this->componentMetadata->getTableName()); |
64 | 64 | } |
65 | 65 | |
@@ -73,19 +73,19 @@ discard block |
||
73 | 73 | $joinColumnMetadata->setNullable($this->joinColumnAnnotation->nullable); |
74 | 74 | $joinColumnMetadata->setUnique($this->joinColumnAnnotation->unique); |
75 | 75 | |
76 | - if (! empty($this->joinColumnAnnotation->name)) { |
|
76 | + if ( ! empty($this->joinColumnAnnotation->name)) { |
|
77 | 77 | $joinColumnMetadata->setColumnName($this->joinColumnAnnotation->name); |
78 | 78 | } |
79 | 79 | |
80 | - if (! empty($this->joinColumnAnnotation->referencedColumnName)) { |
|
80 | + if ( ! empty($this->joinColumnAnnotation->referencedColumnName)) { |
|
81 | 81 | $joinColumnMetadata->setReferencedColumnName($this->joinColumnAnnotation->referencedColumnName); |
82 | 82 | } |
83 | 83 | |
84 | - if (! empty($this->joinColumnAnnotation->fieldName)) { |
|
84 | + if ( ! empty($this->joinColumnAnnotation->fieldName)) { |
|
85 | 85 | $joinColumnMetadata->setAliasedName($this->joinColumnAnnotation->fieldName); |
86 | 86 | } |
87 | 87 | |
88 | - if (! empty($this->joinColumnAnnotation->columnDefinition)) { |
|
88 | + if ( ! empty($this->joinColumnAnnotation->columnDefinition)) { |
|
89 | 89 | $joinColumnMetadata->setColumnDefinition($this->joinColumnAnnotation->columnDefinition); |
90 | 90 | } |
91 | 91 |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | break; |
123 | 123 | |
124 | 124 | default: |
125 | - if (! isset($fieldOptions['default'])) { |
|
125 | + if ( ! isset($fieldOptions['default'])) { |
|
126 | 126 | throw Mapping\MappingException::unsupportedOptimisticLockingType($fieldType); |
127 | 127 | } |
128 | 128 | |
@@ -145,15 +145,15 @@ discard block |
||
145 | 145 | $fieldMetadata->setNullable($this->columnAnnotation->nullable); |
146 | 146 | $fieldMetadata->setUnique($this->columnAnnotation->unique); |
147 | 147 | |
148 | - if (! $this->componentMetadata->isMappedSuperclass) { |
|
148 | + if ( ! $this->componentMetadata->isMappedSuperclass) { |
|
149 | 149 | $fieldMetadata->setTableName($this->componentMetadata->getTableName()); |
150 | 150 | } |
151 | 151 | |
152 | - if (! empty($this->columnAnnotation->columnDefinition)) { |
|
152 | + if ( ! empty($this->columnAnnotation->columnDefinition)) { |
|
153 | 153 | $fieldMetadata->setColumnDefinition($this->columnAnnotation->columnDefinition); |
154 | 154 | } |
155 | 155 | |
156 | - if (! empty($this->columnAnnotation->length)) { |
|
156 | + if ( ! empty($this->columnAnnotation->length)) { |
|
157 | 157 | $fieldMetadata->setLength($this->columnAnnotation->length); |
158 | 158 | } |
159 | 159 |
@@ -99,7 +99,7 @@ |
||
99 | 99 | assert($this->fieldName !== null); |
100 | 100 | assert($this->fieldType !== null); |
101 | 101 | |
102 | - if (! $this->generatedValueAnnotation) { |
|
102 | + if ( ! $this->generatedValueAnnotation) { |
|
103 | 103 | return null; |
104 | 104 | } |
105 | 105 |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | */ |
131 | 131 | public function isTransient($className) : bool |
132 | 132 | { |
133 | - if (! $this->initialized) { |
|
133 | + if ( ! $this->initialized) { |
|
134 | 134 | $this->initialize(); |
135 | 135 | } |
136 | 136 | |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | */ |
179 | 179 | public function getAllMetadata() : array |
180 | 180 | { |
181 | - if (! $this->initialized) { |
|
181 | + if ( ! $this->initialized) { |
|
182 | 182 | $this->initialize(); |
183 | 183 | } |
184 | 184 | |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | |
215 | 215 | public function getTargetPlatform() : Platforms\AbstractPlatform |
216 | 216 | { |
217 | - if (! $this->targetPlatform) { |
|
217 | + if ( ! $this->targetPlatform) { |
|
218 | 218 | $this->targetPlatform = $this->em->getConnection()->getDatabasePlatform(); |
219 | 219 | } |
220 | 220 | |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | |
257 | 257 | try { |
258 | 258 | if ($this->cacheDriver) { |
259 | - $cached = $this->cacheDriver->fetch($entityClassName . $this->cacheSalt); |
|
259 | + $cached = $this->cacheDriver->fetch($entityClassName.$this->cacheSalt); |
|
260 | 260 | |
261 | 261 | if ($cached instanceof ClassMetadata) { |
262 | 262 | $this->loadedMetadata[$entityClassName] = $cached; |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | foreach ($this->loadMetadata($entityClassName, $metadataBuildingContext) as $loadedClass) { |
267 | 267 | $loadedClassName = $loadedClass->getClassName(); |
268 | 268 | |
269 | - $this->cacheDriver->save($loadedClassName . $this->cacheSalt, $loadedClass, null); |
|
269 | + $this->cacheDriver->save($loadedClassName.$this->cacheSalt, $loadedClass, null); |
|
270 | 270 | } |
271 | 271 | } |
272 | 272 | } else { |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | } catch (PersistenceMappingException $loadingException) { |
276 | 276 | $fallbackMetadataResponse = $this->onNotFoundMetadata($entityClassName, $metadataBuildingContext); |
277 | 277 | |
278 | - if (! $fallbackMetadataResponse) { |
|
278 | + if ( ! $fallbackMetadataResponse) { |
|
279 | 279 | throw $loadingException; |
280 | 280 | } |
281 | 281 | |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | */ |
312 | 312 | protected function loadMetadata(string $name, ClassMetadataBuildingContext $metadataBuildingContext) : array |
313 | 313 | { |
314 | - if (! $this->initialized) { |
|
314 | + if ( ! $this->initialized) { |
|
315 | 315 | $this->initialize(); |
316 | 316 | } |
317 | 317 | |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | $parentClasses = []; |
358 | 358 | |
359 | 359 | foreach (array_reverse($this->getReflectionService()->getParentClasses($name)) as $parentClass) { |
360 | - if (! $this->getDriver()->isTransient($parentClass)) { |
|
360 | + if ( ! $this->getDriver()->isTransient($parentClass)) { |
|
361 | 361 | $parentClasses[] = $parentClass; |
362 | 362 | } |
363 | 363 | } |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | string $className, |
373 | 373 | ClassMetadataBuildingContext $metadataBuildingContext |
374 | 374 | ) : ?ClassMetadata { |
375 | - if (! $this->evm->hasListeners(Events::onClassMetadataNotFound)) { |
|
375 | + if ( ! $this->evm->hasListeners(Events::onClassMetadataNotFound)) { |
|
376 | 376 | return null; |
377 | 377 | } |
378 | 378 | |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | */ |
417 | 417 | protected function validateRuntimeMetadata(ClassMetadata $class, ?ClassMetadata $parent = null) : void |
418 | 418 | { |
419 | - if (! $class->getReflectionClass()) { |
|
419 | + if ( ! $class->getReflectionClass()) { |
|
420 | 420 | // only validate if there is a reflection class instance |
421 | 421 | return; |
422 | 422 | } |
@@ -426,13 +426,13 @@ discard block |
||
426 | 426 | $class->validateLifecycleCallbacks($this->getReflectionService()); |
427 | 427 | |
428 | 428 | // verify inheritance |
429 | - if (! $class->isMappedSuperclass && $class->inheritanceType !== InheritanceType::NONE) { |
|
430 | - if (! $parent) { |
|
431 | - if (! $class->discriminatorMap) { |
|
429 | + if ( ! $class->isMappedSuperclass && $class->inheritanceType !== InheritanceType::NONE) { |
|
430 | + if ( ! $parent) { |
|
431 | + if ( ! $class->discriminatorMap) { |
|
432 | 432 | throw MappingException::missingDiscriminatorMap($class->getClassName()); |
433 | 433 | } |
434 | 434 | |
435 | - if (! $class->discriminatorColumn) { |
|
435 | + if ( ! $class->discriminatorColumn) { |
|
436 | 436 | throw MappingException::missingDiscriminatorColumn($class->getClassName()); |
437 | 437 | } |
438 | 438 | } |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | */ |
24 | 24 | public static function pathRequired() |
25 | 25 | { |
26 | - return new self('Specifying the paths to your entities is required ' . |
|
26 | + return new self('Specifying the paths to your entities is required '. |
|
27 | 27 | 'in the AnnotationDriver to retrieve all class names.'); |
28 | 28 | } |
29 | 29 | |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | */ |
214 | 214 | public static function missingQueryMapping($entity, $queryName) |
215 | 215 | { |
216 | - return new self('Query named "' . $queryName . '" in "' . $entity . ' requires a result class or result set mapping.'); |
|
216 | + return new self('Query named "'.$queryName.'" in "'.$entity.' requires a result class or result set mapping.'); |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | /** |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | */ |
225 | 225 | public static function missingResultSetMappingEntity($entity, $resultName) |
226 | 226 | { |
227 | - return new self('Result set mapping named "' . $resultName . '" in "' . $entity . ' requires a entity class name.'); |
|
227 | + return new self('Result set mapping named "'.$resultName.'" in "'.$entity.' requires a entity class name.'); |
|
228 | 228 | } |
229 | 229 | |
230 | 230 | /** |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | */ |
236 | 236 | public static function missingResultSetMappingFieldName($entity, $resultName) |
237 | 237 | { |
238 | - return new self('Result set mapping named "' . $resultName . '" in "' . $entity . ' requires a field name.'); |
|
238 | + return new self('Result set mapping named "'.$resultName.'" in "'.$entity.' requires a field name.'); |
|
239 | 239 | } |
240 | 240 | |
241 | 241 | /** |
@@ -282,8 +282,8 @@ discard block |
||
282 | 282 | { |
283 | 283 | $message = sprintf("The mapping of field '%s' is invalid: The option '%s' is required.", $field, $expectedOption); |
284 | 284 | |
285 | - if (! empty($hint)) { |
|
286 | - $message .= ' (Hint: ' . $hint . ')'; |
|
285 | + if ( ! empty($hint)) { |
|
286 | + $message .= ' (Hint: '.$hint.')'; |
|
287 | 287 | } |
288 | 288 | |
289 | 289 | return new self($message); |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | */ |
313 | 313 | public static function reflectionFailure($entity, ReflectionException $previousException) |
314 | 314 | { |
315 | - return new self('An error occurred in ' . $entity, 0, $previousException); |
|
315 | + return new self('An error occurred in '.$entity, 0, $previousException); |
|
316 | 316 | } |
317 | 317 | |
318 | 318 | /** |
@@ -323,8 +323,8 @@ discard block |
||
323 | 323 | */ |
324 | 324 | public static function joinColumnMustPointToMappedField($className, $joinColumn) |
325 | 325 | { |
326 | - return new self('The column ' . $joinColumn . ' must be mapped to a field in class ' |
|
327 | - . $className . ' since it is referenced by a join column of another class.'); |
|
326 | + return new self('The column '.$joinColumn.' must be mapped to a field in class ' |
|
327 | + . $className.' since it is referenced by a join column of another class.'); |
|
328 | 328 | } |
329 | 329 | |
330 | 330 | /** |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | */ |
359 | 359 | public static function propertyTypeIsRequired($className, $propertyName) |
360 | 360 | { |
361 | - return new self("The attribute 'type' is required for the column description of property " . $className . '::$' . $propertyName . '.'); |
|
361 | + return new self("The attribute 'type' is required for the column description of property ".$className.'::$'.$propertyName.'.'); |
|
362 | 362 | } |
363 | 363 | |
364 | 364 | /** |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | */ |
385 | 385 | public static function duplicateQueryMapping($entity, $queryName) |
386 | 386 | { |
387 | - return new self('Query named "' . $queryName . '" in "' . $entity . '" was already declared, but it must be declared only once'); |
|
387 | + return new self('Query named "'.$queryName.'" in "'.$entity.'" was already declared, but it must be declared only once'); |
|
388 | 388 | } |
389 | 389 | |
390 | 390 | /** |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | */ |
396 | 396 | public static function duplicateResultSetMapping($entity, $resultName) |
397 | 397 | { |
398 | - return new self('Result set mapping named "' . $resultName . '" in "' . $entity . '" was already declared, but it must be declared only once'); |
|
398 | + return new self('Result set mapping named "'.$resultName.'" in "'.$entity.'" was already declared, but it must be declared only once'); |
|
399 | 399 | } |
400 | 400 | |
401 | 401 | /** |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | */ |
406 | 406 | public static function singleIdNotAllowedOnCompositePrimaryKey($entity) |
407 | 407 | { |
408 | - return new self('Single id is not allowed on composite primary key in entity ' . $entity); |
|
408 | + return new self('Single id is not allowed on composite primary key in entity '.$entity); |
|
409 | 409 | } |
410 | 410 | |
411 | 411 | /** |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | */ |
416 | 416 | public static function noIdDefined($entity) |
417 | 417 | { |
418 | - return new self('No ID defined for entity ' . $entity); |
|
418 | + return new self('No ID defined for entity '.$entity); |
|
419 | 419 | } |
420 | 420 | |
421 | 421 | /** |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | */ |
424 | 424 | public static function unsupportedOptimisticLockingType(Type $unsupportedType) |
425 | 425 | { |
426 | - return new self('Locking type "' . $unsupportedType->getName() . '" is not supported by Doctrine.'); |
|
426 | + return new self('Locking type "'.$unsupportedType->getName().'" is not supported by Doctrine.'); |
|
427 | 427 | } |
428 | 428 | |
429 | 429 | /** |
@@ -433,13 +433,13 @@ discard block |
||
433 | 433 | */ |
434 | 434 | public static function fileMappingDriversRequireConfiguredDirectoryPath($path = null) |
435 | 435 | { |
436 | - if (! empty($path)) { |
|
437 | - $path = '[' . $path . ']'; |
|
436 | + if ( ! empty($path)) { |
|
437 | + $path = '['.$path.']'; |
|
438 | 438 | } |
439 | 439 | |
440 | 440 | return new self( |
441 | - 'File mapping drivers must have a valid directory path, ' . |
|
442 | - 'however the given path ' . $path . ' seems to be incorrect!' |
|
441 | + 'File mapping drivers must have a valid directory path, '. |
|
442 | + 'however the given path '.$path.' seems to be incorrect!' |
|
443 | 443 | ); |
444 | 444 | } |
445 | 445 | |
@@ -455,7 +455,7 @@ discard block |
||
455 | 455 | public static function invalidClassInDiscriminatorMap($className, $owningClass) |
456 | 456 | { |
457 | 457 | return new self(sprintf( |
458 | - "Entity class '%s' used in the discriminator map of class '%s' " . |
|
458 | + "Entity class '%s' used in the discriminator map of class '%s' ". |
|
459 | 459 | 'does not exist.', |
460 | 460 | $className, |
461 | 461 | $owningClass |
@@ -521,7 +521,7 @@ discard block |
||
521 | 521 | public static function sqlConversionNotAllowedForPrimaryKeyProperties($className, $fieldName, $type) |
522 | 522 | { |
523 | 523 | return new self(sprintf( |
524 | - 'It is not possible to set id field "%s" to type "%s" in entity class "%s". ' . |
|
524 | + 'It is not possible to set id field "%s" to type "%s" in entity class "%s". '. |
|
525 | 525 | 'The type "%s" requires conversion SQL which is not allowed for identifiers.', |
526 | 526 | $fieldName, |
527 | 527 | $type, |
@@ -557,7 +557,7 @@ discard block |
||
557 | 557 | */ |
558 | 558 | public static function duplicateColumnName($className, $columnName) |
559 | 559 | { |
560 | - return new self("Duplicate definition of column '" . $columnName . "' on entity '" . $className . "' in a field or discriminator column mapping."); |
|
560 | + return new self("Duplicate definition of column '".$columnName."' on entity '".$className."' in a field or discriminator column mapping."); |
|
561 | 561 | } |
562 | 562 | |
563 | 563 | /** |
@@ -568,7 +568,7 @@ discard block |
||
568 | 568 | */ |
569 | 569 | public static function illegalToManyAssociationOnMappedSuperclass($className, $field) |
570 | 570 | { |
571 | - return new self("It is illegal to put an inverse side one-to-many or many-to-many association on mapped superclass '" . $className . '#' . $field . "'."); |
|
571 | + return new self("It is illegal to put an inverse side one-to-many or many-to-many association on mapped superclass '".$className.'#'.$field."'."); |
|
572 | 572 | } |
573 | 573 | |
574 | 574 | /** |
@@ -580,8 +580,8 @@ discard block |
||
580 | 580 | */ |
581 | 581 | public static function cannotMapCompositePrimaryKeyEntitiesAsForeignId($className, $targetEntity, $targetField) |
582 | 582 | { |
583 | - return new self("It is not possible to map entity '" . $className . "' with a composite primary key " . |
|
584 | - "as part of the primary key of another entity '" . $targetEntity . '#' . $targetField . "'."); |
|
583 | + return new self("It is not possible to map entity '".$className."' with a composite primary key ". |
|
584 | + "as part of the primary key of another entity '".$targetEntity.'#'.$targetField."'."); |
|
585 | 585 | } |
586 | 586 | |
587 | 587 | /** |
@@ -635,8 +635,8 @@ discard block |
||
635 | 635 | */ |
636 | 636 | public static function illegalOrphanRemoval($className, $field) |
637 | 637 | { |
638 | - return new self('Orphan removal is only allowed on one-to-one and one-to-many ' . |
|
639 | - 'associations, but ' . $className . '#' . $field . ' is not.'); |
|
638 | + return new self('Orphan removal is only allowed on one-to-one and one-to-many '. |
|
639 | + 'associations, but '.$className.'#'.$field.' is not.'); |
|
640 | 640 | } |
641 | 641 | |
642 | 642 | /** |
@@ -668,7 +668,7 @@ discard block |
||
668 | 668 | */ |
669 | 669 | public static function noInheritanceOnMappedSuperClass($className) |
670 | 670 | { |
671 | - return new self("It is not supported to define inheritance information on a mapped superclass '" . $className . "'."); |
|
671 | + return new self("It is not supported to define inheritance information on a mapped superclass '".$className."'."); |
|
672 | 672 | } |
673 | 673 | |
674 | 674 | /** |
@@ -680,8 +680,8 @@ discard block |
||
680 | 680 | public static function mappedClassNotPartOfDiscriminatorMap($className, $rootClassName) |
681 | 681 | { |
682 | 682 | return new self( |
683 | - "Entity '" . $className . "' has to be part of the discriminator map of '" . $rootClassName . "' " . |
|
684 | - "to be properly mapped in the inheritance hierarchy. Alternatively you can make '" . $className . "' an abstract class " . |
|
683 | + "Entity '".$className."' has to be part of the discriminator map of '".$rootClassName."' ". |
|
684 | + "to be properly mapped in the inheritance hierarchy. Alternatively you can make '".$className."' an abstract class ". |
|
685 | 685 | 'to avoid this exception from occurring.' |
686 | 686 | ); |
687 | 687 | } |
@@ -694,7 +694,7 @@ discard block |
||
694 | 694 | */ |
695 | 695 | public static function lifecycleCallbackMethodNotFound($className, $methodName) |
696 | 696 | { |
697 | - return new self("Entity '" . $className . "' has no public method '" . $methodName . "' to be registered as lifecycle callback."); |
|
697 | + return new self("Entity '".$className."' has no public method '".$methodName."' to be registered as lifecycle callback."); |
|
698 | 698 | } |
699 | 699 | |
700 | 700 | /** |
@@ -728,7 +728,7 @@ discard block |
||
728 | 728 | */ |
729 | 729 | public static function invalidFetchMode($className, $annotation) |
730 | 730 | { |
731 | - return new self("Entity '" . $className . "' has a mapping with invalid fetch mode '" . $annotation . "'"); |
|
731 | + return new self("Entity '".$className."' has a mapping with invalid fetch mode '".$annotation."'"); |
|
732 | 732 | } |
733 | 733 | |
734 | 734 | /** |
@@ -738,7 +738,7 @@ discard block |
||
738 | 738 | */ |
739 | 739 | public static function compositeKeyAssignedIdGeneratorRequired($className) |
740 | 740 | { |
741 | - return new self("Entity '" . $className . "' has a composite identifier but uses an ID generator other than manually assigning (Identity, Sequence). This is not supported."); |
|
741 | + return new self("Entity '".$className."' has a composite identifier but uses an ID generator other than manually assigning (Identity, Sequence). This is not supported."); |
|
742 | 742 | } |
743 | 743 | |
744 | 744 | /** |
@@ -750,7 +750,7 @@ discard block |
||
750 | 750 | */ |
751 | 751 | public static function invalidTargetEntityClass($targetEntity, $sourceEntity, $associationName) |
752 | 752 | { |
753 | - return new self("The target-entity '" . $targetEntity . "' cannot be found in '" . $sourceEntity . '#' . $associationName . "'."); |
|
753 | + return new self("The target-entity '".$targetEntity."' cannot be found in '".$sourceEntity.'#'.$associationName."'."); |
|
754 | 754 | } |
755 | 755 | |
756 | 756 | /** |
@@ -762,8 +762,8 @@ discard block |
||
762 | 762 | */ |
763 | 763 | public static function invalidCascadeOption(array $cascades, $className, $propertyName) |
764 | 764 | { |
765 | - $cascades = implode(', ', array_map(static function ($e) { |
|
766 | - return "'" . $e . "'"; |
|
765 | + $cascades = implode(', ', array_map(static function($e) { |
|
766 | + return "'".$e."'"; |
|
767 | 767 | }, $cascades)); |
768 | 768 | |
769 | 769 | return new self(sprintf( |
@@ -796,7 +796,7 @@ discard block |
||
796 | 796 | { |
797 | 797 | return new self( |
798 | 798 | sprintf( |
799 | - 'Infinite nesting detected for embedded property %s::%s. ' . |
|
799 | + 'Infinite nesting detected for embedded property %s::%s. '. |
|
800 | 800 | 'You cannot embed an embeddable from the same type inside an embeddable.', |
801 | 801 | $className, |
802 | 802 | $propertyName |
@@ -811,7 +811,7 @@ discard block |
||
811 | 811 | { |
812 | 812 | return new self( |
813 | 813 | sprintf( |
814 | - 'Class %s not found in namespaces %s.' . |
|
814 | + 'Class %s not found in namespaces %s.'. |
|
815 | 815 | $className, |
816 | 816 | implode(', ', $namespaces) |
817 | 817 | ) |
@@ -180,11 +180,11 @@ discard block |
||
180 | 180 | $pkColumns = []; |
181 | 181 | |
182 | 182 | foreach ($class->getPropertiesIterator() as $fieldName => $property) { |
183 | - if (! ($property instanceof FieldMetadata)) { |
|
183 | + if ( ! ($property instanceof FieldMetadata)) { |
|
184 | 184 | continue; |
185 | 185 | } |
186 | 186 | |
187 | - if (! $class->isInheritedProperty($fieldName)) { |
|
187 | + if ( ! $class->isInheritedProperty($fieldName)) { |
|
188 | 188 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
189 | 189 | |
190 | 190 | $this->gatherColumn($class, $property, $table); |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | } |
220 | 220 | } |
221 | 221 | |
222 | - if (! empty($inheritedKeyColumns)) { |
|
222 | + if ( ! empty($inheritedKeyColumns)) { |
|
223 | 223 | // Add a FK constraint on the ID column |
224 | 224 | $rootClass = $this->em->getClassMetadata($class->getRootClassName()); |
225 | 225 | |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | } |
265 | 265 | } |
266 | 266 | |
267 | - if (! $table->hasIndex('primary')) { |
|
267 | + if ( ! $table->hasIndex('primary')) { |
|
268 | 268 | $table->setPrimaryKey($pkColumns); |
269 | 269 | } |
270 | 270 | |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | $processedClasses[$class->getClassName()] = true; |
325 | 325 | |
326 | 326 | foreach ($class->getPropertiesIterator() as $property) { |
327 | - if (! $property instanceof FieldMetadata |
|
327 | + if ( ! $property instanceof FieldMetadata |
|
328 | 328 | || ! $property->hasValueGenerator() |
329 | 329 | || $property->getValueGenerator()->getType() !== GeneratorType::SEQUENCE |
330 | 330 | || $class->getClassName() !== $class->getRootClassName()) { |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | $generator = $property->getValueGenerator()->getGenerator(); |
335 | 335 | $quotedName = $generator->getSequenceName(); |
336 | 336 | |
337 | - if (! $schema->hasSequence($quotedName)) { |
|
337 | + if ( ! $schema->hasSequence($quotedName)) { |
|
338 | 338 | $schema->createSequence($quotedName, $generator->getAllocationSize()); |
339 | 339 | } |
340 | 340 | } |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | } |
348 | 348 | } |
349 | 349 | |
350 | - if (! $this->platform->supportsSchemas() && ! $this->platform->canEmulateSchemas()) { |
|
350 | + if ( ! $this->platform->supportsSchemas() && ! $this->platform->canEmulateSchemas()) { |
|
351 | 351 | $schema->visit(new RemoveNamespacedAssets()); |
352 | 352 | } |
353 | 353 | |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | break; |
387 | 387 | } |
388 | 388 | |
389 | - if (! empty($discrColumn->getColumnDefinition())) { |
|
389 | + if ( ! empty($discrColumn->getColumnDefinition())) { |
|
390 | 390 | $options['columnDefinition'] = $discrColumn->getColumnDefinition(); |
391 | 391 | } |
392 | 392 | |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | $pkColumns = []; |
405 | 405 | |
406 | 406 | foreach ($class->getPropertiesIterator() as $fieldName => $property) { |
407 | - if (! ($property instanceof FieldMetadata)) { |
|
407 | + if ( ! ($property instanceof FieldMetadata)) { |
|
408 | 408 | continue; |
409 | 409 | } |
410 | 410 | |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | private function gatherRelationsSql($class, $table, $schema, &$addedFks, &$blacklistedFks) |
509 | 509 | { |
510 | 510 | foreach ($class->getPropertiesIterator() as $fieldName => $property) { |
511 | - if (! ($property instanceof AssociationMetadata)) { |
|
511 | + if ( ! ($property instanceof AssociationMetadata)) { |
|
512 | 512 | continue; |
513 | 513 | } |
514 | 514 | |
@@ -516,7 +516,7 @@ discard block |
||
516 | 516 | continue; |
517 | 517 | } |
518 | 518 | |
519 | - if (! $property->isOwningSide()) { |
|
519 | + if ( ! $property->isOwningSide()) { |
|
520 | 520 | continue; |
521 | 521 | } |
522 | 522 | |
@@ -606,7 +606,7 @@ discard block |
||
606 | 606 | $idColumns = $class->getIdentifierColumns($this->em); |
607 | 607 | $idColumnNameList = array_keys($idColumns); |
608 | 608 | |
609 | - if (! in_array($referencedColumnName, $idColumnNameList, true)) { |
|
609 | + if ( ! in_array($referencedColumnName, $idColumnNameList, true)) { |
|
610 | 610 | return null; |
611 | 611 | } |
612 | 612 | |
@@ -614,7 +614,7 @@ discard block |
||
614 | 614 | foreach ($class->getIdentifierFieldNames() as $fieldName) { |
615 | 615 | $property = $class->getProperty($fieldName); |
616 | 616 | |
617 | - if (! ($property instanceof AssociationMetadata)) { |
|
617 | + if ( ! ($property instanceof AssociationMetadata)) { |
|
618 | 618 | continue; |
619 | 619 | } |
620 | 620 | |
@@ -670,7 +670,7 @@ discard block |
||
670 | 670 | $joinColumn->getReferencedColumnName() |
671 | 671 | ); |
672 | 672 | |
673 | - if (! $definingClass) { |
|
673 | + if ( ! $definingClass) { |
|
674 | 674 | throw MissingColumnException::fromColumnSourceAndTarget( |
675 | 675 | $joinColumn->getReferencedColumnName(), |
676 | 676 | $mapping->getSourceEntity(), |
@@ -685,14 +685,14 @@ discard block |
||
685 | 685 | $localColumns[] = $quotedColumnName; |
686 | 686 | $foreignColumns[] = $quotedReferencedColumnName; |
687 | 687 | |
688 | - if (! $theJoinTable->hasColumn($quotedColumnName)) { |
|
688 | + if ( ! $theJoinTable->hasColumn($quotedColumnName)) { |
|
689 | 689 | // Only add the column to the table if it does not exist already. |
690 | 690 | // It might exist already if the foreign key is mapped into a regular |
691 | 691 | // property as well. |
692 | 692 | $property = $definingClass->getProperty($referencedFieldName); |
693 | 693 | $columnDef = null; |
694 | 694 | |
695 | - if (! empty($joinColumn->getColumnDefinition())) { |
|
695 | + if ( ! empty($joinColumn->getColumnDefinition())) { |
|
696 | 696 | $columnDef = $joinColumn->getColumnDefinition(); |
697 | 697 | } elseif ($property->getColumnDefinition()) { |
698 | 698 | $columnDef = $property->getColumnDefinition(); |
@@ -724,7 +724,7 @@ discard block |
||
724 | 724 | $uniqueConstraints[] = ['columns' => [$quotedColumnName]]; |
725 | 725 | } |
726 | 726 | |
727 | - if (! empty($joinColumn->getOnDelete())) { |
|
727 | + if ( ! empty($joinColumn->getOnDelete())) { |
|
728 | 728 | $fkOptions['onDelete'] = $joinColumn->getOnDelete(); |
729 | 729 | } |
730 | 730 | } |
@@ -735,7 +735,7 @@ discard block |
||
735 | 735 | $theJoinTable->addUniqueIndex($unique['columns'], is_numeric($indexName) ? null : $indexName); |
736 | 736 | } |
737 | 737 | |
738 | - $compositeName = $theJoinTable->getName() . '.' . implode('', $localColumns); |
|
738 | + $compositeName = $theJoinTable->getName().'.'.implode('', $localColumns); |
|
739 | 739 | |
740 | 740 | if (isset($addedFks[$compositeName]) |
741 | 741 | && ($foreignTableName !== $addedFks[$compositeName]['foreignTableName'] |
@@ -752,7 +752,7 @@ discard block |
||
752 | 752 | } |
753 | 753 | |
754 | 754 | $blacklistedFks[$compositeName] = true; |
755 | - } elseif (! isset($blacklistedFks[$compositeName])) { |
|
755 | + } elseif ( ! isset($blacklistedFks[$compositeName])) { |
|
756 | 756 | $addedFks[$compositeName] = [ |
757 | 757 | 'foreignTableName' => $foreignTableName, |
758 | 758 | 'foreignColumns' => $foreignColumns, |
@@ -851,7 +851,7 @@ discard block |
||
851 | 851 | $fullSchema = $sm->createSchema(); |
852 | 852 | |
853 | 853 | foreach ($fullSchema->getTables() as $table) { |
854 | - if (! $schema->hasTable($table->getName())) { |
|
854 | + if ( ! $schema->hasTable($table->getName())) { |
|
855 | 855 | foreach ($table->getForeignKeys() as $foreignKey) { |
856 | 856 | /** @var $foreignKey ForeignKeyConstraint */ |
857 | 857 | if ($schema->hasTable($foreignKey->getForeignTableName())) { |
@@ -876,7 +876,7 @@ discard block |
||
876 | 876 | if ($table->hasPrimaryKey()) { |
877 | 877 | $columns = $table->getPrimaryKey()->getColumns(); |
878 | 878 | if (count($columns) === 1) { |
879 | - $checkSequence = $table->getName() . '_' . $columns[0] . '_seq'; |
|
879 | + $checkSequence = $table->getName().'_'.$columns[0].'_seq'; |
|
880 | 880 | if ($fullSchema->hasSequence($checkSequence)) { |
881 | 881 | $visitor->acceptSequence($fullSchema->getSequence($checkSequence)); |
882 | 882 | } |