@@ -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 | |
@@ -178,8 +178,8 @@ discard block |
||
178 | 178 | } |
179 | 179 | |
180 | 180 | foreach ($this->locator->getPaths() as $path) { |
181 | - $file = $path . '/' . $this->globalBasename . $this->locator->getFileExtension(); |
|
182 | - if (! is_file($file)) { |
|
181 | + $file = $path.'/'.$this->globalBasename.$this->locator->getFileExtension(); |
|
182 | + if ( ! is_file($file)) { |
|
183 | 183 | continue; |
184 | 184 | } |
185 | 185 |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | public function __construct(Reader $reader, $paths = null) |
92 | 92 | { |
93 | 93 | $this->reader = $reader; |
94 | - if (! $paths) { |
|
94 | + if ( ! $paths) { |
|
95 | 95 | return; |
96 | 96 | } |
97 | 97 | |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | return $this->classNames; |
202 | 202 | } |
203 | 203 | |
204 | - if (! $this->paths) { |
|
204 | + if ( ! $this->paths) { |
|
205 | 205 | throw Mapping\MappingException::pathRequired(); |
206 | 206 | } |
207 | 207 | |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | $includedFiles = []; |
210 | 210 | |
211 | 211 | foreach ($this->paths as $path) { |
212 | - if (! is_dir($path)) { |
|
212 | + if ( ! is_dir($path)) { |
|
213 | 213 | throw Mapping\MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); |
214 | 214 | } |
215 | 215 | |
@@ -218,14 +218,14 @@ discard block |
||
218 | 218 | new \RecursiveDirectoryIterator($path, \FilesystemIterator::SKIP_DOTS), |
219 | 219 | \RecursiveIteratorIterator::LEAVES_ONLY |
220 | 220 | ), |
221 | - '/^.+' . preg_quote($this->fileExtension) . '$/i', |
|
221 | + '/^.+'.preg_quote($this->fileExtension).'$/i', |
|
222 | 222 | \RecursiveRegexIterator::GET_MATCH |
223 | 223 | ); |
224 | 224 | |
225 | 225 | foreach ($iterator as $file) { |
226 | 226 | $sourceFile = $file[0]; |
227 | 227 | |
228 | - if (! preg_match('(^phar:)i', $sourceFile)) { |
|
228 | + if ( ! preg_match('(^phar:)i', $sourceFile)) { |
|
229 | 229 | $sourceFile = realpath($sourceFile); |
230 | 230 | } |
231 | 231 | |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | foreach ($declared as $className) { |
250 | 250 | $rc = new \ReflectionClass($className); |
251 | 251 | $sourceFile = $rc->getFileName(); |
252 | - if (! in_array($sourceFile, $includedFiles, true) || $this->isTransient($className)) { |
|
252 | + if ( ! in_array($sourceFile, $includedFiles, true) || $this->isTransient($className)) { |
|
253 | 253 | continue; |
254 | 254 | } |
255 | 255 | |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | ) : Mapping\ClassMetadata { |
277 | 277 | $reflectionClass = $metadata->getReflectionClass(); |
278 | 278 | |
279 | - if (! $reflectionClass) { |
|
279 | + if ( ! $reflectionClass) { |
|
280 | 280 | // this happens when running annotation driver in combination with |
281 | 281 | // static reflection services. This is not the nicest fix |
282 | 282 | $reflectionClass = new \ReflectionClass($metadata->getClassName()); |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | ); |
322 | 322 | } |
323 | 323 | |
324 | - if (! $property) { |
|
324 | + if ( ! $property) { |
|
325 | 325 | continue; |
326 | 326 | } |
327 | 327 | |
@@ -614,12 +614,12 @@ discard block |
||
614 | 614 | $assocMetadata->setOrphanRemoval($oneToOneAnnot->orphanRemoval); |
615 | 615 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToOneAnnot->fetch)); |
616 | 616 | |
617 | - if (! empty($oneToOneAnnot->mappedBy)) { |
|
617 | + if ( ! empty($oneToOneAnnot->mappedBy)) { |
|
618 | 618 | $assocMetadata->setMappedBy($oneToOneAnnot->mappedBy); |
619 | 619 | $assocMetadata->setOwningSide(false); |
620 | 620 | } |
621 | 621 | |
622 | - if (! empty($oneToOneAnnot->inversedBy)) { |
|
622 | + if ( ! empty($oneToOneAnnot->inversedBy)) { |
|
623 | 623 | $assocMetadata->setInversedBy($oneToOneAnnot->inversedBy); |
624 | 624 | } |
625 | 625 | |
@@ -676,7 +676,7 @@ discard block |
||
676 | 676 | $assocMetadata->setCascade($this->getCascade($className, $fieldName, $manyToOneAnnot->cascade)); |
677 | 677 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToOneAnnot->fetch)); |
678 | 678 | |
679 | - if (! empty($manyToOneAnnot->inversedBy)) { |
|
679 | + if ( ! empty($manyToOneAnnot->inversedBy)) { |
|
680 | 680 | $assocMetadata->setInversedBy($manyToOneAnnot->inversedBy); |
681 | 681 | } |
682 | 682 | |
@@ -736,7 +736,7 @@ discard block |
||
736 | 736 | $assocMetadata->setOwningSide(false); |
737 | 737 | $assocMetadata->setMappedBy($oneToManyAnnot->mappedBy); |
738 | 738 | |
739 | - if (! empty($oneToManyAnnot->indexBy)) { |
|
739 | + if ( ! empty($oneToManyAnnot->indexBy)) { |
|
740 | 740 | $assocMetadata->setIndexedBy($oneToManyAnnot->indexBy); |
741 | 741 | } |
742 | 742 | |
@@ -778,16 +778,16 @@ discard block |
||
778 | 778 | $assocMetadata->setOrphanRemoval($manyToManyAnnot->orphanRemoval); |
779 | 779 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToManyAnnot->fetch)); |
780 | 780 | |
781 | - if (! empty($manyToManyAnnot->mappedBy)) { |
|
781 | + if ( ! empty($manyToManyAnnot->mappedBy)) { |
|
782 | 782 | $assocMetadata->setMappedBy($manyToManyAnnot->mappedBy); |
783 | 783 | $assocMetadata->setOwningSide(false); |
784 | 784 | } |
785 | 785 | |
786 | - if (! empty($manyToManyAnnot->inversedBy)) { |
|
786 | + if ( ! empty($manyToManyAnnot->inversedBy)) { |
|
787 | 787 | $assocMetadata->setInversedBy($manyToManyAnnot->inversedBy); |
788 | 788 | } |
789 | 789 | |
790 | - if (! empty($manyToManyAnnot->indexBy)) { |
|
790 | + if ( ! empty($manyToManyAnnot->indexBy)) { |
|
791 | 791 | $assocMetadata->setIndexedBy($manyToManyAnnot->indexBy); |
792 | 792 | } |
793 | 793 | |
@@ -831,15 +831,15 @@ discard block |
||
831 | 831 | |
832 | 832 | $fieldMetadata->setType(Type::getType($columnAnnot->type)); |
833 | 833 | |
834 | - if (! empty($columnAnnot->name)) { |
|
834 | + if ( ! empty($columnAnnot->name)) { |
|
835 | 835 | $fieldMetadata->setColumnName($columnAnnot->name); |
836 | 836 | } |
837 | 837 | |
838 | - if (! empty($columnAnnot->columnDefinition)) { |
|
838 | + if ( ! empty($columnAnnot->columnDefinition)) { |
|
839 | 839 | $fieldMetadata->setColumnDefinition($columnAnnot->columnDefinition); |
840 | 840 | } |
841 | 841 | |
842 | - if (! empty($columnAnnot->length)) { |
|
842 | + if ( ! empty($columnAnnot->length)) { |
|
843 | 843 | $fieldMetadata->setLength($columnAnnot->length); |
844 | 844 | } |
845 | 845 | |
@@ -862,11 +862,11 @@ discard block |
||
862 | 862 | Annotation\Table $tableAnnot, |
863 | 863 | Mapping\TableMetadata $tableMetadata |
864 | 864 | ) : void { |
865 | - if (! empty($tableAnnot->name)) { |
|
865 | + if ( ! empty($tableAnnot->name)) { |
|
866 | 866 | $tableMetadata->setName($tableAnnot->name); |
867 | 867 | } |
868 | 868 | |
869 | - if (! empty($tableAnnot->schema)) { |
|
869 | + if ( ! empty($tableAnnot->schema)) { |
|
870 | 870 | $tableMetadata->setSchema($tableAnnot->schema); |
871 | 871 | } |
872 | 872 | |
@@ -902,11 +902,11 @@ discard block |
||
902 | 902 | ) : Mapping\JoinTableMetadata { |
903 | 903 | $joinTable = new Mapping\JoinTableMetadata(); |
904 | 904 | |
905 | - if (! empty($joinTableAnnot->name)) { |
|
905 | + if ( ! empty($joinTableAnnot->name)) { |
|
906 | 906 | $joinTable->setName($joinTableAnnot->name); |
907 | 907 | } |
908 | 908 | |
909 | - if (! empty($joinTableAnnot->schema)) { |
|
909 | + if ( ! empty($joinTableAnnot->schema)) { |
|
910 | 910 | $joinTable->setSchema($joinTableAnnot->schema); |
911 | 911 | } |
912 | 912 | |
@@ -934,22 +934,22 @@ discard block |
||
934 | 934 | $joinColumn = new Mapping\JoinColumnMetadata(); |
935 | 935 | |
936 | 936 | // @todo Remove conditionals for name and referencedColumnName once naming strategy is brought into drivers |
937 | - if (! empty($joinColumnAnnot->name)) { |
|
937 | + if ( ! empty($joinColumnAnnot->name)) { |
|
938 | 938 | $joinColumn->setColumnName($joinColumnAnnot->name); |
939 | 939 | } |
940 | 940 | |
941 | - if (! empty($joinColumnAnnot->referencedColumnName)) { |
|
941 | + if ( ! empty($joinColumnAnnot->referencedColumnName)) { |
|
942 | 942 | $joinColumn->setReferencedColumnName($joinColumnAnnot->referencedColumnName); |
943 | 943 | } |
944 | 944 | |
945 | 945 | $joinColumn->setNullable($joinColumnAnnot->nullable); |
946 | 946 | $joinColumn->setUnique($joinColumnAnnot->unique); |
947 | 947 | |
948 | - if (! empty($joinColumnAnnot->fieldName)) { |
|
948 | + if ( ! empty($joinColumnAnnot->fieldName)) { |
|
949 | 949 | $joinColumn->setAliasedName($joinColumnAnnot->fieldName); |
950 | 950 | } |
951 | 951 | |
952 | - if (! empty($joinColumnAnnot->columnDefinition)) { |
|
952 | + if ( ! empty($joinColumnAnnot->columnDefinition)) { |
|
953 | 953 | $joinColumn->setColumnDefinition($joinColumnAnnot->columnDefinition); |
954 | 954 | } |
955 | 955 | |
@@ -971,7 +971,7 @@ discard block |
||
971 | 971 | $fieldName = null |
972 | 972 | ) : Mapping\CacheMetadata { |
973 | 973 | $baseRegion = strtolower(str_replace('\\', '_', $metadata->getRootClassName())); |
974 | - $defaultRegion = $baseRegion . ($fieldName ? '__' . $fieldName : ''); |
|
974 | + $defaultRegion = $baseRegion.($fieldName ? '__'.$fieldName : ''); |
|
975 | 975 | |
976 | 976 | $usage = constant(sprintf('%s::%s', Mapping\CacheUsage::class, $cacheAnnot->usage)); |
977 | 977 | $region = $cacheAnnot->region ?: $defaultRegion; |
@@ -993,7 +993,7 @@ discard block |
||
993 | 993 | if ($parent && $parent->inheritanceType === Mapping\InheritanceType::SINGLE_TABLE) { |
994 | 994 | // Handle the case where a middle mapped super class inherits from a single table inheritance tree. |
995 | 995 | do { |
996 | - if (! $parent->isMappedSuperclass) { |
|
996 | + if ( ! $parent->isMappedSuperclass) { |
|
997 | 997 | $metadata->setTable($parent->table); |
998 | 998 | |
999 | 999 | break; |
@@ -1048,11 +1048,11 @@ discard block |
||
1048 | 1048 | $discriminatorColumn->setType(Type::getType($typeName)); |
1049 | 1049 | $discriminatorColumn->setColumnName($discriminatorColumnAnnotation->name); |
1050 | 1050 | |
1051 | - if (! empty($discriminatorColumnAnnotation->columnDefinition)) { |
|
1051 | + if ( ! empty($discriminatorColumnAnnotation->columnDefinition)) { |
|
1052 | 1052 | $discriminatorColumn->setColumnDefinition($discriminatorColumnAnnotation->columnDefinition); |
1053 | 1053 | } |
1054 | 1054 | |
1055 | - if (! empty($discriminatorColumnAnnotation->length)) { |
|
1055 | + if ( ! empty($discriminatorColumnAnnotation->length)) { |
|
1056 | 1056 | $discriminatorColumn->setLength($discriminatorColumnAnnotation->length); |
1057 | 1057 | } |
1058 | 1058 | } |
@@ -1060,7 +1060,7 @@ discard block |
||
1060 | 1060 | $metadata->setDiscriminatorColumn($discriminatorColumn); |
1061 | 1061 | |
1062 | 1062 | // Evaluate DiscriminatorMap annotation |
1063 | - if (! isset($classAnnotations[Annotation\DiscriminatorMap::class])) { |
|
1063 | + if ( ! isset($classAnnotations[Annotation\DiscriminatorMap::class])) { |
|
1064 | 1064 | return; |
1065 | 1065 | } |
1066 | 1066 | |
@@ -1079,7 +1079,7 @@ discard block |
||
1079 | 1079 | Mapping\ClassMetadata $metadata |
1080 | 1080 | ) : void { |
1081 | 1081 | // Evaluate @HasLifecycleCallbacks annotation |
1082 | - if (! isset($classAnnotations[Annotation\HasLifecycleCallbacks::class])) { |
|
1082 | + if ( ! isset($classAnnotations[Annotation\HasLifecycleCallbacks::class])) { |
|
1083 | 1083 | return; |
1084 | 1084 | } |
1085 | 1085 | |
@@ -1103,7 +1103,7 @@ discard block |
||
1103 | 1103 | Mapping\ClassMetadata $metadata |
1104 | 1104 | ) : void { |
1105 | 1105 | // Evaluate @EntityListeners annotation |
1106 | - if (! isset($classAnnotations[Annotation\EntityListeners::class])) { |
|
1106 | + if ( ! isset($classAnnotations[Annotation\EntityListeners::class])) { |
|
1107 | 1107 | return; |
1108 | 1108 | } |
1109 | 1109 | |
@@ -1111,7 +1111,7 @@ discard block |
||
1111 | 1111 | $entityListenersAnnot = $classAnnotations[Annotation\EntityListeners::class]; |
1112 | 1112 | |
1113 | 1113 | foreach ($entityListenersAnnot->value as $listenerClassName) { |
1114 | - if (! class_exists($listenerClassName)) { |
|
1114 | + if ( ! class_exists($listenerClassName)) { |
|
1115 | 1115 | throw Mapping\MappingException::entityListenerClassNotFound( |
1116 | 1116 | $listenerClassName, |
1117 | 1117 | $metadata->getClassName() |
@@ -1147,7 +1147,7 @@ discard block |
||
1147 | 1147 | $fieldName = $associationOverride->name; |
1148 | 1148 | $property = $metadata->getProperty($fieldName); |
1149 | 1149 | |
1150 | - if (! $property) { |
|
1150 | + if ( ! $property) { |
|
1151 | 1151 | throw Mapping\MappingException::invalidOverrideFieldName($metadata->getClassName(), $fieldName); |
1152 | 1152 | } |
1153 | 1153 | |
@@ -1181,7 +1181,7 @@ discard block |
||
1181 | 1181 | // Check for fetch |
1182 | 1182 | if ($associationOverride->fetch) { |
1183 | 1183 | $override->setFetchMode( |
1184 | - constant(Mapping\FetchMode::class . '::' . $associationOverride->fetch) |
|
1184 | + constant(Mapping\FetchMode::class.'::'.$associationOverride->fetch) |
|
1185 | 1185 | ); |
1186 | 1186 | } |
1187 | 1187 | |
@@ -1190,7 +1190,7 @@ discard block |
||
1190 | 1190 | } |
1191 | 1191 | |
1192 | 1192 | // Evaluate AttributeOverrides annotation |
1193 | - if (! isset($classAnnotations[Annotation\AttributeOverrides::class])) { |
|
1193 | + if ( ! isset($classAnnotations[Annotation\AttributeOverrides::class])) { |
|
1194 | 1194 | return; |
1195 | 1195 | } |
1196 | 1196 | |
@@ -1217,7 +1217,7 @@ discard block |
||
1217 | 1217 | Mapping\ClassMetadata $metadata |
1218 | 1218 | ) : void { |
1219 | 1219 | // Check for Cache |
1220 | - if (! isset($propertyAnnotations[Annotation\Cache::class])) { |
|
1220 | + if ( ! isset($propertyAnnotations[Annotation\Cache::class])) { |
|
1221 | 1221 | return; |
1222 | 1222 | } |
1223 | 1223 | |
@@ -1274,7 +1274,7 @@ discard block |
||
1274 | 1274 | { |
1275 | 1275 | $fetchModeConstant = sprintf('%s::%s', Mapping\FetchMode::class, $fetchMode); |
1276 | 1276 | |
1277 | - if (! defined($fetchModeConstant)) { |
|
1277 | + if ( ! defined($fetchModeConstant)) { |
|
1278 | 1278 | throw Mapping\MappingException::invalidFetchMode($className, $fetchMode); |
1279 | 1279 | } |
1280 | 1280 | |
@@ -1304,7 +1304,7 @@ discard block |
||
1304 | 1304 | $callbacks = []; |
1305 | 1305 | |
1306 | 1306 | foreach ($events as $eventName => $annotationClassName) { |
1307 | - if (! isset($annotations[$annotationClassName]) && $method->getName() !== $eventName) { |
|
1307 | + if ( ! isset($annotations[$annotationClassName]) && $method->getName() !== $eventName) { |
|
1308 | 1308 | continue; |
1309 | 1309 | } |
1310 | 1310 | |
@@ -1322,7 +1322,7 @@ discard block |
||
1322 | 1322 | $classAnnotations = $this->reader->getClassAnnotations($reflectionClass); |
1323 | 1323 | |
1324 | 1324 | foreach ($classAnnotations as $key => $annot) { |
1325 | - if (! is_numeric($key)) { |
|
1325 | + if ( ! is_numeric($key)) { |
|
1326 | 1326 | continue; |
1327 | 1327 | } |
1328 | 1328 | |
@@ -1340,7 +1340,7 @@ discard block |
||
1340 | 1340 | $propertyAnnotations = $this->reader->getPropertyAnnotations($reflectionProperty); |
1341 | 1341 | |
1342 | 1342 | foreach ($propertyAnnotations as $key => $annot) { |
1343 | - if (! is_numeric($key)) { |
|
1343 | + if ( ! is_numeric($key)) { |
|
1344 | 1344 | continue; |
1345 | 1345 | } |
1346 | 1346 | |
@@ -1358,7 +1358,7 @@ discard block |
||
1358 | 1358 | $methodAnnotations = $this->reader->getMethodAnnotations($reflectionMethod); |
1359 | 1359 | |
1360 | 1360 | foreach ($methodAnnotations as $key => $annot) { |
1361 | - if (! is_numeric($key)) { |
|
1361 | + if ( ! is_numeric($key)) { |
|
1362 | 1362 | continue; |
1363 | 1363 | } |
1364 | 1364 |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | |
414 | 414 | if (isset($manyToOneElement['fetch'])) { |
415 | 415 | $association->setFetchMode( |
416 | - constant('Doctrine\ORM\Mapping\FetchMode::' . (string) $manyToOneElement['fetch']) |
|
416 | + constant('Doctrine\ORM\Mapping\FetchMode::'.(string) $manyToOneElement['fetch']) |
|
417 | 417 | ); |
418 | 418 | } |
419 | 419 | |
@@ -566,7 +566,7 @@ discard block |
||
566 | 566 | $fieldName = (string) $overrideElement['name']; |
567 | 567 | $property = $metadata->getProperty($fieldName); |
568 | 568 | |
569 | - if (! $property) { |
|
569 | + if ( ! $property) { |
|
570 | 570 | throw Mapping\MappingException::invalidOverrideFieldName($metadata->getClassName(), $fieldName); |
571 | 571 | } |
572 | 572 | |
@@ -624,7 +624,7 @@ discard block |
||
624 | 624 | // Check for fetch |
625 | 625 | if (isset($overrideElement['fetch'])) { |
626 | 626 | $override->setFetchMode( |
627 | - constant('Doctrine\ORM\Mapping\FetchMode::' . (string) $overrideElement['fetch']) |
|
627 | + constant('Doctrine\ORM\Mapping\FetchMode::'.(string) $overrideElement['fetch']) |
|
628 | 628 | ); |
629 | 629 | } |
630 | 630 | |
@@ -635,7 +635,7 @@ discard block |
||
635 | 635 | // Evaluate <lifecycle-callbacks...> |
636 | 636 | if (isset($xmlRoot->{'lifecycle-callbacks'})) { |
637 | 637 | foreach ($xmlRoot->{'lifecycle-callbacks'}->{'lifecycle-callback'} as $lifecycleCallback) { |
638 | - $eventName = constant(Events::class . '::' . (string) $lifecycleCallback['type']); |
|
638 | + $eventName = constant(Events::class.'::'.(string) $lifecycleCallback['type']); |
|
639 | 639 | $methodName = (string) $lifecycleCallback['method']; |
640 | 640 | |
641 | 641 | $metadata->addLifecycleCallback($methodName, $eventName); |
@@ -643,14 +643,14 @@ discard block |
||
643 | 643 | } |
644 | 644 | |
645 | 645 | // Evaluate entity listener |
646 | - if (! isset($xmlRoot->{'entity-listeners'})) { |
|
646 | + if ( ! isset($xmlRoot->{'entity-listeners'})) { |
|
647 | 647 | return; |
648 | 648 | } |
649 | 649 | |
650 | 650 | foreach ($xmlRoot->{'entity-listeners'}->{'entity-listener'} as $listenerElement) { |
651 | 651 | $listenerClassName = (string) $listenerElement['class']; |
652 | 652 | |
653 | - if (! class_exists($listenerClassName)) { |
|
653 | + if ( ! class_exists($listenerClassName)) { |
|
654 | 654 | throw Mapping\MappingException::entityListenerClassNotFound( |
655 | 655 | $listenerClassName, |
656 | 656 | $metadata->getClassName() |
@@ -816,7 +816,7 @@ discard block |
||
816 | 816 | $fieldName = null |
817 | 817 | ) { |
818 | 818 | $baseRegion = strtolower(str_replace('\\', '_', $metadata->getRootClassName())); |
819 | - $defaultRegion = $baseRegion . ($fieldName ? '__' . $fieldName : ''); |
|
819 | + $defaultRegion = $baseRegion.($fieldName ? '__'.$fieldName : ''); |
|
820 | 820 | |
821 | 821 | $region = (string) ($cacheMapping['region'] ?? $defaultRegion); |
822 | 822 | $usage = isset($cacheMapping['usage']) |
@@ -845,7 +845,7 @@ discard block |
||
845 | 845 | Events::preFlush, |
846 | 846 | ]; |
847 | 847 | |
848 | - return array_filter($events, function ($eventName) use ($method) { |
|
848 | + return array_filter($events, function($eventName) use ($method) { |
|
849 | 849 | return $eventName === $method->getName(); |
850 | 850 | }); |
851 | 851 | } |
@@ -57,7 +57,7 @@ |
||
57 | 57 | { |
58 | 58 | parent::addDeclaredProperty($property); |
59 | 59 | |
60 | - if (! ($property instanceof VersionFieldMetadata)) { |
|
60 | + if ( ! ($property instanceof VersionFieldMetadata)) { |
|
61 | 61 | return; |
62 | 62 | } |
63 | 63 |
@@ -23,7 +23,7 @@ |
||
23 | 23 | { |
24 | 24 | parent::__clone(); |
25 | 25 | |
26 | - if (! $this->joinTable) { |
|
26 | + if ( ! $this->joinTable) { |
|
27 | 27 | return; |
28 | 28 | } |
29 | 29 |
@@ -243,7 +243,7 @@ |
||
243 | 243 | |
244 | 244 | public function __clone() |
245 | 245 | { |
246 | - if (! $this->cache) { |
|
246 | + if ( ! $this->cache) { |
|
247 | 247 | return; |
248 | 248 | } |
249 | 249 |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | */ |
263 | 263 | public function __toString() |
264 | 264 | { |
265 | - return __CLASS__ . '@' . spl_object_id($this); |
|
265 | + return __CLASS__.'@'.spl_object_id($this); |
|
266 | 266 | } |
267 | 267 | |
268 | 268 | /** |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | // Restore ReflectionClass and properties |
350 | 350 | $this->reflectionClass = $reflectionService->getClass($this->className); |
351 | 351 | |
352 | - if (! $this->reflectionClass) { |
|
352 | + if ( ! $this->reflectionClass) { |
|
353 | 353 | return; |
354 | 354 | } |
355 | 355 | |
@@ -373,11 +373,11 @@ discard block |
||
373 | 373 | } |
374 | 374 | |
375 | 375 | // Verify & complete identifier mapping |
376 | - if (! $this->identifier) { |
|
376 | + if ( ! $this->identifier) { |
|
377 | 377 | throw MappingException::identifierRequired($this->className); |
378 | 378 | } |
379 | 379 | |
380 | - $explicitlyGeneratedProperties = array_filter($this->declaredProperties, function (Property $property) : bool { |
|
380 | + $explicitlyGeneratedProperties = array_filter($this->declaredProperties, function(Property $property) : bool { |
|
381 | 381 | return $property instanceof FieldMetadata |
382 | 382 | && $property->isPrimaryKey() |
383 | 383 | && $property->hasValueGenerator(); |
@@ -396,14 +396,14 @@ discard block |
||
396 | 396 | public function validateAssociations() : void |
397 | 397 | { |
398 | 398 | array_map( |
399 | - function (Property $property) { |
|
400 | - if (! ($property instanceof AssociationMetadata)) { |
|
399 | + function(Property $property) { |
|
400 | + if ( ! ($property instanceof AssociationMetadata)) { |
|
401 | 401 | return; |
402 | 402 | } |
403 | 403 | |
404 | 404 | $targetEntity = $property->getTargetEntity(); |
405 | 405 | |
406 | - if (! class_exists($targetEntity)) { |
|
406 | + if ( ! class_exists($targetEntity)) { |
|
407 | 407 | throw MappingException::invalidTargetEntityClass($targetEntity, $this->className, $property->getName()); |
408 | 408 | } |
409 | 409 | }, |
@@ -421,7 +421,7 @@ discard block |
||
421 | 421 | foreach ($this->lifecycleCallbacks as $callbacks) { |
422 | 422 | /** @var array $callbacks */ |
423 | 423 | foreach ($callbacks as $callbackFuncName) { |
424 | - if (! $reflectionService->hasPublicMethod($this->className, $callbackFuncName)) { |
|
424 | + if ( ! $reflectionService->hasPublicMethod($this->className, $callbackFuncName)) { |
|
425 | 425 | throw MappingException::lifecycleCallbackMethodNotFound($this->className, $callbackFuncName); |
426 | 426 | } |
427 | 427 | } |
@@ -445,11 +445,11 @@ discard block |
||
445 | 445 | */ |
446 | 446 | public function isIdentifier(string $fieldName) : bool |
447 | 447 | { |
448 | - if (! $this->identifier) { |
|
448 | + if ( ! $this->identifier) { |
|
449 | 449 | return false; |
450 | 450 | } |
451 | 451 | |
452 | - if (! $this->isIdentifierComposite()) { |
|
452 | + if ( ! $this->isIdentifierComposite()) { |
|
453 | 453 | return $fieldName === $this->identifier[0]; |
454 | 454 | } |
455 | 455 | |
@@ -477,7 +477,7 @@ discard block |
||
477 | 477 | $property->setColumnName($columnName); |
478 | 478 | } |
479 | 479 | |
480 | - if (! $this->isMappedSuperclass) { |
|
480 | + if ( ! $this->isMappedSuperclass) { |
|
481 | 481 | $property->setTableName($this->getTableName()); |
482 | 482 | } |
483 | 483 | |
@@ -497,7 +497,7 @@ discard block |
||
497 | 497 | throw MappingException::sqlConversionNotAllowedForPrimaryKeyProperties($this->className, $property); |
498 | 498 | } |
499 | 499 | |
500 | - if (! in_array($fieldName, $this->identifier, true)) { |
|
500 | + if ( ! in_array($fieldName, $this->identifier, true)) { |
|
501 | 501 | $this->identifier[] = $fieldName; |
502 | 502 | } |
503 | 503 | } |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | $fieldName = $property->getName(); |
548 | 548 | $targetEntity = $property->getTargetEntity(); |
549 | 549 | |
550 | - if (! $targetEntity) { |
|
550 | + if ( ! $targetEntity) { |
|
551 | 551 | throw MappingException::missingTargetEntity($fieldName); |
552 | 552 | } |
553 | 553 | |
@@ -560,7 +560,7 @@ discard block |
||
560 | 560 | throw MappingException::illegalOrphanRemovalOnIdentifierAssociation($this->className, $fieldName); |
561 | 561 | } |
562 | 562 | |
563 | - if (! in_array($property->getName(), $this->identifier, true)) { |
|
563 | + if ( ! in_array($property->getName(), $this->identifier, true)) { |
|
564 | 564 | if ($property instanceof ToOneAssociationMetadata && count($property->getJoinColumns()) >= 2) { |
565 | 565 | throw MappingException::cannotMapCompositePrimaryKeyEntitiesAsForeignId( |
566 | 566 | $property->getTargetEntity(), |
@@ -622,7 +622,7 @@ discard block |
||
622 | 622 | /** @var JoinColumnMetadata $joinColumn */ |
623 | 623 | if ($property instanceof OneToOneAssociationMetadata && $this->inheritanceType !== InheritanceType::SINGLE_TABLE) { |
624 | 624 | if (count($property->getJoinColumns()) === 1) { |
625 | - if (! $property->isPrimaryKey()) { |
|
625 | + if ( ! $property->isPrimaryKey()) { |
|
626 | 626 | $joinColumn->setUnique(true); |
627 | 627 | } |
628 | 628 | } else { |
@@ -630,13 +630,13 @@ discard block |
||
630 | 630 | } |
631 | 631 | } |
632 | 632 | |
633 | - $joinColumn->setTableName(! $this->isMappedSuperclass ? $this->getTableName() : null); |
|
633 | + $joinColumn->setTableName( ! $this->isMappedSuperclass ? $this->getTableName() : null); |
|
634 | 634 | |
635 | - if (! $joinColumn->getColumnName()) { |
|
635 | + if ( ! $joinColumn->getColumnName()) { |
|
636 | 636 | $joinColumn->setColumnName($this->namingStrategy->joinColumnName($fieldName, $this->className)); |
637 | 637 | } |
638 | 638 | |
639 | - if (! $joinColumn->getReferencedColumnName()) { |
|
639 | + if ( ! $joinColumn->getReferencedColumnName()) { |
|
640 | 640 | $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
641 | 641 | } |
642 | 642 | |
@@ -644,7 +644,7 @@ discard block |
||
644 | 644 | } |
645 | 645 | |
646 | 646 | if ($uniqueConstraintColumns) { |
647 | - if (! $this->table) { |
|
647 | + if ( ! $this->table) { |
|
648 | 648 | throw new \RuntimeException( |
649 | 649 | 'ClassMetadata::setTable() has to be called before defining a one to one relationship.' |
650 | 650 | ); |
@@ -664,7 +664,7 @@ discard block |
||
664 | 664 | if ($property->isOrphanRemoval()) { |
665 | 665 | $cascades = $property->getCascade(); |
666 | 666 | |
667 | - if (! in_array('remove', $cascades, true)) { |
|
667 | + if ( ! in_array('remove', $cascades, true)) { |
|
668 | 668 | $cascades[] = 'remove'; |
669 | 669 | |
670 | 670 | $property->setCascade($cascades); |
@@ -727,11 +727,11 @@ discard block |
||
727 | 727 | protected function validateAndCompleteOneToManyMapping(OneToManyAssociationMetadata $property) |
728 | 728 | { |
729 | 729 | // OneToMany MUST have mappedBy |
730 | - if (! $property->getMappedBy()) { |
|
730 | + if ( ! $property->getMappedBy()) { |
|
731 | 731 | throw MappingException::oneToManyRequiresMappedBy($property->getName()); |
732 | 732 | } |
733 | 733 | |
734 | - if (! $property->isOrphanRemoval()) { |
|
734 | + if ( ! $property->isOrphanRemoval()) { |
|
735 | 735 | return; |
736 | 736 | } |
737 | 737 | |
@@ -755,7 +755,7 @@ discard block |
||
755 | 755 | */ |
756 | 756 | protected function validateAndCompleteManyToManyMapping(ManyToManyAssociationMetadata $property) |
757 | 757 | { |
758 | - if (! $property->isOwningSide()) { |
|
758 | + if ( ! $property->isOwningSide()) { |
|
759 | 759 | return; |
760 | 760 | } |
761 | 761 | |
@@ -764,7 +764,7 @@ discard block |
||
764 | 764 | |
765 | 765 | $property->setJoinTable($joinTable); |
766 | 766 | |
767 | - if (! $joinTable->getName()) { |
|
767 | + if ( ! $joinTable->getName()) { |
|
768 | 768 | $joinTableName = $this->namingStrategy->joinTableName( |
769 | 769 | $property->getSourceEntity(), |
770 | 770 | $property->getTargetEntity(), |
@@ -776,7 +776,7 @@ discard block |
||
776 | 776 | |
777 | 777 | $selfReferencingEntityWithoutJoinColumns = $property->getSourceEntity() === $property->getTargetEntity() && ! $joinTable->hasColumns(); |
778 | 778 | |
779 | - if (! $joinTable->getJoinColumns()) { |
|
779 | + if ( ! $joinTable->getJoinColumns()) { |
|
780 | 780 | $referencedColumnName = $this->namingStrategy->referenceColumnName(); |
781 | 781 | $sourceReferenceName = $selfReferencingEntityWithoutJoinColumns ? 'source' : $referencedColumnName; |
782 | 782 | $columnName = $this->namingStrategy->joinKeyColumnName($property->getSourceEntity(), $sourceReferenceName); |
@@ -789,7 +789,7 @@ discard block |
||
789 | 789 | $joinTable->addJoinColumn($joinColumn); |
790 | 790 | } |
791 | 791 | |
792 | - if (! $joinTable->getInverseJoinColumns()) { |
|
792 | + if ( ! $joinTable->getInverseJoinColumns()) { |
|
793 | 793 | $referencedColumnName = $this->namingStrategy->referenceColumnName(); |
794 | 794 | $targetReferenceName = $selfReferencingEntityWithoutJoinColumns ? 'target' : $referencedColumnName; |
795 | 795 | $columnName = $this->namingStrategy->joinKeyColumnName($property->getTargetEntity(), $targetReferenceName); |
@@ -804,7 +804,7 @@ discard block |
||
804 | 804 | |
805 | 805 | foreach ($joinTable->getJoinColumns() as $joinColumn) { |
806 | 806 | /** @var JoinColumnMetadata $joinColumn */ |
807 | - if (! $joinColumn->getReferencedColumnName()) { |
|
807 | + if ( ! $joinColumn->getReferencedColumnName()) { |
|
808 | 808 | $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
809 | 809 | } |
810 | 810 | |
@@ -824,7 +824,7 @@ discard block |
||
824 | 824 | |
825 | 825 | foreach ($joinTable->getInverseJoinColumns() as $inverseJoinColumn) { |
826 | 826 | /** @var JoinColumnMetadata $inverseJoinColumn */ |
827 | - if (! $inverseJoinColumn->getReferencedColumnName()) { |
|
827 | + if ( ! $inverseJoinColumn->getReferencedColumnName()) { |
|
828 | 828 | $inverseJoinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
829 | 829 | } |
830 | 830 | |
@@ -865,7 +865,7 @@ discard block |
||
865 | 865 | throw MappingException::singleIdNotAllowedOnCompositePrimaryKey($this->className); |
866 | 866 | } |
867 | 867 | |
868 | - if (! isset($this->identifier[0])) { |
|
868 | + if ( ! isset($this->identifier[0])) { |
|
869 | 869 | throw MappingException::noIdDefined($this->className); |
870 | 870 | } |
871 | 871 | |
@@ -924,7 +924,7 @@ discard block |
||
924 | 924 | // Association defined as Id field |
925 | 925 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
926 | 926 | |
927 | - if (! $property->isOwningSide()) { |
|
927 | + if ( ! $property->isOwningSide()) { |
|
928 | 928 | $property = $targetClass->getProperty($property->getMappedBy()); |
929 | 929 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
930 | 930 | } |
@@ -939,7 +939,7 @@ discard block |
||
939 | 939 | $columnName = $joinColumn->getColumnName(); |
940 | 940 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
941 | 941 | |
942 | - if (! $joinColumn->getType()) { |
|
942 | + if ( ! $joinColumn->getType()) { |
|
943 | 943 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $em)); |
944 | 944 | } |
945 | 945 | |
@@ -973,11 +973,11 @@ discard block |
||
973 | 973 | { |
974 | 974 | $schema = $this->getSchemaName() === null |
975 | 975 | ? '' |
976 | - : $this->getSchemaName() . '_' |
|
976 | + : $this->getSchemaName().'_' |
|
977 | 977 | ; |
978 | 978 | |
979 | 979 | // replace dots with underscores because PostgreSQL creates temporary tables in a special schema |
980 | - return $schema . $this->getTableName() . '_id_tmp'; |
|
980 | + return $schema.$this->getTableName().'_id_tmp'; |
|
981 | 981 | } |
982 | 982 | |
983 | 983 | /** |
@@ -1011,7 +1011,7 @@ discard block |
||
1011 | 1011 | */ |
1012 | 1012 | public function setInheritanceType($type) : void |
1013 | 1013 | { |
1014 | - if (! $this->isInheritanceType($type)) { |
|
1014 | + if ( ! $this->isInheritanceType($type)) { |
|
1015 | 1015 | throw MappingException::invalidInheritanceType($this->className, $type); |
1016 | 1016 | } |
1017 | 1017 | |
@@ -1029,7 +1029,7 @@ discard block |
||
1029 | 1029 | { |
1030 | 1030 | $fieldName = $property->getName(); |
1031 | 1031 | |
1032 | - if (! isset($this->declaredProperties[$fieldName])) { |
|
1032 | + if ( ! isset($this->declaredProperties[$fieldName])) { |
|
1033 | 1033 | throw MappingException::invalidOverrideFieldName($this->className, $fieldName); |
1034 | 1034 | } |
1035 | 1035 | |
@@ -1124,7 +1124,7 @@ discard block |
||
1124 | 1124 | { |
1125 | 1125 | $this->table = $table; |
1126 | 1126 | |
1127 | - if (! empty($table->getName())) { |
|
1127 | + if ( ! empty($table->getName())) { |
|
1128 | 1128 | return; |
1129 | 1129 | } |
1130 | 1130 | |
@@ -1228,7 +1228,7 @@ discard block |
||
1228 | 1228 | $declaringClass = $property->getDeclaringClass(); |
1229 | 1229 | |
1230 | 1230 | if ($inheritedProperty instanceof FieldMetadata) { |
1231 | - if (! $declaringClass->isMappedSuperclass) { |
|
1231 | + if ( ! $declaringClass->isMappedSuperclass) { |
|
1232 | 1232 | $inheritedProperty->setTableName($property->getTableName()); |
1233 | 1233 | } |
1234 | 1234 | |
@@ -1253,7 +1253,7 @@ discard block |
||
1253 | 1253 | |
1254 | 1254 | $this->declaredProperties[$property->getName()] = $inheritedProperty; |
1255 | 1255 | |
1256 | - if (! ($inheritedProperty instanceof VersionFieldMetadata)) { |
|
1256 | + if ( ! ($inheritedProperty instanceof VersionFieldMetadata)) { |
|
1257 | 1257 | return; |
1258 | 1258 | } |
1259 | 1259 | |
@@ -1341,11 +1341,11 @@ discard block |
||
1341 | 1341 | 'method' => $method, |
1342 | 1342 | ]; |
1343 | 1343 | |
1344 | - if (! class_exists($class)) { |
|
1344 | + if ( ! class_exists($class)) { |
|
1345 | 1345 | throw MappingException::entityListenerClassNotFound($class, $this->className); |
1346 | 1346 | } |
1347 | 1347 | |
1348 | - if (! method_exists($class, $method)) { |
|
1348 | + if ( ! method_exists($class, $method)) { |
|
1349 | 1349 | throw MappingException::entityListenerMethodNotFound($class, $method, $this->className); |
1350 | 1350 | } |
1351 | 1351 | |
@@ -1412,11 +1412,11 @@ discard block |
||
1412 | 1412 | return; |
1413 | 1413 | } |
1414 | 1414 | |
1415 | - if (! (class_exists($className) || interface_exists($className))) { |
|
1415 | + if ( ! (class_exists($className) || interface_exists($className))) { |
|
1416 | 1416 | throw MappingException::invalidClassInDiscriminatorMap($className, $this->className); |
1417 | 1417 | } |
1418 | 1418 | |
1419 | - if (! is_subclass_of($className, $this->className) || in_array($className, $this->subClasses, true)) { |
|
1419 | + if ( ! is_subclass_of($className, $this->className) || in_array($className, $this->subClasses, true)) { |
|
1420 | 1420 | return; |
1421 | 1421 | } |
1422 | 1422 |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $normalizedAssociatedId = []; |
36 | 36 | |
37 | 37 | foreach ($targetClass->getDeclaredPropertiesIterator() as $name => $declaredProperty) { |
38 | - if (! array_key_exists($name, $flatIdentifier)) { |
|
38 | + if ( ! array_key_exists($name, $flatIdentifier)) { |
|
39 | 39 | continue; |
40 | 40 | } |
41 | 41 | |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | continue; |
46 | 46 | } |
47 | 47 | |
48 | - if (! ($declaredProperty instanceof ToOneAssociationMetadata)) { |
|
48 | + if ( ! ($declaredProperty instanceof ToOneAssociationMetadata)) { |
|
49 | 49 | continue; |
50 | 50 | } |
51 | 51 |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | { |
37 | 37 | $association = $collection->getMapping(); |
38 | 38 | |
39 | - if (! $association->isOwningSide()) { |
|
39 | + if ( ! $association->isOwningSide()) { |
|
40 | 40 | return; // ignore inverse side |
41 | 41 | } |
42 | 42 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | /** @var JoinColumnMetadata $joinColumn */ |
49 | 49 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
50 | 50 | |
51 | - if (! $joinColumn->getType()) { |
|
51 | + if ( ! $joinColumn->getType()) { |
|
52 | 52 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em)); |
53 | 53 | } |
54 | 54 | |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | { |
69 | 69 | $association = $collection->getMapping(); |
70 | 70 | |
71 | - if (! $association->isOwningSide()) { |
|
71 | + if ( ! $association->isOwningSide()) { |
|
72 | 72 | return; // ignore inverse side |
73 | 73 | } |
74 | 74 | |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | { |
100 | 100 | $association = $collection->getMapping(); |
101 | 101 | |
102 | - if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
102 | + if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
103 | 103 | throw new \BadMethodCallException('Selecting a collection by index is only supported on indexed collections.'); |
104 | 104 | } |
105 | 105 | |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
147 | 147 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
148 | 148 | |
149 | - if (! $joinColumn->getType()) { |
|
149 | + if ( ! $joinColumn->getType()) { |
|
150 | 150 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $sourceClass, $this->em)); |
151 | 151 | } |
152 | 152 | |
@@ -178,9 +178,9 @@ discard block |
||
178 | 178 | }*/ |
179 | 179 | |
180 | 180 | $sql = 'SELECT COUNT(*)' |
181 | - . ' FROM ' . $joinTableName . ' t' |
|
181 | + . ' FROM '.$joinTableName.' t' |
|
182 | 182 | . $joinTargetEntitySQL |
183 | - . ' WHERE ' . implode(' AND ', $conditions); |
|
183 | + . ' WHERE '.implode(' AND ', $conditions); |
|
184 | 184 | |
185 | 185 | return $this->conn->fetchColumn($sql, $params, 0, $types); |
186 | 186 | } |
@@ -202,13 +202,13 @@ discard block |
||
202 | 202 | { |
203 | 203 | $association = $collection->getMapping(); |
204 | 204 | |
205 | - if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
205 | + if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
206 | 206 | throw new \BadMethodCallException('Selecting a collection by index is only supported on indexed collections.'); |
207 | 207 | } |
208 | 208 | |
209 | 209 | list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictionsWithKey($collection, $key, true); |
210 | 210 | |
211 | - $sql = 'SELECT 1 FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); |
|
211 | + $sql = 'SELECT 1 FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses); |
|
212 | 212 | |
213 | 213 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
214 | 214 | } |
@@ -218,13 +218,13 @@ discard block |
||
218 | 218 | */ |
219 | 219 | public function contains(PersistentCollection $collection, $element) |
220 | 220 | { |
221 | - if (! $this->isValidEntityState($element)) { |
|
221 | + if ( ! $this->isValidEntityState($element)) { |
|
222 | 222 | return false; |
223 | 223 | } |
224 | 224 | |
225 | 225 | list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictions($collection, $element, true); |
226 | 226 | |
227 | - $sql = 'SELECT 1 FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); |
|
227 | + $sql = 'SELECT 1 FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses); |
|
228 | 228 | |
229 | 229 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
230 | 230 | } |
@@ -234,13 +234,13 @@ discard block |
||
234 | 234 | */ |
235 | 235 | public function removeElement(PersistentCollection $collection, $element) |
236 | 236 | { |
237 | - if (! $this->isValidEntityState($element)) { |
|
237 | + if ( ! $this->isValidEntityState($element)) { |
|
238 | 238 | return false; |
239 | 239 | } |
240 | 240 | |
241 | 241 | list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictions($collection, $element, false); |
242 | 242 | |
243 | - $sql = 'DELETE FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); |
|
243 | + $sql = 'DELETE FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses); |
|
244 | 244 | |
245 | 245 | return (bool) $this->conn->executeUpdate($sql, $params, $types); |
246 | 246 | } |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | $onConditions = $this->getOnConditionSQL($association); |
259 | 259 | $whereClauses = $params = $types = []; |
260 | 260 | |
261 | - if (! $association->isOwningSide()) { |
|
261 | + if ( ! $association->isOwningSide()) { |
|
262 | 262 | $association = $targetClass->getProperty($association->getMappedBy()); |
263 | 263 | $joinColumns = $association->getJoinTable()->getInverseJoinColumns(); |
264 | 264 | } else { |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
271 | 271 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
272 | 272 | |
273 | - if (! $joinColumn->getType()) { |
|
273 | + if ( ! $joinColumn->getType()) { |
|
274 | 274 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $ownerMetadata, $this->em)); |
275 | 275 | } |
276 | 276 | |
@@ -298,11 +298,11 @@ discard block |
||
298 | 298 | |
299 | 299 | $resultSetMapping->addRootEntityFromClassMetadata($targetClass->getClassName(), 'te'); |
300 | 300 | |
301 | - $sql = 'SELECT ' . $resultSetMapping->generateSelectClause() |
|
302 | - . ' FROM ' . $tableName . ' te' |
|
303 | - . ' JOIN ' . $joinTableName . ' t ON' |
|
301 | + $sql = 'SELECT '.$resultSetMapping->generateSelectClause() |
|
302 | + . ' FROM '.$tableName.' te' |
|
303 | + . ' JOIN '.$joinTableName.' t ON' |
|
304 | 304 | . implode(' AND ', $onConditions) |
305 | - . ' WHERE ' . implode(' AND ', $whereClauses); |
|
305 | + . ' WHERE '.implode(' AND ', $whereClauses); |
|
306 | 306 | |
307 | 307 | $sql .= $this->getOrderingSql($criteria, $targetClass); |
308 | 308 | $sql .= $this->getLimitSql($criteria); |
@@ -337,8 +337,8 @@ discard block |
||
337 | 337 | |
338 | 338 | // A join is needed if there is filtering on the target entity |
339 | 339 | $tableName = $rootClass->table->getQuotedQualifiedName($this->platform); |
340 | - $joinSql = ' JOIN ' . $tableName . ' te' |
|
341 | - . ' ON' . implode(' AND ', $this->getOnConditionSQL($association)); |
|
340 | + $joinSql = ' JOIN '.$tableName.' te' |
|
341 | + . ' ON'.implode(' AND ', $this->getOnConditionSQL($association)); |
|
342 | 342 | |
343 | 343 | return [$joinSql, $filterSql]; |
344 | 344 | } |
@@ -358,21 +358,21 @@ discard block |
||
358 | 358 | foreach ($this->em->getFilters()->getEnabledFilters() as $filter) { |
359 | 359 | $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias); |
360 | 360 | |
361 | - if (! $filterExpr) { |
|
361 | + if ( ! $filterExpr) { |
|
362 | 362 | continue; |
363 | 363 | } |
364 | 364 | |
365 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
365 | + $filterClauses[] = '('.$filterExpr.')'; |
|
366 | 366 | } |
367 | 367 | |
368 | - if (! $filterClauses) { |
|
368 | + if ( ! $filterClauses) { |
|
369 | 369 | return ''; |
370 | 370 | } |
371 | 371 | |
372 | 372 | $filterSql = implode(' AND ', $filterClauses); |
373 | 373 | |
374 | 374 | return isset($filterClauses[1]) |
375 | - ? '(' . $filterSql . ')' |
|
375 | + ? '('.$filterSql.')' |
|
376 | 376 | : $filterSql |
377 | 377 | ; |
378 | 378 | } |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
402 | 402 | $quotedReferencedColumnName = $this->platform->quoteIdentifier($joinColumn->getReferencedColumnName()); |
403 | 403 | |
404 | - $conditions[] = ' t.' . $quotedColumnName . ' = te.' . $quotedReferencedColumnName; |
|
404 | + $conditions[] = ' t.'.$quotedColumnName.' = te.'.$quotedReferencedColumnName; |
|
405 | 405 | } |
406 | 406 | |
407 | 407 | return $conditions; |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | $columns[] = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
424 | 424 | } |
425 | 425 | |
426 | - return 'DELETE FROM ' . $joinTableName . ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?'; |
|
426 | + return 'DELETE FROM '.$joinTableName.' WHERE '.implode(' = ? AND ', $columns).' = ?'; |
|
427 | 427 | } |
428 | 428 | |
429 | 429 | /** |
@@ -478,7 +478,7 @@ discard block |
||
478 | 478 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
479 | 479 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
480 | 480 | |
481 | - if (! $joinColumn->getType()) { |
|
481 | + if ( ! $joinColumn->getType()) { |
|
482 | 482 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em)); |
483 | 483 | } |
484 | 484 | |
@@ -491,7 +491,7 @@ discard block |
||
491 | 491 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
492 | 492 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
493 | 493 | |
494 | - if (! $joinColumn->getType()) { |
|
494 | + if ( ! $joinColumn->getType()) { |
|
495 | 495 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
496 | 496 | } |
497 | 497 | |
@@ -542,7 +542,7 @@ discard block |
||
542 | 542 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
543 | 543 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
544 | 544 | |
545 | - if (! $joinColumn->getType()) { |
|
545 | + if ( ! $joinColumn->getType()) { |
|
546 | 546 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em)); |
547 | 547 | } |
548 | 548 | |
@@ -555,7 +555,7 @@ discard block |
||
555 | 555 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
556 | 556 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
557 | 557 | |
558 | - if (! $joinColumn->getType()) { |
|
558 | + if ( ! $joinColumn->getType()) { |
|
559 | 559 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
560 | 560 | } |
561 | 561 | |
@@ -639,7 +639,7 @@ discard block |
||
639 | 639 | $sourceClass = $this->em->getClassMetadata($owningAssociation->getSourceEntity()); |
640 | 640 | $targetClass = $this->em->getClassMetadata($owningAssociation->getTargetEntity()); |
641 | 641 | |
642 | - if (! $owningAssociation->isOwningSide()) { |
|
642 | + if ( ! $owningAssociation->isOwningSide()) { |
|
643 | 643 | $owningAssociation = $targetClass->getProperty($owningAssociation->getMappedBy()); |
644 | 644 | $joinTable = $owningAssociation->getJoinTable(); |
645 | 645 | $joinColumns = $joinTable->getJoinColumns(); |
@@ -651,7 +651,7 @@ discard block |
||
651 | 651 | } |
652 | 652 | |
653 | 653 | $joinTableName = $joinTable->getQuotedQualifiedName($this->platform); |
654 | - $quotedJoinTable = $joinTableName . ' t'; |
|
654 | + $quotedJoinTable = $joinTableName.' t'; |
|
655 | 655 | $whereClauses = []; |
656 | 656 | $params = []; |
657 | 657 | $types = []; |
@@ -665,11 +665,11 @@ discard block |
||
665 | 665 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
666 | 666 | $quotedReferencedColumnName = $this->platform->quoteIdentifier($joinColumn->getReferencedColumnName()); |
667 | 667 | |
668 | - $joinConditions[] = ' t.' . $quotedColumnName . ' = tr.' . $quotedReferencedColumnName; |
|
668 | + $joinConditions[] = ' t.'.$quotedColumnName.' = tr.'.$quotedReferencedColumnName; |
|
669 | 669 | } |
670 | 670 | |
671 | 671 | $tableName = $targetClass->table->getQuotedQualifiedName($this->platform); |
672 | - $quotedJoinTable .= ' JOIN ' . $tableName . ' tr ON ' . implode(' AND ', $joinConditions); |
|
672 | + $quotedJoinTable .= ' JOIN '.$tableName.' tr ON '.implode(' AND ', $joinConditions); |
|
673 | 673 | $indexByProperty = $targetClass->getProperty($indexBy); |
674 | 674 | |
675 | 675 | switch (true) { |
@@ -692,7 +692,7 @@ discard block |
||
692 | 692 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
693 | 693 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
694 | 694 | |
695 | - if (! $joinColumn->getType()) { |
|
695 | + if ( ! $joinColumn->getType()) { |
|
696 | 696 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $sourceClass, $this->em)); |
697 | 697 | } |
698 | 698 | |
@@ -701,13 +701,13 @@ discard block |
||
701 | 701 | $types[] = $joinColumn->getType(); |
702 | 702 | } |
703 | 703 | |
704 | - if (! $joinNeeded) { |
|
704 | + if ( ! $joinNeeded) { |
|
705 | 705 | foreach ($joinColumns as $joinColumn) { |
706 | 706 | /** @var JoinColumnMetadata $joinColumn */ |
707 | 707 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
708 | 708 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
709 | 709 | |
710 | - if (! $joinColumn->getType()) { |
|
710 | + if ( ! $joinColumn->getType()) { |
|
711 | 711 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
712 | 712 | } |
713 | 713 | |
@@ -721,7 +721,7 @@ discard block |
||
721 | 721 | list($joinTargetEntitySQL, $filterSql) = $this->getFilterSql($association); |
722 | 722 | |
723 | 723 | if ($filterSql) { |
724 | - $quotedJoinTable .= ' ' . $joinTargetEntitySQL; |
|
724 | + $quotedJoinTable .= ' '.$joinTargetEntitySQL; |
|
725 | 725 | $whereClauses[] = $filterSql; |
726 | 726 | } |
727 | 727 | } |
@@ -744,7 +744,7 @@ discard block |
||
744 | 744 | $association = $collection->getMapping(); |
745 | 745 | $owningAssociation = $association; |
746 | 746 | |
747 | - if (! $association->isOwningSide()) { |
|
747 | + if ( ! $association->isOwningSide()) { |
|
748 | 748 | $sourceClass = $this->em->getClassMetadata($association->getTargetEntity()); |
749 | 749 | $targetClass = $this->em->getClassMetadata($association->getSourceEntity()); |
750 | 750 | $sourceIdentifier = $this->uow->getEntityIdentifier($element); |
@@ -770,11 +770,11 @@ discard block |
||
770 | 770 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
771 | 771 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
772 | 772 | |
773 | - if (! $joinColumn->getType()) { |
|
773 | + if ( ! $joinColumn->getType()) { |
|
774 | 774 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $sourceClass, $this->em)); |
775 | 775 | } |
776 | 776 | |
777 | - $whereClauses[] = ($addFilters ? 't.' : '') . $quotedColumnName . ' = ?'; |
|
777 | + $whereClauses[] = ($addFilters ? 't.' : '').$quotedColumnName.' = ?'; |
|
778 | 778 | $params[] = $sourceIdentifier[$sourceClass->fieldNames[$referencedColumnName]]; |
779 | 779 | $types[] = $joinColumn->getType(); |
780 | 780 | } |
@@ -784,11 +784,11 @@ discard block |
||
784 | 784 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
785 | 785 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
786 | 786 | |
787 | - if (! $joinColumn->getType()) { |
|
787 | + if ( ! $joinColumn->getType()) { |
|
788 | 788 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
789 | 789 | } |
790 | 790 | |
791 | - $whereClauses[] = ($addFilters ? 't.' : '') . $quotedColumnName . ' = ?'; |
|
791 | + $whereClauses[] = ($addFilters ? 't.' : '').$quotedColumnName.' = ?'; |
|
792 | 792 | $params[] = $targetIdentifier[$targetClass->fieldNames[$referencedColumnName]]; |
793 | 793 | $types[] = $joinColumn->getType(); |
794 | 794 | } |
@@ -799,7 +799,7 @@ discard block |
||
799 | 799 | list($joinTargetEntitySQL, $filterSql) = $this->getFilterSql($association); |
800 | 800 | |
801 | 801 | if ($filterSql) { |
802 | - $quotedJoinTable .= ' ' . $joinTargetEntitySQL; |
|
802 | + $quotedJoinTable .= ' '.$joinTargetEntitySQL; |
|
803 | 803 | $whereClauses[] = $filterSql; |
804 | 804 | } |
805 | 805 | } |
@@ -844,10 +844,10 @@ discard block |
||
844 | 844 | $property = $targetClass->getProperty($name); |
845 | 845 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
846 | 846 | |
847 | - $orderBy[] = $columnName . ' ' . $direction; |
|
847 | + $orderBy[] = $columnName.' '.$direction; |
|
848 | 848 | } |
849 | 849 | |
850 | - return ' ORDER BY ' . implode(', ', $orderBy); |
|
850 | + return ' ORDER BY '.implode(', ', $orderBy); |
|
851 | 851 | } |
852 | 852 | return ''; |
853 | 853 | } |