@@ -9,7 +9,7 @@ |
||
9 | 9 | public static function create() : self |
10 | 10 | { |
11 | 11 | return new self( |
12 | - "It's a requirement to specify a Metadata Driver and pass it " . |
|
12 | + "It's a requirement to specify a Metadata Driver and pass it ". |
|
13 | 13 | 'to Doctrine\\ORM\\Configuration::setMetadataDriverImpl().' |
14 | 14 | ); |
15 | 15 | } |
@@ -107,8 +107,8 @@ discard block |
||
107 | 107 | } |
108 | 108 | |
109 | 109 | $result = $this->loadMappingFile($this->locator->findMappingFile($className)); |
110 | - if (! isset($result[$className])) { |
|
111 | - throw MappingException::invalidMappingFile($className, str_replace('\\', '.', $className) . $this->locator->getFileExtension()); |
|
110 | + if ( ! isset($result[$className])) { |
|
111 | + throw MappingException::invalidMappingFile($className, str_replace('\\', '.', $className).$this->locator->getFileExtension()); |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | $this->classCache[$className] = $result[$className]; |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | $this->initialize(); |
142 | 142 | } |
143 | 143 | |
144 | - if (! $this->classCache) { |
|
144 | + if ( ! $this->classCache) { |
|
145 | 145 | return (array) $this->locator->getAllClassNames($this->globalBasename); |
146 | 146 | } |
147 | 147 | |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | $this->classCache = []; |
176 | 176 | if ($this->globalBasename !== null) { |
177 | 177 | foreach ($this->locator->getPaths() as $path) { |
178 | - $file = $path . '/' . $this->globalBasename . $this->locator->getFileExtension(); |
|
178 | + $file = $path.'/'.$this->globalBasename.$this->locator->getFileExtension(); |
|
179 | 179 | if (is_file($file)) { |
180 | 180 | $this->classCache = array_merge( |
181 | 181 | $this->classCache, |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | |
137 | 137 | $classNames = array_filter( |
138 | 138 | $this->locator->getAllClassNames(null), |
139 | - function ($className) { |
|
139 | + function($className) { |
|
140 | 140 | return ! $this->isTransient($className); |
141 | 141 | } |
142 | 142 | ); |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | $entityListenersAnnot = $classAnnotations[Annotation\EntityListeners::class]; |
255 | 255 | |
256 | 256 | foreach ($entityListenersAnnot->value as $listenerClassName) { |
257 | - if (! class_exists($listenerClassName)) { |
|
257 | + if ( ! class_exists($listenerClassName)) { |
|
258 | 258 | throw Mapping\MappingException::entityListenerClassNotFound( |
259 | 259 | $listenerClassName, |
260 | 260 | $reflectionClass->getName() |
@@ -301,15 +301,15 @@ discard block |
||
301 | 301 | |
302 | 302 | $discriminatorColumn->setColumnName($discriminatorColumnAnnot->name); |
303 | 303 | |
304 | - if (! empty($discriminatorColumnAnnot->columnDefinition)) { |
|
304 | + if ( ! empty($discriminatorColumnAnnot->columnDefinition)) { |
|
305 | 305 | $discriminatorColumn->setColumnDefinition($discriminatorColumnAnnot->columnDefinition); |
306 | 306 | } |
307 | 307 | |
308 | - if (! empty($discriminatorColumnAnnot->type)) { |
|
308 | + if ( ! empty($discriminatorColumnAnnot->type)) { |
|
309 | 309 | $discriminatorColumn->setType(Type::getType($discriminatorColumnAnnot->type)); |
310 | 310 | } |
311 | 311 | |
312 | - if (! empty($discriminatorColumnAnnot->length)) { |
|
312 | + if ( ! empty($discriminatorColumnAnnot->length)) { |
|
313 | 313 | $discriminatorColumn->setLength($discriminatorColumnAnnot->length); |
314 | 314 | } |
315 | 315 | } |
@@ -364,11 +364,11 @@ discard block |
||
364 | 364 | { |
365 | 365 | $table = new Mapping\TableMetadata(); |
366 | 366 | |
367 | - if (! empty($tableAnnot->name)) { |
|
367 | + if ( ! empty($tableAnnot->name)) { |
|
368 | 368 | $table->setName($tableAnnot->name); |
369 | 369 | } |
370 | 370 | |
371 | - if (! empty($tableAnnot->schema)) { |
|
371 | + if ( ! empty($tableAnnot->schema)) { |
|
372 | 372 | $table->setSchema($tableAnnot->schema); |
373 | 373 | } |
374 | 374 | |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | ) { |
413 | 413 | $usage = constant(sprintf('%s::%s', Mapping\CacheUsage::class, $cacheAnnot->usage)); |
414 | 414 | $baseRegion = strtolower(str_replace('\\', '_', $metadata->getRootClassName())); |
415 | - $defaultRegion = $baseRegion . ($fieldName ? '__' . $fieldName : ''); |
|
415 | + $defaultRegion = $baseRegion.($fieldName ? '__'.$fieldName : ''); |
|
416 | 416 | |
417 | 417 | return new Mapping\CacheMetadata($usage, $cacheAnnot->region ?: $defaultRegion); |
418 | 418 | } |
@@ -528,11 +528,11 @@ discard block |
||
528 | 528 | $fieldMetadata->setPrimaryKey(true); |
529 | 529 | } |
530 | 530 | |
531 | - if (! empty($columnAnnot->columnDefinition)) { |
|
531 | + if ( ! empty($columnAnnot->columnDefinition)) { |
|
532 | 532 | $fieldMetadata->setColumnDefinition($columnAnnot->columnDefinition); |
533 | 533 | } |
534 | 534 | |
535 | - if (! empty($columnAnnot->length)) { |
|
535 | + if ( ! empty($columnAnnot->length)) { |
|
536 | 536 | $fieldMetadata->setLength($columnAnnot->length); |
537 | 537 | } |
538 | 538 | |
@@ -553,7 +553,7 @@ discard block |
||
553 | 553 | break; |
554 | 554 | |
555 | 555 | default: |
556 | - if (! isset($customOptions['default'])) { |
|
556 | + if ( ! isset($customOptions['default'])) { |
|
557 | 557 | throw Mapping\MappingException::unsupportedOptimisticLockingType($fieldMetadata->getType()); |
558 | 558 | } |
559 | 559 | } |
@@ -591,11 +591,11 @@ discard block |
||
591 | 591 | $assocMetadata->setOrphanRemoval($oneToOneAnnot->orphanRemoval); |
592 | 592 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToOneAnnot->fetch)); |
593 | 593 | |
594 | - if (! empty($oneToOneAnnot->mappedBy)) { |
|
594 | + if ( ! empty($oneToOneAnnot->mappedBy)) { |
|
595 | 595 | $assocMetadata->setMappedBy($oneToOneAnnot->mappedBy); |
596 | 596 | } |
597 | 597 | |
598 | - if (! empty($oneToOneAnnot->inversedBy)) { |
|
598 | + if ( ! empty($oneToOneAnnot->inversedBy)) { |
|
599 | 599 | $assocMetadata->setInversedBy($oneToOneAnnot->inversedBy); |
600 | 600 | } |
601 | 601 | |
@@ -671,7 +671,7 @@ discard block |
||
671 | 671 | $assocMetadata->setCascade($this->getCascade($className, $fieldName, $manyToOneAnnot->cascade)); |
672 | 672 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToOneAnnot->fetch)); |
673 | 673 | |
674 | - if (! empty($manyToOneAnnot->inversedBy)) { |
|
674 | + if ( ! empty($manyToOneAnnot->inversedBy)) { |
|
675 | 675 | $assocMetadata->setInversedBy($manyToOneAnnot->inversedBy); |
676 | 676 | } |
677 | 677 | |
@@ -748,11 +748,11 @@ discard block |
||
748 | 748 | $assocMetadata->setOrphanRemoval($oneToManyAnnot->orphanRemoval); |
749 | 749 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToManyAnnot->fetch)); |
750 | 750 | |
751 | - if (! empty($oneToManyAnnot->mappedBy)) { |
|
751 | + if ( ! empty($oneToManyAnnot->mappedBy)) { |
|
752 | 752 | $assocMetadata->setMappedBy($oneToManyAnnot->mappedBy); |
753 | 753 | } |
754 | 754 | |
755 | - if (! empty($oneToManyAnnot->indexBy)) { |
|
755 | + if ( ! empty($oneToManyAnnot->indexBy)) { |
|
756 | 756 | $assocMetadata->setIndexedBy($oneToManyAnnot->indexBy); |
757 | 757 | } |
758 | 758 | |
@@ -806,15 +806,15 @@ discard block |
||
806 | 806 | $assocMetadata->setOrphanRemoval($manyToManyAnnot->orphanRemoval); |
807 | 807 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToManyAnnot->fetch)); |
808 | 808 | |
809 | - if (! empty($manyToManyAnnot->mappedBy)) { |
|
809 | + if ( ! empty($manyToManyAnnot->mappedBy)) { |
|
810 | 810 | $assocMetadata->setMappedBy($manyToManyAnnot->mappedBy); |
811 | 811 | } |
812 | 812 | |
813 | - if (! empty($manyToManyAnnot->inversedBy)) { |
|
813 | + if ( ! empty($manyToManyAnnot->inversedBy)) { |
|
814 | 814 | $assocMetadata->setInversedBy($manyToManyAnnot->inversedBy); |
815 | 815 | } |
816 | 816 | |
817 | - if (! empty($manyToManyAnnot->indexBy)) { |
|
817 | + if ( ! empty($manyToManyAnnot->indexBy)) { |
|
818 | 818 | $assocMetadata->setIndexedBy($manyToManyAnnot->indexBy); |
819 | 819 | } |
820 | 820 | |
@@ -865,11 +865,11 @@ discard block |
||
865 | 865 | ) { |
866 | 866 | $joinTable = new Mapping\JoinTableMetadata(); |
867 | 867 | |
868 | - if (! empty($joinTableAnnot->name)) { |
|
868 | + if ( ! empty($joinTableAnnot->name)) { |
|
869 | 869 | $joinTable->setName($joinTableAnnot->name); |
870 | 870 | } |
871 | 871 | |
872 | - if (! empty($joinTableAnnot->schema)) { |
|
872 | + if ( ! empty($joinTableAnnot->schema)) { |
|
873 | 873 | $joinTable->setSchema($joinTableAnnot->schema); |
874 | 874 | } |
875 | 875 | |
@@ -922,11 +922,11 @@ discard block |
||
922 | 922 | $joinColumn->setNullable($joinColumnAnnot->nullable); |
923 | 923 | $joinColumn->setUnique($joinColumnAnnot->unique); |
924 | 924 | |
925 | - if (! empty($joinColumnAnnot->fieldName)) { |
|
925 | + if ( ! empty($joinColumnAnnot->fieldName)) { |
|
926 | 926 | $joinColumn->setAliasedName($joinColumnAnnot->fieldName); |
927 | 927 | } |
928 | 928 | |
929 | - if (! empty($joinColumnAnnot->columnDefinition)) { |
|
929 | + if ( ! empty($joinColumnAnnot->columnDefinition)) { |
|
930 | 930 | $joinColumn->setColumnDefinition($joinColumnAnnot->columnDefinition); |
931 | 931 | } |
932 | 932 | |
@@ -982,7 +982,7 @@ discard block |
||
982 | 982 | { |
983 | 983 | $fetchModeConstant = sprintf('%s::%s', Mapping\FetchMode::class, $fetchMode); |
984 | 984 | |
985 | - if (! defined($fetchModeConstant)) { |
|
985 | + if ( ! defined($fetchModeConstant)) { |
|
986 | 986 | throw Mapping\MappingException::invalidFetchMode($className, $fetchMode); |
987 | 987 | } |
988 | 988 | |
@@ -1024,7 +1024,7 @@ discard block |
||
1024 | 1024 | $classAnnotations = $this->reader->getClassAnnotations($reflectionClass); |
1025 | 1025 | |
1026 | 1026 | foreach ($classAnnotations as $key => $annot) { |
1027 | - if (! is_numeric($key)) { |
|
1027 | + if ( ! is_numeric($key)) { |
|
1028 | 1028 | continue; |
1029 | 1029 | } |
1030 | 1030 | |
@@ -1042,7 +1042,7 @@ discard block |
||
1042 | 1042 | $propertyAnnotations = $this->reader->getPropertyAnnotations($reflectionProperty); |
1043 | 1043 | |
1044 | 1044 | foreach ($propertyAnnotations as $key => $annot) { |
1045 | - if (! is_numeric($key)) { |
|
1045 | + if ( ! is_numeric($key)) { |
|
1046 | 1046 | continue; |
1047 | 1047 | } |
1048 | 1048 | |
@@ -1060,7 +1060,7 @@ discard block |
||
1060 | 1060 | $methodAnnotations = $this->reader->getMethodAnnotations($reflectionMethod); |
1061 | 1061 | |
1062 | 1062 | foreach ($methodAnnotations as $key => $annot) { |
1063 | - if (! is_numeric($key)) { |
|
1063 | + if ( ! is_numeric($key)) { |
|
1064 | 1064 | continue; |
1065 | 1065 | } |
1066 | 1066 |
@@ -99,7 +99,7 @@ |
||
99 | 99 | foreach ($this->drivers as $namespace => $driver) { |
100 | 100 | $oid = spl_object_id($driver); |
101 | 101 | |
102 | - if (! isset($driverClasses[$oid])) { |
|
102 | + if ( ! isset($driverClasses[$oid])) { |
|
103 | 103 | $driverClasses[$oid] = $driver->getAllClassNames(); |
104 | 104 | } |
105 | 105 |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | public function getQuotedQualifiedName(AbstractPlatform $platform) : string |
57 | 57 | { |
58 | - if (! $this->schema) { |
|
58 | + if ( ! $this->schema) { |
|
59 | 59 | return $platform->quoteIdentifier($this->name); |
60 | 60 | } |
61 | 61 | |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | */ |
128 | 128 | public function addIndex(array $index) : void |
129 | 129 | { |
130 | - if (! isset($index['name'])) { |
|
130 | + if ( ! isset($index['name'])) { |
|
131 | 131 | $this->indexes[] = $index; |
132 | 132 | |
133 | 133 | return; |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | */ |
163 | 163 | public function addUniqueConstraint(array $constraint) : void |
164 | 164 | { |
165 | - if (! isset($constraint['name'])) { |
|
165 | + if ( ! isset($constraint['name'])) { |
|
166 | 166 | $this->uniqueConstraints[] = $constraint; |
167 | 167 | |
168 | 168 | return; |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | */ |
125 | 125 | public function getAllMetadata() : array |
126 | 126 | { |
127 | - if (! $this->initialized) { |
|
127 | + if ( ! $this->initialized) { |
|
128 | 128 | $this->initialize(); |
129 | 129 | } |
130 | 130 | |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | |
166 | 166 | try { |
167 | 167 | if ($this->cacheDriver) { |
168 | - $cached = $this->cacheDriver->fetch($realClassName . $this->cacheSalt); |
|
168 | + $cached = $this->cacheDriver->fetch($realClassName.$this->cacheSalt); |
|
169 | 169 | |
170 | 170 | if ($cached instanceof ClassMetadata) { |
171 | 171 | $this->loadedMetadata[$realClassName] = $cached; |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | foreach ($this->loadMetadata($realClassName, $metadataBuildingContext) as $loadedClass) { |
176 | 176 | $loadedClassName = $loadedClass->getClassName(); |
177 | 177 | |
178 | - $this->cacheDriver->save($loadedClassName . $this->cacheSalt, $loadedClass, null); |
|
178 | + $this->cacheDriver->save($loadedClassName.$this->cacheSalt, $loadedClass, null); |
|
179 | 179 | } |
180 | 180 | } |
181 | 181 | } else { |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | } catch (CommonMappingException $loadingException) { |
185 | 185 | $fallbackMetadataResponse = $this->onNotFoundMetadata($realClassName, $metadataBuildingContext); |
186 | 186 | |
187 | - if (! $fallbackMetadataResponse) { |
|
187 | + if ( ! $fallbackMetadataResponse) { |
|
188 | 188 | throw $loadingException; |
189 | 189 | } |
190 | 190 | |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | */ |
221 | 221 | protected function loadMetadata(string $name, ClassMetadataBuildingContext $metadataBuildingContext) : array |
222 | 222 | { |
223 | - if (! $this->initialized) { |
|
223 | + if ( ! $this->initialized) { |
|
224 | 224 | $this->initialize(); |
225 | 225 | } |
226 | 226 | |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | */ |
257 | 257 | public function isTransient($className) : bool |
258 | 258 | { |
259 | - if (! $this->initialized) { |
|
259 | + if ( ! $this->initialized) { |
|
260 | 260 | $this->initialize(); |
261 | 261 | } |
262 | 262 | |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | $parentClasses = []; |
279 | 279 | |
280 | 280 | foreach (array_reverse($this->getReflectionService()->getParentClasses($name)) as $parentClass) { |
281 | - if (! $this->getDriver()->isTransient($parentClass)) { |
|
281 | + if ( ! $this->getDriver()->isTransient($parentClass)) { |
|
282 | 282 | $parentClasses[] = $parentClass; |
283 | 283 | } |
284 | 284 | } |
@@ -10,6 +10,6 @@ |
||
10 | 10 | { |
11 | 11 | public static function create(string $generatorType) : self |
12 | 12 | { |
13 | - return new self('Unknown generator type: ' . $generatorType); |
|
13 | + return new self('Unknown generator type: '.$generatorType); |
|
14 | 14 | } |
15 | 15 | } |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | } |
59 | 59 | |
60 | 60 | // If $value is not a Collection then use an ArrayCollection. |
61 | - if (! $collection instanceof Collection) { |
|
61 | + if ( ! $collection instanceof Collection) { |
|
62 | 62 | // @todo guilhermeblanco Conceptually, support to custom collections by replacing ArrayCollection creation. |
63 | 63 | $collection = new ArrayCollection((array) $collection); |
64 | 64 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $collection = new PersistentCollection($entityManager, $targetClass, $collection); |
69 | 69 | |
70 | 70 | $collection->setOwner($owner, $this); |
71 | - $collection->setDirty(! $collection->isEmpty()); |
|
71 | + $collection->setDirty( ! $collection->isEmpty()); |
|
72 | 72 | $collection->setInitialized(true); |
73 | 73 | |
74 | 74 | return $collection; |
@@ -14,7 +14,7 @@ |
||
14 | 14 | */ |
15 | 15 | public function generate(string $filePath, ClassMetadataDefinition $definition) : void |
16 | 16 | { |
17 | - if (! file_exists($filePath)) { |
|
17 | + if ( ! file_exists($filePath)) { |
|
18 | 18 | parent::generate($filePath, $definition); |
19 | 19 | |
20 | 20 | return; |