@@ -143,8 +143,8 @@ discard block |
||
| 143 | 143 | ) { |
| 144 | 144 | $this->reverseEngineerMappingFromDatabase(); |
| 145 | 145 | |
| 146 | - if (! isset($this->classToTableNames[$className])) { |
|
| 147 | - throw new InvalidArgumentException('Unknown class ' . $className); |
|
| 146 | + if ( ! isset($this->classToTableNames[$className])) { |
|
| 147 | + throw new InvalidArgumentException('Unknown class '.$className); |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | // @todo guilhermeblanco This should somehow disappear... =) |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | foreach ($this->manyToManyTables as $manyTable) { |
| 160 | 160 | foreach ($manyTable->getForeignKeys() as $foreignKey) { |
| 161 | 161 | // foreign key maps to the table of the current entity, many to many association probably exists |
| 162 | - if (! ($loweredTableName === strtolower($foreignKey->getForeignTableName()))) { |
|
| 162 | + if ( ! ($loweredTableName === strtolower($foreignKey->getForeignTableName()))) { |
|
| 163 | 163 | continue; |
| 164 | 164 | } |
| 165 | 165 | |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | } |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | - if (! $otherFk) { |
|
| 177 | + if ( ! $otherFk) { |
|
| 178 | 178 | // the definition of this many to many table does not contain |
| 179 | 179 | // enough foreign key information to continue reverse engineering. |
| 180 | 180 | continue; |
@@ -255,9 +255,9 @@ discard block |
||
| 255 | 255 | $allForeignKeyColumns = array_merge($allForeignKeyColumns, $foreignKey->getLocalColumns()); |
| 256 | 256 | } |
| 257 | 257 | |
| 258 | - if (! $table->hasPrimaryKey()) { |
|
| 258 | + if ( ! $table->hasPrimaryKey()) { |
|
| 259 | 259 | throw new Mapping\MappingException( |
| 260 | - 'Table ' . $table->getName() . ' has no primary key. Doctrine does not ' . |
|
| 260 | + 'Table '.$table->getName().' has no primary key. Doctrine does not '. |
|
| 261 | 261 | "support reverse engineering from tables that don't have a primary key." |
| 262 | 262 | ); |
| 263 | 263 | } |
@@ -447,7 +447,7 @@ discard block |
||
| 447 | 447 | } |
| 448 | 448 | |
| 449 | 449 | // Here we need to check if $fkColumns are the same as $primaryKeys |
| 450 | - if (! array_diff($fkColumns, $primaryKeys)) { |
|
| 450 | + if ( ! array_diff($fkColumns, $primaryKeys)) { |
|
| 451 | 451 | $metadata->addProperty($associationMapping); |
| 452 | 452 | } else { |
| 453 | 453 | $metadata->addProperty($associationMapping); |
@@ -492,7 +492,7 @@ discard block |
||
| 492 | 492 | */ |
| 493 | 493 | private function getClassNameForTable($tableName) |
| 494 | 494 | { |
| 495 | - return $this->namespace . ( |
|
| 495 | + return $this->namespace.( |
|
| 496 | 496 | $this->classNamesForTables[$tableName] |
| 497 | 497 | ?? Inflector::classify(strtolower($tableName)) |
| 498 | 498 | ); |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | return $this->classNames; |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | - if (! $this->paths) { |
|
| 210 | + if ( ! $this->paths) { |
|
| 211 | 211 | throw Mapping\MappingException::pathRequired(); |
| 212 | 212 | } |
| 213 | 213 | |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | $includedFiles = []; |
| 216 | 216 | |
| 217 | 217 | foreach ($this->paths as $path) { |
| 218 | - if (! is_dir($path)) { |
|
| 218 | + if ( ! is_dir($path)) { |
|
| 219 | 219 | throw Mapping\MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); |
| 220 | 220 | } |
| 221 | 221 | |
@@ -224,14 +224,14 @@ discard block |
||
| 224 | 224 | new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS), |
| 225 | 225 | RecursiveIteratorIterator::LEAVES_ONLY |
| 226 | 226 | ), |
| 227 | - '/^.+' . preg_quote($this->fileExtension) . '$/i', |
|
| 227 | + '/^.+'.preg_quote($this->fileExtension).'$/i', |
|
| 228 | 228 | RecursiveRegexIterator::GET_MATCH |
| 229 | 229 | ); |
| 230 | 230 | |
| 231 | 231 | foreach ($iterator as $file) { |
| 232 | 232 | $sourceFile = $file[0]; |
| 233 | 233 | |
| 234 | - if (! preg_match('(^phar:)i', $sourceFile)) { |
|
| 234 | + if ( ! preg_match('(^phar:)i', $sourceFile)) { |
|
| 235 | 235 | $sourceFile = realpath($sourceFile); |
| 236 | 236 | } |
| 237 | 237 | |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | ) : Mapping\ClassMetadata { |
| 280 | 280 | $reflectionClass = $metadata->getReflectionClass(); |
| 281 | 281 | |
| 282 | - if (! $reflectionClass) { |
|
| 282 | + if ( ! $reflectionClass) { |
|
| 283 | 283 | // this happens when running annotation driver in combination with |
| 284 | 284 | // static reflection services. This is not the nicest fix |
| 285 | 285 | $reflectionClass = new ReflectionClass($metadata->getClassName()); |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | $metadataBuildingContext |
| 317 | 317 | ); |
| 318 | 318 | |
| 319 | - if (! $property) { |
|
| 319 | + if ( ! $property) { |
|
| 320 | 320 | continue; |
| 321 | 321 | } |
| 322 | 322 | |
@@ -613,11 +613,11 @@ discard block |
||
| 613 | 613 | $assocMetadata->setOrphanRemoval($oneToOneAnnot->orphanRemoval); |
| 614 | 614 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToOneAnnot->fetch)); |
| 615 | 615 | |
| 616 | - if (! empty($oneToOneAnnot->mappedBy)) { |
|
| 616 | + if ( ! empty($oneToOneAnnot->mappedBy)) { |
|
| 617 | 617 | $assocMetadata->setMappedBy($oneToOneAnnot->mappedBy); |
| 618 | 618 | } |
| 619 | 619 | |
| 620 | - if (! empty($oneToOneAnnot->inversedBy)) { |
|
| 620 | + if ( ! empty($oneToOneAnnot->inversedBy)) { |
|
| 621 | 621 | $assocMetadata->setInversedBy($oneToOneAnnot->inversedBy); |
| 622 | 622 | } |
| 623 | 623 | |
@@ -675,7 +675,7 @@ discard block |
||
| 675 | 675 | $assocMetadata->setCascade($this->getCascade($className, $fieldName, $manyToOneAnnot->cascade)); |
| 676 | 676 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToOneAnnot->fetch)); |
| 677 | 677 | |
| 678 | - if (! empty($manyToOneAnnot->inversedBy)) { |
|
| 678 | + if ( ! empty($manyToOneAnnot->inversedBy)) { |
|
| 679 | 679 | $assocMetadata->setInversedBy($manyToOneAnnot->inversedBy); |
| 680 | 680 | } |
| 681 | 681 | |
@@ -734,11 +734,11 @@ discard block |
||
| 734 | 734 | $assocMetadata->setOrphanRemoval($oneToManyAnnot->orphanRemoval); |
| 735 | 735 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToManyAnnot->fetch)); |
| 736 | 736 | |
| 737 | - if (! empty($oneToManyAnnot->mappedBy)) { |
|
| 737 | + if ( ! empty($oneToManyAnnot->mappedBy)) { |
|
| 738 | 738 | $assocMetadata->setMappedBy($oneToManyAnnot->mappedBy); |
| 739 | 739 | } |
| 740 | 740 | |
| 741 | - if (! empty($oneToManyAnnot->indexBy)) { |
|
| 741 | + if ( ! empty($oneToManyAnnot->indexBy)) { |
|
| 742 | 742 | $assocMetadata->setIndexedBy($oneToManyAnnot->indexBy); |
| 743 | 743 | } |
| 744 | 744 | |
@@ -781,15 +781,15 @@ discard block |
||
| 781 | 781 | $assocMetadata->setOrphanRemoval($manyToManyAnnot->orphanRemoval); |
| 782 | 782 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToManyAnnot->fetch)); |
| 783 | 783 | |
| 784 | - if (! empty($manyToManyAnnot->mappedBy)) { |
|
| 784 | + if ( ! empty($manyToManyAnnot->mappedBy)) { |
|
| 785 | 785 | $assocMetadata->setMappedBy($manyToManyAnnot->mappedBy); |
| 786 | 786 | } |
| 787 | 787 | |
| 788 | - if (! empty($manyToManyAnnot->inversedBy)) { |
|
| 788 | + if ( ! empty($manyToManyAnnot->inversedBy)) { |
|
| 789 | 789 | $assocMetadata->setInversedBy($manyToManyAnnot->inversedBy); |
| 790 | 790 | } |
| 791 | 791 | |
| 792 | - if (! empty($manyToManyAnnot->indexBy)) { |
|
| 792 | + if ( ! empty($manyToManyAnnot->indexBy)) { |
|
| 793 | 793 | $assocMetadata->setIndexedBy($manyToManyAnnot->indexBy); |
| 794 | 794 | } |
| 795 | 795 | |
@@ -832,15 +832,15 @@ discard block |
||
| 832 | 832 | |
| 833 | 833 | $fieldMetadata->setType(Type::getType($columnAnnot->type)); |
| 834 | 834 | |
| 835 | - if (! empty($columnAnnot->name)) { |
|
| 835 | + if ( ! empty($columnAnnot->name)) { |
|
| 836 | 836 | $fieldMetadata->setColumnName($columnAnnot->name); |
| 837 | 837 | } |
| 838 | 838 | |
| 839 | - if (! empty($columnAnnot->columnDefinition)) { |
|
| 839 | + if ( ! empty($columnAnnot->columnDefinition)) { |
|
| 840 | 840 | $fieldMetadata->setColumnDefinition($columnAnnot->columnDefinition); |
| 841 | 841 | } |
| 842 | 842 | |
| 843 | - if (! empty($columnAnnot->length)) { |
|
| 843 | + if ( ! empty($columnAnnot->length)) { |
|
| 844 | 844 | $fieldMetadata->setLength($columnAnnot->length); |
| 845 | 845 | } |
| 846 | 846 | |
@@ -863,11 +863,11 @@ discard block |
||
| 863 | 863 | Annotation\Table $tableAnnot, |
| 864 | 864 | Mapping\TableMetadata $table |
| 865 | 865 | ) : Mapping\TableMetadata { |
| 866 | - if (! empty($tableAnnot->name)) { |
|
| 866 | + if ( ! empty($tableAnnot->name)) { |
|
| 867 | 867 | $table->setName($tableAnnot->name); |
| 868 | 868 | } |
| 869 | 869 | |
| 870 | - if (! empty($tableAnnot->schema)) { |
|
| 870 | + if ( ! empty($tableAnnot->schema)) { |
|
| 871 | 871 | $table->setSchema($tableAnnot->schema); |
| 872 | 872 | } |
| 873 | 873 | |
@@ -905,11 +905,11 @@ discard block |
||
| 905 | 905 | ) : Mapping\JoinTableMetadata { |
| 906 | 906 | $joinTable = new Mapping\JoinTableMetadata(); |
| 907 | 907 | |
| 908 | - if (! empty($joinTableAnnot->name)) { |
|
| 908 | + if ( ! empty($joinTableAnnot->name)) { |
|
| 909 | 909 | $joinTable->setName($joinTableAnnot->name); |
| 910 | 910 | } |
| 911 | 911 | |
| 912 | - if (! empty($joinTableAnnot->schema)) { |
|
| 912 | + if ( ! empty($joinTableAnnot->schema)) { |
|
| 913 | 913 | $joinTable->setSchema($joinTableAnnot->schema); |
| 914 | 914 | } |
| 915 | 915 | |
@@ -937,22 +937,22 @@ discard block |
||
| 937 | 937 | $joinColumn = new Mapping\JoinColumnMetadata(); |
| 938 | 938 | |
| 939 | 939 | // @todo Remove conditionals for name and referencedColumnName once naming strategy is brought into drivers |
| 940 | - if (! empty($joinColumnAnnot->name)) { |
|
| 940 | + if ( ! empty($joinColumnAnnot->name)) { |
|
| 941 | 941 | $joinColumn->setColumnName($joinColumnAnnot->name); |
| 942 | 942 | } |
| 943 | 943 | |
| 944 | - if (! empty($joinColumnAnnot->referencedColumnName)) { |
|
| 944 | + if ( ! empty($joinColumnAnnot->referencedColumnName)) { |
|
| 945 | 945 | $joinColumn->setReferencedColumnName($joinColumnAnnot->referencedColumnName); |
| 946 | 946 | } |
| 947 | 947 | |
| 948 | 948 | $joinColumn->setNullable($joinColumnAnnot->nullable); |
| 949 | 949 | $joinColumn->setUnique($joinColumnAnnot->unique); |
| 950 | 950 | |
| 951 | - if (! empty($joinColumnAnnot->fieldName)) { |
|
| 951 | + if ( ! empty($joinColumnAnnot->fieldName)) { |
|
| 952 | 952 | $joinColumn->setAliasedName($joinColumnAnnot->fieldName); |
| 953 | 953 | } |
| 954 | 954 | |
| 955 | - if (! empty($joinColumnAnnot->columnDefinition)) { |
|
| 955 | + if ( ! empty($joinColumnAnnot->columnDefinition)) { |
|
| 956 | 956 | $joinColumn->setColumnDefinition($joinColumnAnnot->columnDefinition); |
| 957 | 957 | } |
| 958 | 958 | |
@@ -974,7 +974,7 @@ discard block |
||
| 974 | 974 | $fieldName = null |
| 975 | 975 | ) : Mapping\CacheMetadata { |
| 976 | 976 | $baseRegion = strtolower(str_replace('\\', '_', $metadata->getRootClassName())); |
| 977 | - $defaultRegion = $baseRegion . ($fieldName ? '__' . $fieldName : ''); |
|
| 977 | + $defaultRegion = $baseRegion.($fieldName ? '__'.$fieldName : ''); |
|
| 978 | 978 | |
| 979 | 979 | $usage = constant(sprintf('%s::%s', Mapping\CacheUsage::class, $cacheAnnot->usage)); |
| 980 | 980 | $region = $cacheAnnot->region ?: $defaultRegion; |
@@ -1043,11 +1043,11 @@ discard block |
||
| 1043 | 1043 | $discriminatorColumn->setType(Type::getType($typeName)); |
| 1044 | 1044 | $discriminatorColumn->setColumnName($discriminatorColumnAnnotation->name); |
| 1045 | 1045 | |
| 1046 | - if (! empty($discriminatorColumnAnnotation->columnDefinition)) { |
|
| 1046 | + if ( ! empty($discriminatorColumnAnnotation->columnDefinition)) { |
|
| 1047 | 1047 | $discriminatorColumn->setColumnDefinition($discriminatorColumnAnnotation->columnDefinition); |
| 1048 | 1048 | } |
| 1049 | 1049 | |
| 1050 | - if (! empty($discriminatorColumnAnnotation->length)) { |
|
| 1050 | + if ( ! empty($discriminatorColumnAnnotation->length)) { |
|
| 1051 | 1051 | $discriminatorColumn->setLength($discriminatorColumnAnnotation->length); |
| 1052 | 1052 | } |
| 1053 | 1053 | } |
@@ -1099,7 +1099,7 @@ discard block |
||
| 1099 | 1099 | $entityListenersAnnot = $classAnnotations[Annotation\EntityListeners::class]; |
| 1100 | 1100 | |
| 1101 | 1101 | foreach ($entityListenersAnnot->value as $listenerClassName) { |
| 1102 | - if (! class_exists($listenerClassName)) { |
|
| 1102 | + if ( ! class_exists($listenerClassName)) { |
|
| 1103 | 1103 | throw Mapping\MappingException::entityListenerClassNotFound( |
| 1104 | 1104 | $listenerClassName, |
| 1105 | 1105 | $metadata->getClassName() |
@@ -1137,7 +1137,7 @@ discard block |
||
| 1137 | 1137 | $fieldName = $associationOverride->name; |
| 1138 | 1138 | $property = $metadata->getProperty($fieldName); |
| 1139 | 1139 | |
| 1140 | - if (! $property) { |
|
| 1140 | + if ( ! $property) { |
|
| 1141 | 1141 | throw Mapping\MappingException::invalidOverrideFieldName($metadata->getClassName(), $fieldName); |
| 1142 | 1142 | } |
| 1143 | 1143 | |
@@ -1171,7 +1171,7 @@ discard block |
||
| 1171 | 1171 | // Check for fetch |
| 1172 | 1172 | if ($associationOverride->fetch) { |
| 1173 | 1173 | $override->setFetchMode( |
| 1174 | - constant(Mapping\FetchMode::class . '::' . $associationOverride->fetch) |
|
| 1174 | + constant(Mapping\FetchMode::class.'::'.$associationOverride->fetch) |
|
| 1175 | 1175 | ); |
| 1176 | 1176 | } |
| 1177 | 1177 | |
@@ -1260,7 +1260,7 @@ discard block |
||
| 1260 | 1260 | { |
| 1261 | 1261 | $fetchModeConstant = sprintf('%s::%s', Mapping\FetchMode::class, $fetchMode); |
| 1262 | 1262 | |
| 1263 | - if (! defined($fetchModeConstant)) { |
|
| 1263 | + if ( ! defined($fetchModeConstant)) { |
|
| 1264 | 1264 | throw Mapping\MappingException::invalidFetchMode($className, $fetchMode); |
| 1265 | 1265 | } |
| 1266 | 1266 | |
@@ -1306,7 +1306,7 @@ discard block |
||
| 1306 | 1306 | $classAnnotations = $this->reader->getClassAnnotations($reflectionClass); |
| 1307 | 1307 | |
| 1308 | 1308 | foreach ($classAnnotations as $key => $annot) { |
| 1309 | - if (! is_numeric($key)) { |
|
| 1309 | + if ( ! is_numeric($key)) { |
|
| 1310 | 1310 | continue; |
| 1311 | 1311 | } |
| 1312 | 1312 | |
@@ -1324,7 +1324,7 @@ discard block |
||
| 1324 | 1324 | $propertyAnnotations = $this->reader->getPropertyAnnotations($reflectionProperty); |
| 1325 | 1325 | |
| 1326 | 1326 | foreach ($propertyAnnotations as $key => $annot) { |
| 1327 | - if (! is_numeric($key)) { |
|
| 1327 | + if ( ! is_numeric($key)) { |
|
| 1328 | 1328 | continue; |
| 1329 | 1329 | } |
| 1330 | 1330 | |
@@ -1342,7 +1342,7 @@ discard block |
||
| 1342 | 1342 | $methodAnnotations = $this->reader->getMethodAnnotations($reflectionMethod); |
| 1343 | 1343 | |
| 1344 | 1344 | foreach ($methodAnnotations as $key => $annot) { |
| 1345 | - if (! is_numeric($key)) { |
|
| 1345 | + if ( ! is_numeric($key)) { |
|
| 1346 | 1346 | continue; |
| 1347 | 1347 | } |
| 1348 | 1348 | |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | return $this->classNames; |
| 209 | 209 | } |
| 210 | 210 | |
| 211 | - if (! $this->paths) { |
|
| 211 | + if ( ! $this->paths) { |
|
| 212 | 212 | throw Mapping\MappingException::pathRequired(); |
| 213 | 213 | } |
| 214 | 214 | |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | $includedFiles = []; |
| 217 | 217 | |
| 218 | 218 | foreach ($this->paths as $path) { |
| 219 | - if (! is_dir($path)) { |
|
| 219 | + if ( ! is_dir($path)) { |
|
| 220 | 220 | throw Mapping\MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); |
| 221 | 221 | } |
| 222 | 222 | |
@@ -225,14 +225,14 @@ discard block |
||
| 225 | 225 | new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS), |
| 226 | 226 | RecursiveIteratorIterator::LEAVES_ONLY |
| 227 | 227 | ), |
| 228 | - '/^.+' . preg_quote($this->fileExtension) . '$/i', |
|
| 228 | + '/^.+'.preg_quote($this->fileExtension).'$/i', |
|
| 229 | 229 | RecursiveRegexIterator::GET_MATCH |
| 230 | 230 | ); |
| 231 | 231 | |
| 232 | 232 | foreach ($iterator as $file) { |
| 233 | 233 | $sourceFile = $file[0]; |
| 234 | 234 | |
| 235 | - if (! preg_match('(^phar:)i', $sourceFile)) { |
|
| 235 | + if ( ! preg_match('(^phar:)i', $sourceFile)) { |
|
| 236 | 236 | $sourceFile = realpath($sourceFile); |
| 237 | 237 | } |
| 238 | 238 | |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | ) : Mapping\ClassMetadata { |
| 282 | 282 | $reflectionClass = $metadata->getReflectionClass(); |
| 283 | 283 | |
| 284 | - if (! $reflectionClass) { |
|
| 284 | + if ( ! $reflectionClass) { |
|
| 285 | 285 | // this happens when running annotation driver in combination with |
| 286 | 286 | // static reflection services. This is not the nicest fix |
| 287 | 287 | $reflectionClass = new ReflectionClass($metadata->getClassName()); |
@@ -326,7 +326,7 @@ discard block |
||
| 326 | 326 | ); |
| 327 | 327 | } |
| 328 | 328 | |
| 329 | - if (! $property) { |
|
| 329 | + if ( ! $property) { |
|
| 330 | 330 | continue; |
| 331 | 331 | } |
| 332 | 332 | |
@@ -619,12 +619,12 @@ discard block |
||
| 619 | 619 | $assocMetadata->setOrphanRemoval($oneToOneAnnot->orphanRemoval); |
| 620 | 620 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToOneAnnot->fetch)); |
| 621 | 621 | |
| 622 | - if (! empty($oneToOneAnnot->mappedBy)) { |
|
| 622 | + if ( ! empty($oneToOneAnnot->mappedBy)) { |
|
| 623 | 623 | $assocMetadata->setMappedBy($oneToOneAnnot->mappedBy); |
| 624 | 624 | $assocMetadata->setOwningSide(false); |
| 625 | 625 | } |
| 626 | 626 | |
| 627 | - if (! empty($oneToOneAnnot->inversedBy)) { |
|
| 627 | + if ( ! empty($oneToOneAnnot->inversedBy)) { |
|
| 628 | 628 | $assocMetadata->setInversedBy($oneToOneAnnot->inversedBy); |
| 629 | 629 | } |
| 630 | 630 | |
@@ -681,7 +681,7 @@ discard block |
||
| 681 | 681 | $assocMetadata->setCascade($this->getCascade($className, $fieldName, $manyToOneAnnot->cascade)); |
| 682 | 682 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToOneAnnot->fetch)); |
| 683 | 683 | |
| 684 | - if (! empty($manyToOneAnnot->inversedBy)) { |
|
| 684 | + if ( ! empty($manyToOneAnnot->inversedBy)) { |
|
| 685 | 685 | $assocMetadata->setInversedBy($manyToOneAnnot->inversedBy); |
| 686 | 686 | } |
| 687 | 687 | |
@@ -741,7 +741,7 @@ discard block |
||
| 741 | 741 | $assocMetadata->setOwningSide(false); |
| 742 | 742 | $assocMetadata->setMappedBy($oneToManyAnnot->mappedBy); |
| 743 | 743 | |
| 744 | - if (! empty($oneToManyAnnot->indexBy)) { |
|
| 744 | + if ( ! empty($oneToManyAnnot->indexBy)) { |
|
| 745 | 745 | $assocMetadata->setIndexedBy($oneToManyAnnot->indexBy); |
| 746 | 746 | } |
| 747 | 747 | |
@@ -783,16 +783,16 @@ discard block |
||
| 783 | 783 | $assocMetadata->setOrphanRemoval($manyToManyAnnot->orphanRemoval); |
| 784 | 784 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToManyAnnot->fetch)); |
| 785 | 785 | |
| 786 | - if (! empty($manyToManyAnnot->mappedBy)) { |
|
| 786 | + if ( ! empty($manyToManyAnnot->mappedBy)) { |
|
| 787 | 787 | $assocMetadata->setMappedBy($manyToManyAnnot->mappedBy); |
| 788 | 788 | $assocMetadata->setOwningSide(false); |
| 789 | 789 | } |
| 790 | 790 | |
| 791 | - if (! empty($manyToManyAnnot->inversedBy)) { |
|
| 791 | + if ( ! empty($manyToManyAnnot->inversedBy)) { |
|
| 792 | 792 | $assocMetadata->setInversedBy($manyToManyAnnot->inversedBy); |
| 793 | 793 | } |
| 794 | 794 | |
| 795 | - if (! empty($manyToManyAnnot->indexBy)) { |
|
| 795 | + if ( ! empty($manyToManyAnnot->indexBy)) { |
|
| 796 | 796 | $assocMetadata->setIndexedBy($manyToManyAnnot->indexBy); |
| 797 | 797 | } |
| 798 | 798 | |
@@ -835,15 +835,15 @@ discard block |
||
| 835 | 835 | |
| 836 | 836 | $fieldMetadata->setType(Type::getType($columnAnnot->type)); |
| 837 | 837 | |
| 838 | - if (! empty($columnAnnot->name)) { |
|
| 838 | + if ( ! empty($columnAnnot->name)) { |
|
| 839 | 839 | $fieldMetadata->setColumnName($columnAnnot->name); |
| 840 | 840 | } |
| 841 | 841 | |
| 842 | - if (! empty($columnAnnot->columnDefinition)) { |
|
| 842 | + if ( ! empty($columnAnnot->columnDefinition)) { |
|
| 843 | 843 | $fieldMetadata->setColumnDefinition($columnAnnot->columnDefinition); |
| 844 | 844 | } |
| 845 | 845 | |
| 846 | - if (! empty($columnAnnot->length)) { |
|
| 846 | + if ( ! empty($columnAnnot->length)) { |
|
| 847 | 847 | $fieldMetadata->setLength($columnAnnot->length); |
| 848 | 848 | } |
| 849 | 849 | |
@@ -866,11 +866,11 @@ discard block |
||
| 866 | 866 | Annotation\Table $tableAnnot, |
| 867 | 867 | Mapping\TableMetadata $tableMetadata |
| 868 | 868 | ) : void { |
| 869 | - if (! empty($tableAnnot->name)) { |
|
| 869 | + if ( ! empty($tableAnnot->name)) { |
|
| 870 | 870 | $tableMetadata->setName($tableAnnot->name); |
| 871 | 871 | } |
| 872 | 872 | |
| 873 | - if (! empty($tableAnnot->schema)) { |
|
| 873 | + if ( ! empty($tableAnnot->schema)) { |
|
| 874 | 874 | $tableMetadata->setSchema($tableAnnot->schema); |
| 875 | 875 | } |
| 876 | 876 | |
@@ -906,11 +906,11 @@ discard block |
||
| 906 | 906 | ) : Mapping\JoinTableMetadata { |
| 907 | 907 | $joinTable = new Mapping\JoinTableMetadata(); |
| 908 | 908 | |
| 909 | - if (! empty($joinTableAnnot->name)) { |
|
| 909 | + if ( ! empty($joinTableAnnot->name)) { |
|
| 910 | 910 | $joinTable->setName($joinTableAnnot->name); |
| 911 | 911 | } |
| 912 | 912 | |
| 913 | - if (! empty($joinTableAnnot->schema)) { |
|
| 913 | + if ( ! empty($joinTableAnnot->schema)) { |
|
| 914 | 914 | $joinTable->setSchema($joinTableAnnot->schema); |
| 915 | 915 | } |
| 916 | 916 | |
@@ -938,22 +938,22 @@ discard block |
||
| 938 | 938 | $joinColumn = new Mapping\JoinColumnMetadata(); |
| 939 | 939 | |
| 940 | 940 | // @todo Remove conditionals for name and referencedColumnName once naming strategy is brought into drivers |
| 941 | - if (! empty($joinColumnAnnot->name)) { |
|
| 941 | + if ( ! empty($joinColumnAnnot->name)) { |
|
| 942 | 942 | $joinColumn->setColumnName($joinColumnAnnot->name); |
| 943 | 943 | } |
| 944 | 944 | |
| 945 | - if (! empty($joinColumnAnnot->referencedColumnName)) { |
|
| 945 | + if ( ! empty($joinColumnAnnot->referencedColumnName)) { |
|
| 946 | 946 | $joinColumn->setReferencedColumnName($joinColumnAnnot->referencedColumnName); |
| 947 | 947 | } |
| 948 | 948 | |
| 949 | 949 | $joinColumn->setNullable($joinColumnAnnot->nullable); |
| 950 | 950 | $joinColumn->setUnique($joinColumnAnnot->unique); |
| 951 | 951 | |
| 952 | - if (! empty($joinColumnAnnot->fieldName)) { |
|
| 952 | + if ( ! empty($joinColumnAnnot->fieldName)) { |
|
| 953 | 953 | $joinColumn->setAliasedName($joinColumnAnnot->fieldName); |
| 954 | 954 | } |
| 955 | 955 | |
| 956 | - if (! empty($joinColumnAnnot->columnDefinition)) { |
|
| 956 | + if ( ! empty($joinColumnAnnot->columnDefinition)) { |
|
| 957 | 957 | $joinColumn->setColumnDefinition($joinColumnAnnot->columnDefinition); |
| 958 | 958 | } |
| 959 | 959 | |
@@ -975,7 +975,7 @@ discard block |
||
| 975 | 975 | $fieldName = null |
| 976 | 976 | ) : Mapping\CacheMetadata { |
| 977 | 977 | $baseRegion = strtolower(str_replace('\\', '_', $metadata->getRootClassName())); |
| 978 | - $defaultRegion = $baseRegion . ($fieldName ? '__' . $fieldName : ''); |
|
| 978 | + $defaultRegion = $baseRegion.($fieldName ? '__'.$fieldName : ''); |
|
| 979 | 979 | |
| 980 | 980 | $usage = constant(sprintf('%s::%s', Mapping\CacheUsage::class, $cacheAnnot->usage)); |
| 981 | 981 | $region = $cacheAnnot->region ?: $defaultRegion; |
@@ -997,7 +997,7 @@ discard block |
||
| 997 | 997 | if ($parent && $parent->inheritanceType === Mapping\InheritanceType::SINGLE_TABLE) { |
| 998 | 998 | // Handle the case where a middle mapped super class inherits from a single table inheritance tree. |
| 999 | 999 | do { |
| 1000 | - if (! $parent->isMappedSuperclass) { |
|
| 1000 | + if ( ! $parent->isMappedSuperclass) { |
|
| 1001 | 1001 | $metadata->setTable($parent->table); |
| 1002 | 1002 | |
| 1003 | 1003 | break; |
@@ -1052,11 +1052,11 @@ discard block |
||
| 1052 | 1052 | $discriminatorColumn->setType(Type::getType($typeName)); |
| 1053 | 1053 | $discriminatorColumn->setColumnName($discriminatorColumnAnnotation->name); |
| 1054 | 1054 | |
| 1055 | - if (! empty($discriminatorColumnAnnotation->columnDefinition)) { |
|
| 1055 | + if ( ! empty($discriminatorColumnAnnotation->columnDefinition)) { |
|
| 1056 | 1056 | $discriminatorColumn->setColumnDefinition($discriminatorColumnAnnotation->columnDefinition); |
| 1057 | 1057 | } |
| 1058 | 1058 | |
| 1059 | - if (! empty($discriminatorColumnAnnotation->length)) { |
|
| 1059 | + if ( ! empty($discriminatorColumnAnnotation->length)) { |
|
| 1060 | 1060 | $discriminatorColumn->setLength($discriminatorColumnAnnotation->length); |
| 1061 | 1061 | } |
| 1062 | 1062 | } |
@@ -1108,7 +1108,7 @@ discard block |
||
| 1108 | 1108 | $entityListenersAnnot = $classAnnotations[Annotation\EntityListeners::class]; |
| 1109 | 1109 | |
| 1110 | 1110 | foreach ($entityListenersAnnot->value as $listenerClassName) { |
| 1111 | - if (! class_exists($listenerClassName)) { |
|
| 1111 | + if ( ! class_exists($listenerClassName)) { |
|
| 1112 | 1112 | throw Mapping\MappingException::entityListenerClassNotFound( |
| 1113 | 1113 | $listenerClassName, |
| 1114 | 1114 | $metadata->getClassName() |
@@ -1145,7 +1145,7 @@ discard block |
||
| 1145 | 1145 | $fieldName = $associationOverride->name; |
| 1146 | 1146 | $property = $metadata->getProperty($fieldName); |
| 1147 | 1147 | |
| 1148 | - if (! $property) { |
|
| 1148 | + if ( ! $property) { |
|
| 1149 | 1149 | throw Mapping\MappingException::invalidOverrideFieldName($metadata->getClassName(), $fieldName); |
| 1150 | 1150 | } |
| 1151 | 1151 | |
@@ -1179,7 +1179,7 @@ discard block |
||
| 1179 | 1179 | // Check for fetch |
| 1180 | 1180 | if ($associationOverride->fetch) { |
| 1181 | 1181 | $override->setFetchMode( |
| 1182 | - constant(Mapping\FetchMode::class . '::' . $associationOverride->fetch) |
|
| 1182 | + constant(Mapping\FetchMode::class.'::'.$associationOverride->fetch) |
|
| 1183 | 1183 | ); |
| 1184 | 1184 | } |
| 1185 | 1185 | |
@@ -1268,7 +1268,7 @@ discard block |
||
| 1268 | 1268 | { |
| 1269 | 1269 | $fetchModeConstant = sprintf('%s::%s', Mapping\FetchMode::class, $fetchMode); |
| 1270 | 1270 | |
| 1271 | - if (! defined($fetchModeConstant)) { |
|
| 1271 | + if ( ! defined($fetchModeConstant)) { |
|
| 1272 | 1272 | throw Mapping\MappingException::invalidFetchMode($className, $fetchMode); |
| 1273 | 1273 | } |
| 1274 | 1274 | |
@@ -1314,7 +1314,7 @@ discard block |
||
| 1314 | 1314 | $classAnnotations = $this->reader->getClassAnnotations($reflectionClass); |
| 1315 | 1315 | |
| 1316 | 1316 | foreach ($classAnnotations as $key => $annot) { |
| 1317 | - if (! is_numeric($key)) { |
|
| 1317 | + if ( ! is_numeric($key)) { |
|
| 1318 | 1318 | continue; |
| 1319 | 1319 | } |
| 1320 | 1320 | |
@@ -1332,7 +1332,7 @@ discard block |
||
| 1332 | 1332 | $propertyAnnotations = $this->reader->getPropertyAnnotations($reflectionProperty); |
| 1333 | 1333 | |
| 1334 | 1334 | foreach ($propertyAnnotations as $key => $annot) { |
| 1335 | - if (! is_numeric($key)) { |
|
| 1335 | + if ( ! is_numeric($key)) { |
|
| 1336 | 1336 | continue; |
| 1337 | 1337 | } |
| 1338 | 1338 | |
@@ -1350,7 +1350,7 @@ discard block |
||
| 1350 | 1350 | $methodAnnotations = $this->reader->getMethodAnnotations($reflectionMethod); |
| 1351 | 1351 | |
| 1352 | 1352 | foreach ($methodAnnotations as $key => $annot) { |
| 1353 | - if (! is_numeric($key)) { |
|
| 1353 | + if ( ! is_numeric($key)) { |
|
| 1354 | 1354 | continue; |
| 1355 | 1355 | } |
| 1356 | 1356 | |
@@ -416,7 +416,7 @@ discard block |
||
| 416 | 416 | |
| 417 | 417 | if (isset($manyToOneElement['fetch'])) { |
| 418 | 418 | $association->setFetchMode( |
| 419 | - constant('Doctrine\ORM\Mapping\FetchMode::' . (string) $manyToOneElement['fetch']) |
|
| 419 | + constant('Doctrine\ORM\Mapping\FetchMode::'.(string) $manyToOneElement['fetch']) |
|
| 420 | 420 | ); |
| 421 | 421 | } |
| 422 | 422 | |
@@ -569,7 +569,7 @@ discard block |
||
| 569 | 569 | $fieldName = (string) $overrideElement['name']; |
| 570 | 570 | $property = $metadata->getProperty($fieldName); |
| 571 | 571 | |
| 572 | - if (! $property) { |
|
| 572 | + if ( ! $property) { |
|
| 573 | 573 | throw Mapping\MappingException::invalidOverrideFieldName($metadata->getClassName(), $fieldName); |
| 574 | 574 | } |
| 575 | 575 | |
@@ -627,7 +627,7 @@ discard block |
||
| 627 | 627 | // Check for fetch |
| 628 | 628 | if (isset($overrideElement['fetch'])) { |
| 629 | 629 | $override->setFetchMode( |
| 630 | - constant('Doctrine\ORM\Mapping\FetchMode::' . (string) $overrideElement['fetch']) |
|
| 630 | + constant('Doctrine\ORM\Mapping\FetchMode::'.(string) $overrideElement['fetch']) |
|
| 631 | 631 | ); |
| 632 | 632 | } |
| 633 | 633 | |
@@ -638,7 +638,7 @@ discard block |
||
| 638 | 638 | // Evaluate <lifecycle-callbacks...> |
| 639 | 639 | if (isset($xmlRoot->{'lifecycle-callbacks'})) { |
| 640 | 640 | foreach ($xmlRoot->{'lifecycle-callbacks'}->{'lifecycle-callback'} as $lifecycleCallback) { |
| 641 | - $eventName = constant(Events::class . '::' . (string) $lifecycleCallback['type']); |
|
| 641 | + $eventName = constant(Events::class.'::'.(string) $lifecycleCallback['type']); |
|
| 642 | 642 | $methodName = (string) $lifecycleCallback['method']; |
| 643 | 643 | |
| 644 | 644 | $metadata->addLifecycleCallback($methodName, $eventName); |
@@ -650,7 +650,7 @@ discard block |
||
| 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']) |
@@ -844,7 +844,7 @@ discard block |
||
| 844 | 844 | Events::preFlush, |
| 845 | 845 | ]; |
| 846 | 846 | |
| 847 | - return array_filter($events, static function ($eventName) use ($method) { |
|
| 847 | + return array_filter($events, static function($eventName) use ($method) { |
|
| 848 | 848 | return $eventName === $method->getName(); |
| 849 | 849 | }); |
| 850 | 850 | } |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | */ |
| 263 | 263 | public function __toString() |
| 264 | 264 | { |
| 265 | - return self::class . '@' . spl_object_id($this); |
|
| 265 | + return self::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, static function (Property $property) : bool { |
|
| 380 | + $explicitlyGeneratedProperties = array_filter($this->declaredProperties, static 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,14 +727,14 @@ 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 | 734 | if ($property->isOrphanRemoval()) { |
| 735 | 735 | $cascades = $property->getCascade(); |
| 736 | 736 | |
| 737 | - if (! in_array('remove', $cascades, true)) { |
|
| 737 | + if ( ! in_array('remove', $cascades, true)) { |
|
| 738 | 738 | $cascades[] = 'remove'; |
| 739 | 739 | |
| 740 | 740 | $property->setCascade($cascades); |
@@ -757,7 +757,7 @@ discard block |
||
| 757 | 757 | |
| 758 | 758 | $property->setJoinTable($joinTable); |
| 759 | 759 | |
| 760 | - if (! $joinTable->getName()) { |
|
| 760 | + if ( ! $joinTable->getName()) { |
|
| 761 | 761 | $joinTableName = $this->namingStrategy->joinTableName( |
| 762 | 762 | $property->getSourceEntity(), |
| 763 | 763 | $property->getTargetEntity(), |
@@ -769,7 +769,7 @@ discard block |
||
| 769 | 769 | |
| 770 | 770 | $selfReferencingEntityWithoutJoinColumns = $property->getSourceEntity() === $property->getTargetEntity() && ! $joinTable->hasColumns(); |
| 771 | 771 | |
| 772 | - if (! $joinTable->getJoinColumns()) { |
|
| 772 | + if ( ! $joinTable->getJoinColumns()) { |
|
| 773 | 773 | $referencedColumnName = $this->namingStrategy->referenceColumnName(); |
| 774 | 774 | $sourceReferenceName = $selfReferencingEntityWithoutJoinColumns ? 'source' : $referencedColumnName; |
| 775 | 775 | $columnName = $this->namingStrategy->joinKeyColumnName($property->getSourceEntity(), $sourceReferenceName); |
@@ -782,7 +782,7 @@ discard block |
||
| 782 | 782 | $joinTable->addJoinColumn($joinColumn); |
| 783 | 783 | } |
| 784 | 784 | |
| 785 | - if (! $joinTable->getInverseJoinColumns()) { |
|
| 785 | + if ( ! $joinTable->getInverseJoinColumns()) { |
|
| 786 | 786 | $referencedColumnName = $this->namingStrategy->referenceColumnName(); |
| 787 | 787 | $targetReferenceName = $selfReferencingEntityWithoutJoinColumns ? 'target' : $referencedColumnName; |
| 788 | 788 | $columnName = $this->namingStrategy->joinKeyColumnName($property->getTargetEntity(), $targetReferenceName); |
@@ -797,13 +797,13 @@ discard block |
||
| 797 | 797 | |
| 798 | 798 | foreach ($joinTable->getJoinColumns() as $joinColumn) { |
| 799 | 799 | /** @var JoinColumnMetadata $joinColumn */ |
| 800 | - if (! $joinColumn->getReferencedColumnName()) { |
|
| 800 | + if ( ! $joinColumn->getReferencedColumnName()) { |
|
| 801 | 801 | $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
| 802 | 802 | } |
| 803 | 803 | |
| 804 | 804 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 805 | 805 | |
| 806 | - if (! $joinColumn->getColumnName()) { |
|
| 806 | + if ( ! $joinColumn->getColumnName()) { |
|
| 807 | 807 | $columnName = $this->namingStrategy->joinKeyColumnName( |
| 808 | 808 | $property->getSourceEntity(), |
| 809 | 809 | $referencedColumnName |
@@ -815,13 +815,13 @@ discard block |
||
| 815 | 815 | |
| 816 | 816 | foreach ($joinTable->getInverseJoinColumns() as $inverseJoinColumn) { |
| 817 | 817 | /** @var JoinColumnMetadata $inverseJoinColumn */ |
| 818 | - if (! $inverseJoinColumn->getReferencedColumnName()) { |
|
| 818 | + if ( ! $inverseJoinColumn->getReferencedColumnName()) { |
|
| 819 | 819 | $inverseJoinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
| 820 | 820 | } |
| 821 | 821 | |
| 822 | 822 | $referencedColumnName = $inverseJoinColumn->getReferencedColumnName(); |
| 823 | 823 | |
| 824 | - if (! $inverseJoinColumn->getColumnName()) { |
|
| 824 | + if ( ! $inverseJoinColumn->getColumnName()) { |
|
| 825 | 825 | $columnName = $this->namingStrategy->joinKeyColumnName( |
| 826 | 826 | $property->getTargetEntity(), |
| 827 | 827 | $referencedColumnName |
@@ -855,7 +855,7 @@ discard block |
||
| 855 | 855 | throw MappingException::singleIdNotAllowedOnCompositePrimaryKey($this->className); |
| 856 | 856 | } |
| 857 | 857 | |
| 858 | - if (! isset($this->identifier[0])) { |
|
| 858 | + if ( ! isset($this->identifier[0])) { |
|
| 859 | 859 | throw MappingException::noIdDefined($this->className); |
| 860 | 860 | } |
| 861 | 861 | |
@@ -914,7 +914,7 @@ discard block |
||
| 914 | 914 | // Association defined as Id field |
| 915 | 915 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
| 916 | 916 | |
| 917 | - if (! $property->isOwningSide()) { |
|
| 917 | + if ( ! $property->isOwningSide()) { |
|
| 918 | 918 | $property = $targetClass->getProperty($property->getMappedBy()); |
| 919 | 919 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
| 920 | 920 | } |
@@ -928,7 +928,7 @@ discard block |
||
| 928 | 928 | $columnName = $joinColumn->getColumnName(); |
| 929 | 929 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 930 | 930 | |
| 931 | - if (! $joinColumn->getType()) { |
|
| 931 | + if ( ! $joinColumn->getType()) { |
|
| 932 | 932 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $em)); |
| 933 | 933 | } |
| 934 | 934 | |
@@ -962,10 +962,10 @@ discard block |
||
| 962 | 962 | { |
| 963 | 963 | $schema = $this->getSchemaName() === null |
| 964 | 964 | ? '' |
| 965 | - : $this->getSchemaName() . '_'; |
|
| 965 | + : $this->getSchemaName().'_'; |
|
| 966 | 966 | |
| 967 | 967 | // replace dots with underscores because PostgreSQL creates temporary tables in a special schema |
| 968 | - return $schema . $this->getTableName() . '_id_tmp'; |
|
| 968 | + return $schema.$this->getTableName().'_id_tmp'; |
|
| 969 | 969 | } |
| 970 | 970 | |
| 971 | 971 | /** |
@@ -999,7 +999,7 @@ discard block |
||
| 999 | 999 | */ |
| 1000 | 1000 | public function setInheritanceType($type) : void |
| 1001 | 1001 | { |
| 1002 | - if (! $this->isInheritanceType($type)) { |
|
| 1002 | + if ( ! $this->isInheritanceType($type)) { |
|
| 1003 | 1003 | throw MappingException::invalidInheritanceType($this->className, $type); |
| 1004 | 1004 | } |
| 1005 | 1005 | |
@@ -1017,7 +1017,7 @@ discard block |
||
| 1017 | 1017 | { |
| 1018 | 1018 | $fieldName = $property->getName(); |
| 1019 | 1019 | |
| 1020 | - if (! isset($this->declaredProperties[$fieldName])) { |
|
| 1020 | + if ( ! isset($this->declaredProperties[$fieldName])) { |
|
| 1021 | 1021 | throw MappingException::invalidOverrideFieldName($this->className, $fieldName); |
| 1022 | 1022 | } |
| 1023 | 1023 | |
@@ -1214,7 +1214,7 @@ discard block |
||
| 1214 | 1214 | $declaringClass = $property->getDeclaringClass(); |
| 1215 | 1215 | |
| 1216 | 1216 | if ($inheritedProperty instanceof FieldMetadata) { |
| 1217 | - if (! $declaringClass->isMappedSuperclass) { |
|
| 1217 | + if ( ! $declaringClass->isMappedSuperclass) { |
|
| 1218 | 1218 | $inheritedProperty->setTableName($property->getTableName()); |
| 1219 | 1219 | } |
| 1220 | 1220 | |
@@ -1325,11 +1325,11 @@ discard block |
||
| 1325 | 1325 | 'method' => $method, |
| 1326 | 1326 | ]; |
| 1327 | 1327 | |
| 1328 | - if (! class_exists($class)) { |
|
| 1328 | + if ( ! class_exists($class)) { |
|
| 1329 | 1329 | throw MappingException::entityListenerClassNotFound($class, $this->className); |
| 1330 | 1330 | } |
| 1331 | 1331 | |
| 1332 | - if (! method_exists($class, $method)) { |
|
| 1332 | + if ( ! method_exists($class, $method)) { |
|
| 1333 | 1333 | throw MappingException::entityListenerMethodNotFound($class, $method, $this->className); |
| 1334 | 1334 | } |
| 1335 | 1335 | |
@@ -1396,7 +1396,7 @@ discard block |
||
| 1396 | 1396 | return; |
| 1397 | 1397 | } |
| 1398 | 1398 | |
| 1399 | - if (! (class_exists($className) || interface_exists($className))) { |
|
| 1399 | + if ( ! (class_exists($className) || interface_exists($className))) { |
|
| 1400 | 1400 | throw MappingException::invalidClassInDiscriminatorMap($className, $this->className); |
| 1401 | 1401 | } |
| 1402 | 1402 | |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | */ |
| 25 | 25 | public static function pathRequired() |
| 26 | 26 | { |
| 27 | - return new self('Specifying the paths to your entities is required ' . |
|
| 27 | + return new self('Specifying the paths to your entities is required '. |
|
| 28 | 28 | 'in the AnnotationDriver to retrieve all class names.'); |
| 29 | 29 | } |
| 30 | 30 | |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | */ |
| 215 | 215 | public static function missingQueryMapping($entity, $queryName) |
| 216 | 216 | { |
| 217 | - return new self('Query named "' . $queryName . '" in "' . $entity . ' requires a result class or result set mapping.'); |
|
| 217 | + return new self('Query named "'.$queryName.'" in "'.$entity.' requires a result class or result set mapping.'); |
|
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | /** |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | */ |
| 226 | 226 | public static function missingResultSetMappingEntity($entity, $resultName) |
| 227 | 227 | { |
| 228 | - return new self('Result set mapping named "' . $resultName . '" in "' . $entity . ' requires a entity class name.'); |
|
| 228 | + return new self('Result set mapping named "'.$resultName.'" in "'.$entity.' requires a entity class name.'); |
|
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | /** |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | */ |
| 237 | 237 | public static function missingResultSetMappingFieldName($entity, $resultName) |
| 238 | 238 | { |
| 239 | - return new self('Result set mapping named "' . $resultName . '" in "' . $entity . ' requires a field name.'); |
|
| 239 | + return new self('Result set mapping named "'.$resultName.'" in "'.$entity.' requires a field name.'); |
|
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | /** |
@@ -283,8 +283,8 @@ discard block |
||
| 283 | 283 | { |
| 284 | 284 | $message = sprintf("The mapping of field '%s' is invalid: The option '%s' is required.", $field, $expectedOption); |
| 285 | 285 | |
| 286 | - if (! empty($hint)) { |
|
| 287 | - $message .= ' (Hint: ' . $hint . ')'; |
|
| 286 | + if ( ! empty($hint)) { |
|
| 287 | + $message .= ' (Hint: '.$hint.')'; |
|
| 288 | 288 | } |
| 289 | 289 | |
| 290 | 290 | return new self($message); |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | */ |
| 314 | 314 | public static function reflectionFailure($entity, ReflectionException $previousException) |
| 315 | 315 | { |
| 316 | - return new self('An error occurred in ' . $entity, 0, $previousException); |
|
| 316 | + return new self('An error occurred in '.$entity, 0, $previousException); |
|
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | /** |
@@ -324,8 +324,8 @@ discard block |
||
| 324 | 324 | */ |
| 325 | 325 | public static function joinColumnMustPointToMappedField($className, $joinColumn) |
| 326 | 326 | { |
| 327 | - return new self('The column ' . $joinColumn . ' must be mapped to a field in class ' |
|
| 328 | - . $className . ' since it is referenced by a join column of another class.'); |
|
| 327 | + return new self('The column '.$joinColumn.' must be mapped to a field in class ' |
|
| 328 | + . $className.' since it is referenced by a join column of another class.'); |
|
| 329 | 329 | } |
| 330 | 330 | |
| 331 | 331 | /** |
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | */ |
| 360 | 360 | public static function propertyTypeIsRequired($className, $propertyName) |
| 361 | 361 | { |
| 362 | - return new self("The attribute 'type' is required for the column description of property " . $className . '::$' . $propertyName . '.'); |
|
| 362 | + return new self("The attribute 'type' is required for the column description of property ".$className.'::$'.$propertyName.'.'); |
|
| 363 | 363 | } |
| 364 | 364 | |
| 365 | 365 | /** |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | */ |
| 370 | 370 | public static function tableIdGeneratorNotImplemented($className) |
| 371 | 371 | { |
| 372 | - return new self('TableIdGenerator is not yet implemented for use with class ' . $className); |
|
| 372 | + return new self('TableIdGenerator is not yet implemented for use with class '.$className); |
|
| 373 | 373 | } |
| 374 | 374 | |
| 375 | 375 | /** |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | */ |
| 396 | 396 | public static function duplicateQueryMapping($entity, $queryName) |
| 397 | 397 | { |
| 398 | - return new self('Query named "' . $queryName . '" in "' . $entity . '" was already declared, but it must be declared only once'); |
|
| 398 | + return new self('Query named "'.$queryName.'" in "'.$entity.'" was already declared, but it must be declared only once'); |
|
| 399 | 399 | } |
| 400 | 400 | |
| 401 | 401 | /** |
@@ -406,7 +406,7 @@ discard block |
||
| 406 | 406 | */ |
| 407 | 407 | public static function duplicateResultSetMapping($entity, $resultName) |
| 408 | 408 | { |
| 409 | - return new self('Result set mapping named "' . $resultName . '" in "' . $entity . '" was already declared, but it must be declared only once'); |
|
| 409 | + return new self('Result set mapping named "'.$resultName.'" in "'.$entity.'" was already declared, but it must be declared only once'); |
|
| 410 | 410 | } |
| 411 | 411 | |
| 412 | 412 | /** |
@@ -416,7 +416,7 @@ discard block |
||
| 416 | 416 | */ |
| 417 | 417 | public static function singleIdNotAllowedOnCompositePrimaryKey($entity) |
| 418 | 418 | { |
| 419 | - return new self('Single id is not allowed on composite primary key in entity ' . $entity); |
|
| 419 | + return new self('Single id is not allowed on composite primary key in entity '.$entity); |
|
| 420 | 420 | } |
| 421 | 421 | |
| 422 | 422 | /** |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | */ |
| 427 | 427 | public static function noIdDefined($entity) |
| 428 | 428 | { |
| 429 | - return new self('No ID defined for entity ' . $entity); |
|
| 429 | + return new self('No ID defined for entity '.$entity); |
|
| 430 | 430 | } |
| 431 | 431 | |
| 432 | 432 | /** |
@@ -436,7 +436,7 @@ discard block |
||
| 436 | 436 | */ |
| 437 | 437 | public static function unsupportedOptimisticLockingType($unsupportedType) |
| 438 | 438 | { |
| 439 | - return new self('Locking type "' . $unsupportedType . '" is not supported by Doctrine.'); |
|
| 439 | + return new self('Locking type "'.$unsupportedType.'" is not supported by Doctrine.'); |
|
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 | /** |
@@ -446,13 +446,13 @@ discard block |
||
| 446 | 446 | */ |
| 447 | 447 | public static function fileMappingDriversRequireConfiguredDirectoryPath($path = null) |
| 448 | 448 | { |
| 449 | - if (! empty($path)) { |
|
| 450 | - $path = '[' . $path . ']'; |
|
| 449 | + if ( ! empty($path)) { |
|
| 450 | + $path = '['.$path.']'; |
|
| 451 | 451 | } |
| 452 | 452 | |
| 453 | 453 | return new self( |
| 454 | - 'File mapping drivers must have a valid directory path, ' . |
|
| 455 | - 'however the given path ' . $path . ' seems to be incorrect!' |
|
| 454 | + 'File mapping drivers must have a valid directory path, '. |
|
| 455 | + 'however the given path '.$path.' seems to be incorrect!' |
|
| 456 | 456 | ); |
| 457 | 457 | } |
| 458 | 458 | |
@@ -468,7 +468,7 @@ discard block |
||
| 468 | 468 | public static function invalidClassInDiscriminatorMap($className, $owningClass) |
| 469 | 469 | { |
| 470 | 470 | return new self(sprintf( |
| 471 | - "Entity class '%s' used in the discriminator map of class '%s' " . |
|
| 471 | + "Entity class '%s' used in the discriminator map of class '%s' ". |
|
| 472 | 472 | 'does not exist.', |
| 473 | 473 | $className, |
| 474 | 474 | $owningClass |
@@ -485,15 +485,15 @@ discard block |
||
| 485 | 485 | public static function duplicateDiscriminatorEntry($className, array $entries, array $map) |
| 486 | 486 | { |
| 487 | 487 | return new self( |
| 488 | - 'The entries ' . implode(', ', $entries) . " in discriminator map of class '" . $className . "' is duplicated. " . |
|
| 489 | - 'If the discriminator map is automatically generated you have to convert it to an explicit discriminator map now. ' . |
|
| 490 | - 'The entries of the current map are: @DiscriminatorMap({' . implode(', ', array_map( |
|
| 491 | - static function ($a, $b) { |
|
| 488 | + 'The entries '.implode(', ', $entries)." in discriminator map of class '".$className."' is duplicated. ". |
|
| 489 | + 'If the discriminator map is automatically generated you have to convert it to an explicit discriminator map now. '. |
|
| 490 | + 'The entries of the current map are: @DiscriminatorMap({'.implode(', ', array_map( |
|
| 491 | + static function($a, $b) { |
|
| 492 | 492 | return sprintf("'%s': '%s'", $a, $b); |
| 493 | 493 | }, |
| 494 | 494 | array_keys($map), |
| 495 | 495 | array_values($map) |
| 496 | - )) . '})' |
|
| 496 | + )).'})' |
|
| 497 | 497 | ); |
| 498 | 498 | } |
| 499 | 499 | |
@@ -556,7 +556,7 @@ discard block |
||
| 556 | 556 | public static function sqlConversionNotAllowedForPrimaryKeyProperties($className, Property $property) |
| 557 | 557 | { |
| 558 | 558 | return new self(sprintf( |
| 559 | - 'It is not possible to set id field "%s" to type "%s" in entity class "%s". ' . |
|
| 559 | + 'It is not possible to set id field "%s" to type "%s" in entity class "%s". '. |
|
| 560 | 560 | 'The type "%s" requires conversion SQL which is not allowed for identifiers.', |
| 561 | 561 | $property->getName(), |
| 562 | 562 | $property->getTypeName(), |
@@ -592,7 +592,7 @@ discard block |
||
| 592 | 592 | */ |
| 593 | 593 | public static function duplicateColumnName($className, $columnName) |
| 594 | 594 | { |
| 595 | - return new self("Duplicate definition of column '" . $columnName . "' on entity '" . $className . "' in a field or discriminator column mapping."); |
|
| 595 | + return new self("Duplicate definition of column '".$columnName."' on entity '".$className."' in a field or discriminator column mapping."); |
|
| 596 | 596 | } |
| 597 | 597 | |
| 598 | 598 | /** |
@@ -603,7 +603,7 @@ discard block |
||
| 603 | 603 | */ |
| 604 | 604 | public static function illegalToManyAssociationOnMappedSuperclass($className, $field) |
| 605 | 605 | { |
| 606 | - return new self("It is illegal to put an inverse side one-to-many or many-to-many association on mapped superclass '" . $className . '#' . $field . "'."); |
|
| 606 | + return new self("It is illegal to put an inverse side one-to-many or many-to-many association on mapped superclass '".$className.'#'.$field."'."); |
|
| 607 | 607 | } |
| 608 | 608 | |
| 609 | 609 | /** |
@@ -615,8 +615,8 @@ discard block |
||
| 615 | 615 | */ |
| 616 | 616 | public static function cannotMapCompositePrimaryKeyEntitiesAsForeignId($className, $targetEntity, $targetField) |
| 617 | 617 | { |
| 618 | - return new self("It is not possible to map entity '" . $className . "' with a composite primary key " . |
|
| 619 | - "as part of the primary key of another entity '" . $targetEntity . '#' . $targetField . "'."); |
|
| 618 | + return new self("It is not possible to map entity '".$className."' with a composite primary key ". |
|
| 619 | + "as part of the primary key of another entity '".$targetEntity.'#'.$targetField."'."); |
|
| 620 | 620 | } |
| 621 | 621 | |
| 622 | 622 | /** |
@@ -670,8 +670,8 @@ discard block |
||
| 670 | 670 | */ |
| 671 | 671 | public static function illegalOrphanRemoval($className, $field) |
| 672 | 672 | { |
| 673 | - return new self('Orphan removal is only allowed on one-to-one and one-to-many ' . |
|
| 674 | - 'associations, but ' . $className . '#' . $field . ' is not.'); |
|
| 673 | + return new self('Orphan removal is only allowed on one-to-one and one-to-many '. |
|
| 674 | + 'associations, but '.$className.'#'.$field.' is not.'); |
|
| 675 | 675 | } |
| 676 | 676 | |
| 677 | 677 | /** |
@@ -703,7 +703,7 @@ discard block |
||
| 703 | 703 | */ |
| 704 | 704 | public static function noInheritanceOnMappedSuperClass($className) |
| 705 | 705 | { |
| 706 | - return new self("It is not supported to define inheritance information on a mapped superclass '" . $className . "'."); |
|
| 706 | + return new self("It is not supported to define inheritance information on a mapped superclass '".$className."'."); |
|
| 707 | 707 | } |
| 708 | 708 | |
| 709 | 709 | /** |
@@ -715,8 +715,8 @@ discard block |
||
| 715 | 715 | public static function mappedClassNotPartOfDiscriminatorMap($className, $rootClassName) |
| 716 | 716 | { |
| 717 | 717 | return new self( |
| 718 | - "Entity '" . $className . "' has to be part of the discriminator map of '" . $rootClassName . "' " . |
|
| 719 | - "to be properly mapped in the inheritance hierarchy. Alternatively you can make '" . $className . "' an abstract class " . |
|
| 718 | + "Entity '".$className."' has to be part of the discriminator map of '".$rootClassName."' ". |
|
| 719 | + "to be properly mapped in the inheritance hierarchy. Alternatively you can make '".$className."' an abstract class ". |
|
| 720 | 720 | 'to avoid this exception from occurring.' |
| 721 | 721 | ); |
| 722 | 722 | } |
@@ -729,7 +729,7 @@ discard block |
||
| 729 | 729 | */ |
| 730 | 730 | public static function lifecycleCallbackMethodNotFound($className, $methodName) |
| 731 | 731 | { |
| 732 | - return new self("Entity '" . $className . "' has no method '" . $methodName . "' to be registered as lifecycle callback."); |
|
| 732 | + return new self("Entity '".$className."' has no method '".$methodName."' to be registered as lifecycle callback."); |
|
| 733 | 733 | } |
| 734 | 734 | |
| 735 | 735 | /** |
@@ -775,7 +775,7 @@ discard block |
||
| 775 | 775 | */ |
| 776 | 776 | public static function invalidFetchMode($className, $annotation) |
| 777 | 777 | { |
| 778 | - return new self("Entity '" . $className . "' has a mapping with invalid fetch mode '" . $annotation . "'"); |
|
| 778 | + return new self("Entity '".$className."' has a mapping with invalid fetch mode '".$annotation."'"); |
|
| 779 | 779 | } |
| 780 | 780 | |
| 781 | 781 | /** |
@@ -785,7 +785,7 @@ discard block |
||
| 785 | 785 | */ |
| 786 | 786 | public static function compositeKeyAssignedIdGeneratorRequired($className) |
| 787 | 787 | { |
| 788 | - return new self("Entity '" . $className . "' has a composite identifier but uses an ID generator other than manually assigning (Identity, Sequence). This is not supported."); |
|
| 788 | + return new self("Entity '".$className."' has a composite identifier but uses an ID generator other than manually assigning (Identity, Sequence). This is not supported."); |
|
| 789 | 789 | } |
| 790 | 790 | |
| 791 | 791 | /** |
@@ -797,7 +797,7 @@ discard block |
||
| 797 | 797 | */ |
| 798 | 798 | public static function invalidTargetEntityClass($targetEntity, $sourceEntity, $associationName) |
| 799 | 799 | { |
| 800 | - return new self("The target-entity '" . $targetEntity . "' cannot be found in '" . $sourceEntity . '#' . $associationName . "'."); |
|
| 800 | + return new self("The target-entity '".$targetEntity."' cannot be found in '".$sourceEntity.'#'.$associationName."'."); |
|
| 801 | 801 | } |
| 802 | 802 | |
| 803 | 803 | /** |
@@ -809,8 +809,8 @@ discard block |
||
| 809 | 809 | */ |
| 810 | 810 | public static function invalidCascadeOption(array $cascades, $className, $propertyName) |
| 811 | 811 | { |
| 812 | - $cascades = implode(', ', array_map(static function ($e) { |
|
| 813 | - return "'" . $e . "'"; |
|
| 812 | + $cascades = implode(', ', array_map(static function($e) { |
|
| 813 | + return "'".$e."'"; |
|
| 814 | 814 | }, $cascades)); |
| 815 | 815 | |
| 816 | 816 | return new self(sprintf( |
@@ -843,7 +843,7 @@ discard block |
||
| 843 | 843 | { |
| 844 | 844 | return new self( |
| 845 | 845 | sprintf( |
| 846 | - 'Infinite nesting detected for embedded property %s::%s. ' . |
|
| 846 | + 'Infinite nesting detected for embedded property %s::%s. '. |
|
| 847 | 847 | 'You cannot embed an embeddable from the same type inside an embeddable.', |
| 848 | 848 | $className, |
| 849 | 849 | $propertyName |
@@ -858,7 +858,7 @@ discard block |
||
| 858 | 858 | { |
| 859 | 859 | return new self( |
| 860 | 860 | sprintf( |
| 861 | - 'Class %s not found in namespaces %s.' . |
|
| 861 | + 'Class %s not found in namespaces %s.'. |
|
| 862 | 862 | $className, |
| 863 | 863 | implode(', ', $namespaces) |
| 864 | 864 | ) |
@@ -306,8 +306,8 @@ discard block |
||
| 306 | 306 | |
| 307 | 307 | // FIXME: Order with composite keys might not be correct |
| 308 | 308 | $sql = 'SELECT ' . $columnName |
| 309 | - . ' FROM ' . $tableName |
|
| 310 | - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
| 309 | + . ' FROM ' . $tableName |
|
| 310 | + . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
| 311 | 311 | |
| 312 | 312 | $flattenedId = $this->em->getIdentifierFlattener()->flattenIdentifier($versionedClass, $id); |
| 313 | 313 | $versionType = $versionProperty->getType(); |
@@ -520,8 +520,8 @@ discard block |
||
| 520 | 520 | } |
| 521 | 521 | |
| 522 | 522 | $sql = 'UPDATE ' . $quotedTableName |
| 523 | - . ' SET ' . implode(', ', $set) |
|
| 524 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
| 523 | + . ' SET ' . implode(', ', $set) |
|
| 524 | + . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
| 525 | 525 | |
| 526 | 526 | $result = $this->conn->executeUpdate($sql, $params, $types); |
| 527 | 527 | |
@@ -930,7 +930,7 @@ discard block |
||
| 930 | 930 | } |
| 931 | 931 | |
| 932 | 932 | foreach ($types as $type) { |
| 933 | - [$field, $value] = $type; |
|
| 933 | + [$field, $value] = $type; |
|
| 934 | 934 | $sqlTypes = array_merge($sqlTypes, $this->getTypes($field, $value, $this->class)); |
| 935 | 935 | } |
| 936 | 936 | |
@@ -1640,9 +1640,9 @@ discard block |
||
| 1640 | 1640 | $lock = $this->getLockTablesSql($lockMode); |
| 1641 | 1641 | $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
| 1642 | 1642 | $sql = 'SELECT 1 ' |
| 1643 | - . $lock |
|
| 1644 | - . $where |
|
| 1645 | - . $lockSql; |
|
| 1643 | + . $lock |
|
| 1644 | + . $where |
|
| 1645 | + . $lockSql; |
|
| 1646 | 1646 | |
| 1647 | 1647 | [$params, $types] = $this->expandParameters($criteria); |
| 1648 | 1648 | |
@@ -2111,8 +2111,8 @@ discard block |
||
| 2111 | 2111 | $alias = $this->getSQLTableAlias($this->class->getTableName()); |
| 2112 | 2112 | |
| 2113 | 2113 | $sql = 'SELECT 1 ' |
| 2114 | - . $this->getLockTablesSql(null) |
|
| 2115 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
| 2114 | + . $this->getLockTablesSql(null) |
|
| 2115 | + . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
| 2116 | 2116 | |
| 2117 | 2117 | [$params, $types] = $this->expandParameters($criteria); |
| 2118 | 2118 | |
@@ -298,16 +298,16 @@ discard block |
||
| 298 | 298 | $tableName = $versionedClass->table->getQuotedQualifiedName($this->platform); |
| 299 | 299 | $columnName = $this->platform->quoteIdentifier($versionProperty->getColumnName()); |
| 300 | 300 | $identifier = array_map( |
| 301 | - function ($columnName) { |
|
| 301 | + function($columnName) { |
|
| 302 | 302 | return $this->platform->quoteIdentifier($columnName); |
| 303 | 303 | }, |
| 304 | 304 | array_keys($versionedClass->getIdentifierColumns($this->em)) |
| 305 | 305 | ); |
| 306 | 306 | |
| 307 | 307 | // FIXME: Order with composite keys might not be correct |
| 308 | - $sql = 'SELECT ' . $columnName |
|
| 309 | - . ' FROM ' . $tableName |
|
| 310 | - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
| 308 | + $sql = 'SELECT '.$columnName |
|
| 309 | + . ' FROM '.$tableName |
|
| 310 | + . ' WHERE '.implode(' = ? AND ', $identifier).' = ?'; |
|
| 311 | 311 | |
| 312 | 312 | $flattenedId = $this->em->getIdentifierFlattener()->flattenIdentifier($versionedClass, $id); |
| 313 | 313 | $versionType = $versionProperty->getType(); |
@@ -346,13 +346,13 @@ discard block |
||
| 346 | 346 | $tableName = $this->class->getTableName(); |
| 347 | 347 | $updateData = $this->prepareUpdateData($entity); |
| 348 | 348 | |
| 349 | - if (! isset($updateData[$tableName])) { |
|
| 349 | + if ( ! isset($updateData[$tableName])) { |
|
| 350 | 350 | return; |
| 351 | 351 | } |
| 352 | 352 | |
| 353 | 353 | $data = $updateData[$tableName]; |
| 354 | 354 | |
| 355 | - if (! $data) { |
|
| 355 | + if ( ! $data) { |
|
| 356 | 356 | return; |
| 357 | 357 | } |
| 358 | 358 | |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | |
| 405 | 405 | if ($value !== null) { |
| 406 | 406 | // @todo guilhermeblanco Make sure we do not have flat association values. |
| 407 | - if (! is_array($value)) { |
|
| 407 | + if ( ! is_array($value)) { |
|
| 408 | 408 | $value = [$targetClass->identifier[0] => $value]; |
| 409 | 409 | } |
| 410 | 410 | |
@@ -417,7 +417,7 @@ discard block |
||
| 417 | 417 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 418 | 418 | $targetField = $targetClass->fieldNames[$referencedColumnName]; |
| 419 | 419 | |
| 420 | - if (! $joinColumn->getType()) { |
|
| 420 | + if ( ! $joinColumn->getType()) { |
|
| 421 | 421 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 422 | 422 | } |
| 423 | 423 | |
@@ -483,7 +483,7 @@ discard block |
||
| 483 | 483 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 484 | 484 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 485 | 485 | |
| 486 | - if (! $joinColumn->getType()) { |
|
| 486 | + if ( ! $joinColumn->getType()) { |
|
| 487 | 487 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 488 | 488 | } |
| 489 | 489 | |
@@ -510,18 +510,18 @@ discard block |
||
| 510 | 510 | case Type::SMALLINT: |
| 511 | 511 | case Type::INTEGER: |
| 512 | 512 | case Type::BIGINT: |
| 513 | - $set[] = $versionColumnName . ' = ' . $versionColumnName . ' + 1'; |
|
| 513 | + $set[] = $versionColumnName.' = '.$versionColumnName.' + 1'; |
|
| 514 | 514 | break; |
| 515 | 515 | |
| 516 | 516 | case Type::DATETIME: |
| 517 | - $set[] = $versionColumnName . ' = CURRENT_TIMESTAMP'; |
|
| 517 | + $set[] = $versionColumnName.' = CURRENT_TIMESTAMP'; |
|
| 518 | 518 | break; |
| 519 | 519 | } |
| 520 | 520 | } |
| 521 | 521 | |
| 522 | - $sql = 'UPDATE ' . $quotedTableName |
|
| 523 | - . ' SET ' . implode(', ', $set) |
|
| 524 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
| 522 | + $sql = 'UPDATE '.$quotedTableName |
|
| 523 | + . ' SET '.implode(', ', $set) |
|
| 524 | + . ' WHERE '.implode(' = ? AND ', $where).' = ?'; |
|
| 525 | 525 | |
| 526 | 526 | $result = $this->conn->executeUpdate($sql, $params, $types); |
| 527 | 527 | |
@@ -538,7 +538,7 @@ discard block |
||
| 538 | 538 | protected function deleteJoinTableRecords($identifier) |
| 539 | 539 | { |
| 540 | 540 | foreach ($this->class->getDeclaredPropertiesIterator() as $association) { |
| 541 | - if (! ($association instanceof ManyToManyAssociationMetadata)) { |
|
| 541 | + if ( ! ($association instanceof ManyToManyAssociationMetadata)) { |
|
| 542 | 542 | continue; |
| 543 | 543 | } |
| 544 | 544 | |
@@ -550,7 +550,7 @@ discard block |
||
| 550 | 550 | $otherKeys = []; |
| 551 | 551 | $keys = []; |
| 552 | 552 | |
| 553 | - if (! $owningAssociation->isOwningSide()) { |
|
| 553 | + if ( ! $owningAssociation->isOwningSide()) { |
|
| 554 | 554 | $class = $this->em->getClassMetadata($association->getTargetEntity()); |
| 555 | 555 | $owningAssociation = $class->getProperty($association->getMappedBy()); |
| 556 | 556 | } |
@@ -660,7 +660,7 @@ discard block |
||
| 660 | 660 | } |
| 661 | 661 | |
| 662 | 662 | // Only owning side of x-1 associations can have a FK column. |
| 663 | - if (! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
| 663 | + if ( ! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
| 664 | 664 | continue; |
| 665 | 665 | } |
| 666 | 666 | |
@@ -680,7 +680,7 @@ discard block |
||
| 680 | 680 | /** @var JoinColumnMetadata $joinColumn */ |
| 681 | 681 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 682 | 682 | |
| 683 | - if (! $joinColumn->getType()) { |
|
| 683 | + if ( ! $joinColumn->getType()) { |
|
| 684 | 684 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 685 | 685 | } |
| 686 | 686 | |
@@ -707,7 +707,7 @@ discard block |
||
| 707 | 707 | $propertyName = $this->class->fieldNames[$columnName]; |
| 708 | 708 | $property = $this->class->getProperty($propertyName); |
| 709 | 709 | |
| 710 | - if (! $property) { |
|
| 710 | + if ( ! $property) { |
|
| 711 | 711 | return null; |
| 712 | 712 | } |
| 713 | 713 | |
@@ -726,7 +726,7 @@ discard block |
||
| 726 | 726 | /** @var JoinColumnMetadata $joinColumn */ |
| 727 | 727 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 728 | 728 | |
| 729 | - if (! $joinColumn->getType()) { |
|
| 729 | + if ( ! $joinColumn->getType()) { |
|
| 730 | 730 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 731 | 731 | } |
| 732 | 732 | |
@@ -831,7 +831,7 @@ discard block |
||
| 831 | 831 | $sourceKeyColumn = $joinColumn->getReferencedColumnName(); |
| 832 | 832 | $targetKeyColumn = $joinColumn->getColumnName(); |
| 833 | 833 | |
| 834 | - if (! isset($sourceClass->fieldNames[$sourceKeyColumn])) { |
|
| 834 | + if ( ! isset($sourceClass->fieldNames[$sourceKeyColumn])) { |
|
| 835 | 835 | throw MappingException::joinColumnMustPointToMappedField( |
| 836 | 836 | $sourceClass->getClassName(), |
| 837 | 837 | $sourceKeyColumn |
@@ -1058,7 +1058,7 @@ discard block |
||
| 1058 | 1058 | $criteria = []; |
| 1059 | 1059 | $parameters = []; |
| 1060 | 1060 | |
| 1061 | - if (! $association->isOwningSide()) { |
|
| 1061 | + if ( ! $association->isOwningSide()) { |
|
| 1062 | 1062 | $class = $this->em->getClassMetadata($association->getTargetEntity()); |
| 1063 | 1063 | $owningAssoc = $class->getProperty($association->getMappedBy()); |
| 1064 | 1064 | } |
@@ -1086,7 +1086,7 @@ discard block |
||
| 1086 | 1086 | $value = $value[$targetClass->identifier[0]]; |
| 1087 | 1087 | } |
| 1088 | 1088 | |
| 1089 | - $criteria[$joinTableName . '.' . $quotedColumnName] = $value; |
|
| 1089 | + $criteria[$joinTableName.'.'.$quotedColumnName] = $value; |
|
| 1090 | 1090 | $parameters[] = [ |
| 1091 | 1091 | 'value' => $value, |
| 1092 | 1092 | 'field' => $fieldName, |
@@ -1136,11 +1136,11 @@ discard block |
||
| 1136 | 1136 | |
| 1137 | 1137 | switch ($lockMode) { |
| 1138 | 1138 | case LockMode::PESSIMISTIC_READ: |
| 1139 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
| 1139 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
| 1140 | 1140 | break; |
| 1141 | 1141 | |
| 1142 | 1142 | case LockMode::PESSIMISTIC_WRITE: |
| 1143 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
| 1143 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
| 1144 | 1144 | break; |
| 1145 | 1145 | } |
| 1146 | 1146 | |
@@ -1151,14 +1151,14 @@ discard block |
||
| 1151 | 1151 | |
| 1152 | 1152 | if ($filterSql !== '') { |
| 1153 | 1153 | $conditionSql = $conditionSql |
| 1154 | - ? $conditionSql . ' AND ' . $filterSql |
|
| 1154 | + ? $conditionSql.' AND '.$filterSql |
|
| 1155 | 1155 | : $filterSql; |
| 1156 | 1156 | } |
| 1157 | 1157 | |
| 1158 | - $select = 'SELECT ' . $columnList; |
|
| 1159 | - $from = ' FROM ' . $tableName . ' ' . $tableAlias; |
|
| 1160 | - $join = $this->currentPersisterContext->selectJoinSql . $joinSql; |
|
| 1161 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : ''); |
|
| 1158 | + $select = 'SELECT '.$columnList; |
|
| 1159 | + $from = ' FROM '.$tableName.' '.$tableAlias; |
|
| 1160 | + $join = $this->currentPersisterContext->selectJoinSql.$joinSql; |
|
| 1161 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : ''); |
|
| 1162 | 1162 | $lock = $this->platform->appendLockHint($from, $lockMode); |
| 1163 | 1163 | $query = $select |
| 1164 | 1164 | . $lock |
@@ -1166,7 +1166,7 @@ discard block |
||
| 1166 | 1166 | . $where |
| 1167 | 1167 | . $orderBySql; |
| 1168 | 1168 | |
| 1169 | - return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql; |
|
| 1169 | + return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql; |
|
| 1170 | 1170 | } |
| 1171 | 1171 | |
| 1172 | 1172 | /** |
@@ -1185,13 +1185,13 @@ discard block |
||
| 1185 | 1185 | |
| 1186 | 1186 | if ($filterSql !== '') { |
| 1187 | 1187 | $conditionSql = $conditionSql |
| 1188 | - ? $conditionSql . ' AND ' . $filterSql |
|
| 1188 | + ? $conditionSql.' AND '.$filterSql |
|
| 1189 | 1189 | : $filterSql; |
| 1190 | 1190 | } |
| 1191 | 1191 | |
| 1192 | 1192 | return 'SELECT COUNT(*) ' |
| 1193 | - . 'FROM ' . $tableName . ' ' . $tableAlias |
|
| 1194 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
| 1193 | + . 'FROM '.$tableName.' '.$tableAlias |
|
| 1194 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
| 1195 | 1195 | } |
| 1196 | 1196 | |
| 1197 | 1197 | /** |
@@ -1206,7 +1206,7 @@ discard block |
||
| 1206 | 1206 | */ |
| 1207 | 1207 | final protected function getOrderBySQL(array $orderBy, $baseTableAlias) |
| 1208 | 1208 | { |
| 1209 | - if (! $orderBy) { |
|
| 1209 | + if ( ! $orderBy) { |
|
| 1210 | 1210 | return ''; |
| 1211 | 1211 | } |
| 1212 | 1212 | |
@@ -1215,7 +1215,7 @@ discard block |
||
| 1215 | 1215 | foreach ($orderBy as $fieldName => $orientation) { |
| 1216 | 1216 | $orientation = strtoupper(trim($orientation)); |
| 1217 | 1217 | |
| 1218 | - if (! in_array($orientation, ['ASC', 'DESC'], true)) { |
|
| 1218 | + if ( ! in_array($orientation, ['ASC', 'DESC'], true)) { |
|
| 1219 | 1219 | throw InvalidOrientation::fromClassNameAndField($this->class->getClassName(), $fieldName); |
| 1220 | 1220 | } |
| 1221 | 1221 | |
@@ -1225,11 +1225,11 @@ discard block |
||
| 1225 | 1225 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
| 1226 | 1226 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
| 1227 | 1227 | |
| 1228 | - $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation; |
|
| 1228 | + $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation; |
|
| 1229 | 1229 | |
| 1230 | 1230 | continue; |
| 1231 | 1231 | } elseif ($property instanceof AssociationMetadata) { |
| 1232 | - if (! $property->isOwningSide()) { |
|
| 1232 | + if ( ! $property->isOwningSide()) { |
|
| 1233 | 1233 | throw InvalidFindByCall::fromInverseSideUsage( |
| 1234 | 1234 | $this->class->getClassName(), |
| 1235 | 1235 | $fieldName |
@@ -1245,7 +1245,7 @@ discard block |
||
| 1245 | 1245 | /** @var JoinColumnMetadata $joinColumn */ |
| 1246 | 1246 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 1247 | 1247 | |
| 1248 | - $orderByList[] = $tableAlias . '.' . $quotedColumnName . ' ' . $orientation; |
|
| 1248 | + $orderByList[] = $tableAlias.'.'.$quotedColumnName.' '.$orientation; |
|
| 1249 | 1249 | } |
| 1250 | 1250 | |
| 1251 | 1251 | continue; |
@@ -1254,7 +1254,7 @@ discard block |
||
| 1254 | 1254 | throw UnrecognizedField::byName($fieldName); |
| 1255 | 1255 | } |
| 1256 | 1256 | |
| 1257 | - return ' ORDER BY ' . implode(', ', $orderByList); |
|
| 1257 | + return ' ORDER BY '.implode(', ', $orderByList); |
|
| 1258 | 1258 | } |
| 1259 | 1259 | |
| 1260 | 1260 | /** |
@@ -1296,7 +1296,7 @@ discard block |
||
| 1296 | 1296 | $isAssocToOneInverseSide = $property instanceof ToOneAssociationMetadata && ! $property->isOwningSide(); |
| 1297 | 1297 | $isAssocFromOneEager = ! $property instanceof ManyToManyAssociationMetadata && $property->getFetchMode() === FetchMode::EAGER; |
| 1298 | 1298 | |
| 1299 | - if (! ($isAssocFromOneEager || $isAssocToOneInverseSide)) { |
|
| 1299 | + if ( ! ($isAssocFromOneEager || $isAssocToOneInverseSide)) { |
|
| 1300 | 1300 | break; |
| 1301 | 1301 | } |
| 1302 | 1302 | |
@@ -1311,7 +1311,7 @@ discard block |
||
| 1311 | 1311 | break; // now this is why you shouldn't use inheritance |
| 1312 | 1312 | } |
| 1313 | 1313 | |
| 1314 | - $assocAlias = 'e' . ($eagerAliasCounter++); |
|
| 1314 | + $assocAlias = 'e'.($eagerAliasCounter++); |
|
| 1315 | 1315 | |
| 1316 | 1316 | $this->currentPersisterContext->rsm->addJoinedEntityResult($targetEntity, $assocAlias, 'r', $fieldName); |
| 1317 | 1317 | |
@@ -1339,14 +1339,14 @@ discard block |
||
| 1339 | 1339 | $this->currentPersisterContext->rsm->addIndexBy($assocAlias, $property->getIndexedBy()); |
| 1340 | 1340 | } |
| 1341 | 1341 | |
| 1342 | - if (! $property->isOwningSide()) { |
|
| 1342 | + if ( ! $property->isOwningSide()) { |
|
| 1343 | 1343 | $owningAssociation = $eagerEntity->getProperty($property->getMappedBy()); |
| 1344 | 1344 | } |
| 1345 | 1345 | |
| 1346 | 1346 | $joinTableAlias = $this->getSQLTableAlias($eagerEntity->getTableName(), $assocAlias); |
| 1347 | 1347 | $joinTableName = $eagerEntity->table->getQuotedQualifiedName($this->platform); |
| 1348 | 1348 | |
| 1349 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $this->getJoinSQLForAssociation($property); |
|
| 1349 | + $this->currentPersisterContext->selectJoinSql .= ' '.$this->getJoinSQLForAssociation($property); |
|
| 1350 | 1350 | |
| 1351 | 1351 | $sourceClass = $this->em->getClassMetadata($owningAssociation->getSourceEntity()); |
| 1352 | 1352 | $targetClass = $this->em->getClassMetadata($owningAssociation->getTargetEntity()); |
@@ -1370,7 +1370,7 @@ discard block |
||
| 1370 | 1370 | $joinCondition[] = $filterSql; |
| 1371 | 1371 | } |
| 1372 | 1372 | |
| 1373 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $joinTableName . ' ' . $joinTableAlias . ' ON '; |
|
| 1373 | + $this->currentPersisterContext->selectJoinSql .= ' '.$joinTableName.' '.$joinTableAlias.' ON '; |
|
| 1374 | 1374 | $this->currentPersisterContext->selectJoinSql .= implode(' AND ', $joinCondition); |
| 1375 | 1375 | |
| 1376 | 1376 | break; |
@@ -1392,7 +1392,7 @@ discard block |
||
| 1392 | 1392 | */ |
| 1393 | 1393 | protected function getSelectColumnAssociationSQL($field, AssociationMetadata $association, ClassMetadata $class, $alias = 'r') |
| 1394 | 1394 | { |
| 1395 | - if (! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
| 1395 | + if ( ! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
| 1396 | 1396 | return ''; |
| 1397 | 1397 | } |
| 1398 | 1398 | |
@@ -1407,7 +1407,7 @@ discard block |
||
| 1407 | 1407 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 1408 | 1408 | $resultColumnName = $this->getSQLColumnAlias(); |
| 1409 | 1409 | |
| 1410 | - if (! $joinColumn->getType()) { |
|
| 1410 | + if ( ! $joinColumn->getType()) { |
|
| 1411 | 1411 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 1412 | 1412 | } |
| 1413 | 1413 | |
@@ -1437,7 +1437,7 @@ discard block |
||
| 1437 | 1437 | $owningAssociation = $association; |
| 1438 | 1438 | $sourceTableAlias = $this->getSQLTableAlias($this->class->getTableName()); |
| 1439 | 1439 | |
| 1440 | - if (! $association->isOwningSide()) { |
|
| 1440 | + if ( ! $association->isOwningSide()) { |
|
| 1441 | 1441 | $targetEntity = $this->em->getClassMetadata($association->getTargetEntity()); |
| 1442 | 1442 | $owningAssociation = $targetEntity->getProperty($association->getMappedBy()); |
| 1443 | 1443 | } |
@@ -1458,7 +1458,7 @@ discard block |
||
| 1458 | 1458 | ); |
| 1459 | 1459 | } |
| 1460 | 1460 | |
| 1461 | - return ' INNER JOIN ' . $joinTableName . ' ON ' . implode(' AND ', $conditions); |
|
| 1461 | + return ' INNER JOIN '.$joinTableName.' ON '.implode(' AND ', $conditions); |
|
| 1462 | 1462 | } |
| 1463 | 1463 | |
| 1464 | 1464 | /** |
@@ -1552,7 +1552,7 @@ discard block |
||
| 1552 | 1552 | $columnName = $joinColumn->getColumnName(); |
| 1553 | 1553 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 1554 | 1554 | |
| 1555 | - if (! $joinColumn->getType()) { |
|
| 1555 | + if ( ! $joinColumn->getType()) { |
|
| 1556 | 1556 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 1557 | 1557 | } |
| 1558 | 1558 | |
@@ -1591,7 +1591,7 @@ discard block |
||
| 1591 | 1591 | |
| 1592 | 1592 | $this->currentPersisterContext->rsm->addFieldResult($alias, $columnAlias, $field, $class->getClassName()); |
| 1593 | 1593 | |
| 1594 | - return $property->getType()->convertToPHPValueSQL($sql, $this->platform) . ' AS ' . $columnAlias; |
|
| 1594 | + return $property->getType()->convertToPHPValueSQL($sql, $this->platform).' AS '.$columnAlias; |
|
| 1595 | 1595 | } |
| 1596 | 1596 | |
| 1597 | 1597 | /** |
@@ -1605,14 +1605,14 @@ discard block |
||
| 1605 | 1605 | protected function getSQLTableAlias($tableName, $assocName = '') |
| 1606 | 1606 | { |
| 1607 | 1607 | if ($tableName) { |
| 1608 | - $tableName .= '#' . $assocName; |
|
| 1608 | + $tableName .= '#'.$assocName; |
|
| 1609 | 1609 | } |
| 1610 | 1610 | |
| 1611 | 1611 | if (isset($this->currentPersisterContext->sqlTableAliases[$tableName])) { |
| 1612 | 1612 | return $this->currentPersisterContext->sqlTableAliases[$tableName]; |
| 1613 | 1613 | } |
| 1614 | 1614 | |
| 1615 | - $tableAlias = 't' . $this->currentPersisterContext->sqlAliasCounter++; |
|
| 1615 | + $tableAlias = 't'.$this->currentPersisterContext->sqlAliasCounter++; |
|
| 1616 | 1616 | |
| 1617 | 1617 | $this->currentPersisterContext->sqlTableAliases[$tableName] = $tableAlias; |
| 1618 | 1618 | |
@@ -1638,7 +1638,7 @@ discard block |
||
| 1638 | 1638 | } |
| 1639 | 1639 | |
| 1640 | 1640 | $lock = $this->getLockTablesSql($lockMode); |
| 1641 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
|
| 1641 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : '').' '; |
|
| 1642 | 1642 | $sql = 'SELECT 1 ' |
| 1643 | 1643 | . $lock |
| 1644 | 1644 | . $where |
@@ -1661,7 +1661,7 @@ discard block |
||
| 1661 | 1661 | $tableName = $this->class->table->getQuotedQualifiedName($this->platform); |
| 1662 | 1662 | |
| 1663 | 1663 | return $this->platform->appendLockHint( |
| 1664 | - 'FROM ' . $tableName . ' ' . $this->getSQLTableAlias($this->class->getTableName()), |
|
| 1664 | + 'FROM '.$tableName.' '.$this->getSQLTableAlias($this->class->getTableName()), |
|
| 1665 | 1665 | $lockMode |
| 1666 | 1666 | ); |
| 1667 | 1667 | } |
@@ -1711,19 +1711,19 @@ discard block |
||
| 1711 | 1711 | |
| 1712 | 1712 | if ($comparison !== null) { |
| 1713 | 1713 | // special case null value handling |
| 1714 | - if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && $value ===null) { |
|
| 1715 | - $selectedColumns[] = $column . ' IS NULL'; |
|
| 1714 | + if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && $value === null) { |
|
| 1715 | + $selectedColumns[] = $column.' IS NULL'; |
|
| 1716 | 1716 | |
| 1717 | 1717 | continue; |
| 1718 | 1718 | } |
| 1719 | 1719 | |
| 1720 | 1720 | if ($comparison === Comparison::NEQ && $value === null) { |
| 1721 | - $selectedColumns[] = $column . ' IS NOT NULL'; |
|
| 1721 | + $selectedColumns[] = $column.' IS NOT NULL'; |
|
| 1722 | 1722 | |
| 1723 | 1723 | continue; |
| 1724 | 1724 | } |
| 1725 | 1725 | |
| 1726 | - $selectedColumns[] = $column . ' ' . sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
| 1726 | + $selectedColumns[] = $column.' '.sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
| 1727 | 1727 | |
| 1728 | 1728 | continue; |
| 1729 | 1729 | } |
@@ -1771,7 +1771,7 @@ discard block |
||
| 1771 | 1771 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
| 1772 | 1772 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
| 1773 | 1773 | |
| 1774 | - return [$tableAlias . '.' . $columnName]; |
|
| 1774 | + return [$tableAlias.'.'.$columnName]; |
|
| 1775 | 1775 | } |
| 1776 | 1776 | |
| 1777 | 1777 | if ($property instanceof AssociationMetadata) { |
@@ -1780,7 +1780,7 @@ discard block |
||
| 1780 | 1780 | |
| 1781 | 1781 | // Many-To-Many requires join table check for joinColumn |
| 1782 | 1782 | if ($owningAssociation instanceof ManyToManyAssociationMetadata) { |
| 1783 | - if (! $owningAssociation->isOwningSide()) { |
|
| 1783 | + if ( ! $owningAssociation->isOwningSide()) { |
|
| 1784 | 1784 | $owningAssociation = $association; |
| 1785 | 1785 | } |
| 1786 | 1786 | |
@@ -1793,10 +1793,10 @@ discard block |
||
| 1793 | 1793 | foreach ($joinColumns as $joinColumn) { |
| 1794 | 1794 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 1795 | 1795 | |
| 1796 | - $columns[] = $joinTableName . '.' . $quotedColumnName; |
|
| 1796 | + $columns[] = $joinTableName.'.'.$quotedColumnName; |
|
| 1797 | 1797 | } |
| 1798 | 1798 | } else { |
| 1799 | - if (! $owningAssociation->isOwningSide()) { |
|
| 1799 | + if ( ! $owningAssociation->isOwningSide()) { |
|
| 1800 | 1800 | throw InvalidFindByCall::fromInverseSideUsage( |
| 1801 | 1801 | $this->class->getClassName(), |
| 1802 | 1802 | $field |
@@ -1811,7 +1811,7 @@ discard block |
||
| 1811 | 1811 | foreach ($owningAssociation->getJoinColumns() as $joinColumn) { |
| 1812 | 1812 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 1813 | 1813 | |
| 1814 | - $columns[] = $tableAlias . '.' . $quotedColumnName; |
|
| 1814 | + $columns[] = $tableAlias.'.'.$quotedColumnName; |
|
| 1815 | 1815 | } |
| 1816 | 1816 | } |
| 1817 | 1817 | |
@@ -1920,7 +1920,7 @@ discard block |
||
| 1920 | 1920 | $value = $value[$targetClass->identifier[0]]; |
| 1921 | 1921 | } |
| 1922 | 1922 | |
| 1923 | - $criteria[$tableAlias . '.' . $quotedColumnName] = $value; |
|
| 1923 | + $criteria[$tableAlias.'.'.$quotedColumnName] = $value; |
|
| 1924 | 1924 | $parameters[] = [ |
| 1925 | 1925 | 'value' => $value, |
| 1926 | 1926 | 'field' => $fieldName, |
@@ -2005,7 +2005,7 @@ discard block |
||
| 2005 | 2005 | case $property instanceof AssociationMetadata: |
| 2006 | 2006 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
| 2007 | 2007 | |
| 2008 | - if (! $property->isOwningSide()) { |
|
| 2008 | + if ( ! $property->isOwningSide()) { |
|
| 2009 | 2009 | $property = $class->getProperty($property->getMappedBy()); |
| 2010 | 2010 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
| 2011 | 2011 | } |
@@ -2018,7 +2018,7 @@ discard block |
||
| 2018 | 2018 | /** @var JoinColumnMetadata $joinColumn */ |
| 2019 | 2019 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 2020 | 2020 | |
| 2021 | - if (! $joinColumn->getType()) { |
|
| 2021 | + if ( ! $joinColumn->getType()) { |
|
| 2022 | 2022 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em)); |
| 2023 | 2023 | } |
| 2024 | 2024 | |
@@ -2033,7 +2033,7 @@ discard block |
||
| 2033 | 2033 | } |
| 2034 | 2034 | |
| 2035 | 2035 | if (is_array($value)) { |
| 2036 | - return array_map(static function ($type) { |
|
| 2036 | + return array_map(static function($type) { |
|
| 2037 | 2037 | return $type->getBindingType() + Connection::ARRAY_PARAM_OFFSET; |
| 2038 | 2038 | }, $types); |
| 2039 | 2039 | } |
@@ -2090,7 +2090,7 @@ discard block |
||
| 2090 | 2090 | */ |
| 2091 | 2091 | private function getIndividualValue($value) |
| 2092 | 2092 | { |
| 2093 | - if (! is_object($value) || ! $this->em->getMetadataFactory()->hasMetadataFor(StaticClassNameConverter::getClass($value))) { |
|
| 2093 | + if ( ! is_object($value) || ! $this->em->getMetadataFactory()->hasMetadataFor(StaticClassNameConverter::getClass($value))) { |
|
| 2094 | 2094 | return $value; |
| 2095 | 2095 | } |
| 2096 | 2096 | |
@@ -2104,7 +2104,7 @@ discard block |
||
| 2104 | 2104 | { |
| 2105 | 2105 | $criteria = $this->getIdentifier($entity); |
| 2106 | 2106 | |
| 2107 | - if (! $criteria) { |
|
| 2107 | + if ( ! $criteria) { |
|
| 2108 | 2108 | return false; |
| 2109 | 2109 | } |
| 2110 | 2110 | |
@@ -2112,12 +2112,12 @@ discard block |
||
| 2112 | 2112 | |
| 2113 | 2113 | $sql = 'SELECT 1 ' |
| 2114 | 2114 | . $this->getLockTablesSql(null) |
| 2115 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
| 2115 | + . ' WHERE '.$this->getSelectConditionSQL($criteria); |
|
| 2116 | 2116 | |
| 2117 | 2117 | [$params, $types] = $this->expandParameters($criteria); |
| 2118 | 2118 | |
| 2119 | 2119 | if ($extraConditions !== null) { |
| 2120 | - $sql .= ' AND ' . $this->getSelectConditionCriteriaSQL($extraConditions); |
|
| 2120 | + $sql .= ' AND '.$this->getSelectConditionCriteriaSQL($extraConditions); |
|
| 2121 | 2121 | [$criteriaParams, $criteriaTypes] = $this->expandCriteriaParameters($extraConditions); |
| 2122 | 2122 | |
| 2123 | 2123 | $params = array_merge($params, $criteriaParams); |
@@ -2127,7 +2127,7 @@ discard block |
||
| 2127 | 2127 | $filterSql = $this->generateFilterConditionSQL($this->class, $alias); |
| 2128 | 2128 | |
| 2129 | 2129 | if ($filterSql) { |
| 2130 | - $sql .= ' AND ' . $filterSql; |
|
| 2130 | + $sql .= ' AND '.$filterSql; |
|
| 2131 | 2131 | } |
| 2132 | 2132 | |
| 2133 | 2133 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
@@ -2140,13 +2140,13 @@ discard block |
||
| 2140 | 2140 | */ |
| 2141 | 2141 | protected function getJoinSQLForAssociation(AssociationMetadata $association) |
| 2142 | 2142 | { |
| 2143 | - if (! $association->isOwningSide()) { |
|
| 2143 | + if ( ! $association->isOwningSide()) { |
|
| 2144 | 2144 | return 'LEFT JOIN'; |
| 2145 | 2145 | } |
| 2146 | 2146 | |
| 2147 | 2147 | // if one of the join columns is nullable, return left join |
| 2148 | 2148 | foreach ($association->getJoinColumns() as $joinColumn) { |
| 2149 | - if (! $joinColumn->isNullable()) { |
|
| 2149 | + if ( ! $joinColumn->isNullable()) { |
|
| 2150 | 2150 | continue; |
| 2151 | 2151 | } |
| 2152 | 2152 | |
@@ -2163,7 +2163,7 @@ discard block |
||
| 2163 | 2163 | */ |
| 2164 | 2164 | public function getSQLColumnAlias() |
| 2165 | 2165 | { |
| 2166 | - return $this->platform->getSQLResultCasing('c' . $this->currentPersisterContext->sqlAliasCounter++); |
|
| 2166 | + return $this->platform->getSQLResultCasing('c'.$this->currentPersisterContext->sqlAliasCounter++); |
|
| 2167 | 2167 | } |
| 2168 | 2168 | |
| 2169 | 2169 | /** |
@@ -2182,13 +2182,13 @@ discard block |
||
| 2182 | 2182 | $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias); |
| 2183 | 2183 | |
| 2184 | 2184 | if ($filterExpr !== '') { |
| 2185 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
| 2185 | + $filterClauses[] = '('.$filterExpr.')'; |
|
| 2186 | 2186 | } |
| 2187 | 2187 | } |
| 2188 | 2188 | |
| 2189 | 2189 | $sql = implode(' AND ', $filterClauses); |
| 2190 | 2190 | |
| 2191 | - return $sql ? '(' . $sql . ')' : ''; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
| 2191 | + return $sql ? '('.$sql.')' : ''; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
| 2192 | 2192 | } |
| 2193 | 2193 | |
| 2194 | 2194 | /** |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | foreach ($data as $columnName => $value) { |
| 112 | - if (! is_array($id) || ! isset($id[$columnName])) { |
|
| 112 | + if ( ! is_array($id) || ! isset($id[$columnName])) { |
|
| 113 | 113 | $type = $this->columns[$columnName]->getType(); |
| 114 | 114 | |
| 115 | 115 | $stmt->bindValue($paramIndex++, $value, $type); |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | { |
| 134 | 134 | $updateData = $this->prepareUpdateData($entity); |
| 135 | 135 | |
| 136 | - if (! $updateData) { |
|
| 136 | + if ( ! $updateData) { |
|
| 137 | 137 | return; |
| 138 | 138 | } |
| 139 | 139 | |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | $versionedClass = $this->class->versionProperty->getDeclaringClass(); |
| 152 | 152 | $versionedTable = $versionedClass->getTableName(); |
| 153 | 153 | |
| 154 | - if (! isset($updateData[$versionedTable])) { |
|
| 154 | + if ( ! isset($updateData[$versionedTable])) { |
|
| 155 | 155 | $tableName = $versionedClass->table->getQuotedQualifiedName($this->platform); |
| 156 | 156 | |
| 157 | 157 | $this->updateTable($entity, $tableName, [], true); |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | |
| 233 | 233 | if ($filterSql) { |
| 234 | 234 | $conditionSql .= $conditionSql |
| 235 | - ? ' AND ' . $filterSql |
|
| 235 | + ? ' AND '.$filterSql |
|
| 236 | 236 | : $filterSql; |
| 237 | 237 | } |
| 238 | 238 | |
@@ -240,26 +240,26 @@ discard block |
||
| 240 | 240 | |
| 241 | 241 | switch ($lockMode) { |
| 242 | 242 | case LockMode::PESSIMISTIC_READ: |
| 243 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
| 243 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
| 244 | 244 | break; |
| 245 | 245 | |
| 246 | 246 | case LockMode::PESSIMISTIC_WRITE: |
| 247 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
| 247 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
| 248 | 248 | break; |
| 249 | 249 | } |
| 250 | 250 | |
| 251 | 251 | $tableName = $this->class->table->getQuotedQualifiedName($this->platform); |
| 252 | - $from = ' FROM ' . $tableName . ' ' . $baseTableAlias; |
|
| 253 | - $where = $conditionSql !== '' ? ' WHERE ' . $conditionSql : ''; |
|
| 252 | + $from = ' FROM '.$tableName.' '.$baseTableAlias; |
|
| 253 | + $where = $conditionSql !== '' ? ' WHERE '.$conditionSql : ''; |
|
| 254 | 254 | $lock = $this->platform->appendLockHint($from, $lockMode); |
| 255 | 255 | $columnList = $this->getSelectColumnsSQL(); |
| 256 | - $query = 'SELECT ' . $columnList |
|
| 256 | + $query = 'SELECT '.$columnList |
|
| 257 | 257 | . $lock |
| 258 | 258 | . $joinSql |
| 259 | 259 | . $where |
| 260 | 260 | . $orderBySql; |
| 261 | 261 | |
| 262 | - return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql; |
|
| 262 | + return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql; |
|
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | /** |
@@ -281,14 +281,14 @@ discard block |
||
| 281 | 281 | |
| 282 | 282 | if ($filterSql !== '') { |
| 283 | 283 | $conditionSql = $conditionSql |
| 284 | - ? $conditionSql . ' AND ' . $filterSql |
|
| 284 | + ? $conditionSql.' AND '.$filterSql |
|
| 285 | 285 | : $filterSql; |
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | return 'SELECT COUNT(*) ' |
| 289 | - . 'FROM ' . $tableName . ' ' . $baseTableAlias |
|
| 289 | + . 'FROM '.$tableName.' '.$baseTableAlias |
|
| 290 | 290 | . $joinSql |
| 291 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
| 291 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | /** |
@@ -307,18 +307,18 @@ discard block |
||
| 307 | 307 | $conditions = []; |
| 308 | 308 | $tableName = $parentClass->table->getQuotedQualifiedName($this->platform); |
| 309 | 309 | $tableAlias = $this->getSQLTableAlias($parentClass->getTableName()); |
| 310 | - $joinSql .= ' INNER JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
| 310 | + $joinSql .= ' INNER JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
| 311 | 311 | |
| 312 | 312 | foreach ($identifierColumns as $idColumn) { |
| 313 | 313 | $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName()); |
| 314 | 314 | |
| 315 | - $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
| 315 | + $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 | $joinSql .= implode(' AND ', $conditions); |
| 319 | 319 | } |
| 320 | 320 | |
| 321 | - return parent::getLockTablesSql($lockMode) . $joinSql; |
|
| 321 | + return parent::getLockTablesSql($lockMode).$joinSql; |
|
| 322 | 322 | } |
| 323 | 323 | |
| 324 | 324 | /** |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | continue; |
| 346 | 346 | } |
| 347 | 347 | |
| 348 | - if (! ($property instanceof ToOneAssociationMetadata) || ! $property->isOwningSide()) { |
|
| 348 | + if ( ! ($property instanceof ToOneAssociationMetadata) || ! $property->isOwningSide()) { |
|
| 349 | 349 | continue; |
| 350 | 350 | } |
| 351 | 351 | |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | /** @var JoinColumnMetadata $joinColumn */ |
| 356 | 356 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 357 | 357 | |
| 358 | - if (! $joinColumn->getType()) { |
|
| 358 | + if ( ! $joinColumn->getType()) { |
|
| 359 | 359 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 360 | 360 | } |
| 361 | 361 | |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | $this->currentPersisterContext->rsm->setDiscriminatorColumn('r', $resultColumnName); |
| 375 | 375 | $this->currentPersisterContext->rsm->addMetaResult('r', $resultColumnName, $discrColumnName, false, $discrColumnType); |
| 376 | 376 | |
| 377 | - $columnList[] = $discrColumnType->convertToDatabaseValueSQL($discrTableAlias . '.' . $quotedColumnName, $this->platform); |
|
| 377 | + $columnList[] = $discrColumnType->convertToDatabaseValueSQL($discrTableAlias.'.'.$quotedColumnName, $this->platform); |
|
| 378 | 378 | |
| 379 | 379 | // sub tables |
| 380 | 380 | foreach ($this->class->getSubClasses() as $subClassName) { |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | /** @var JoinColumnMetadata $joinColumn */ |
| 399 | 399 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 400 | 400 | |
| 401 | - if (! $joinColumn->getType()) { |
|
| 401 | + if ( ! $joinColumn->getType()) { |
|
| 402 | 402 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 403 | 403 | } |
| 404 | 404 | |
@@ -448,7 +448,7 @@ discard block |
||
| 448 | 448 | $columnName = $joinColumn->getColumnName(); |
| 449 | 449 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 450 | 450 | |
| 451 | - if (! $joinColumn->getType()) { |
|
| 451 | + if ( ! $joinColumn->getType()) { |
|
| 452 | 452 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 453 | 453 | } |
| 454 | 454 | |
@@ -504,12 +504,12 @@ discard block |
||
| 504 | 504 | $conditions = []; |
| 505 | 505 | $tableName = $parentClass->table->getQuotedQualifiedName($this->platform); |
| 506 | 506 | $tableAlias = $this->getSQLTableAlias($parentClass->getTableName()); |
| 507 | - $joinSql .= ' INNER JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
| 507 | + $joinSql .= ' INNER JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
| 508 | 508 | |
| 509 | 509 | foreach ($identifierColumns as $idColumn) { |
| 510 | 510 | $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName()); |
| 511 | 511 | |
| 512 | - $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
| 512 | + $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
| 513 | 513 | } |
| 514 | 514 | |
| 515 | 515 | $joinSql .= implode(' AND ', $conditions); |
@@ -521,12 +521,12 @@ discard block |
||
| 521 | 521 | $subClass = $this->em->getClassMetadata($subClassName); |
| 522 | 522 | $tableName = $subClass->table->getQuotedQualifiedName($this->platform); |
| 523 | 523 | $tableAlias = $this->getSQLTableAlias($subClass->getTableName()); |
| 524 | - $joinSql .= ' LEFT JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
| 524 | + $joinSql .= ' LEFT JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
| 525 | 525 | |
| 526 | 526 | foreach ($identifierColumns as $idColumn) { |
| 527 | 527 | $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName()); |
| 528 | 528 | |
| 529 | - $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
| 529 | + $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
| 530 | 530 | } |
| 531 | 531 | |
| 532 | 532 | $joinSql .= implode(' AND ', $conditions); |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | // the entire collection with a new would trigger this operation. |
| 34 | 34 | $association = $collection->getMapping(); |
| 35 | 35 | |
| 36 | - if (! $association->isOrphanRemoval()) { |
|
| 36 | + if ( ! $association->isOrphanRemoval()) { |
|
| 37 | 37 | // Handling non-orphan removal should never happen, as @OneToMany |
| 38 | 38 | // can only be inverse side. For owning side one to many, it is |
| 39 | 39 | // required to have a join table, which would classify as a ManyToManyPersister. |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | { |
| 66 | 66 | $association = $collection->getMapping(); |
| 67 | 67 | |
| 68 | - if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
| 68 | + if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
| 69 | 69 | throw new BadMethodCallException('Selecting a collection by index is only supported on indexed collections.'); |
| 70 | 70 | } |
| 71 | 71 | |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | { |
| 115 | 115 | $association = $collection->getMapping(); |
| 116 | 116 | |
| 117 | - if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
| 117 | + if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
| 118 | 118 | throw new BadMethodCallException('Selecting a collection by index is only supported on indexed collections.'); |
| 119 | 119 | } |
| 120 | 120 | |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | */ |
| 137 | 137 | public function contains(PersistentCollection $collection, $element) |
| 138 | 138 | { |
| 139 | - if (! $this->isValidEntityState($element)) { |
|
| 139 | + if ( ! $this->isValidEntityState($element)) { |
|
| 140 | 140 | return false; |
| 141 | 141 | } |
| 142 | 142 | |
@@ -160,12 +160,12 @@ discard block |
||
| 160 | 160 | { |
| 161 | 161 | $association = $collection->getMapping(); |
| 162 | 162 | |
| 163 | - if (! $association->isOrphanRemoval()) { |
|
| 163 | + if ( ! $association->isOrphanRemoval()) { |
|
| 164 | 164 | // no-op: this is not the owning side, therefore no operations should be applied |
| 165 | 165 | return false; |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | - if (! $this->isValidEntityState($element)) { |
|
| 168 | + if ( ! $this->isValidEntityState($element)) { |
|
| 169 | 169 | return false; |
| 170 | 170 | } |
| 171 | 171 | |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | $tableName = $targetClass->table->getQuotedQualifiedName($this->platform); |
| 206 | - $statement = 'DELETE FROM ' . $tableName . ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?'; |
|
| 206 | + $statement = 'DELETE FROM '.$tableName.' WHERE '.implode(' = ? AND ', $columns).' = ?'; |
|
| 207 | 207 | |
| 208 | 208 | return $this->conn->executeUpdate($statement, $parameters); |
| 209 | 209 | } |
@@ -240,17 +240,17 @@ discard block |
||
| 240 | 240 | ]; |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | - $statement = $this->platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable |
|
| 244 | - . ' (' . $this->platform->getColumnDeclarationListSQL($columnDefinitions) . ')'; |
|
| 243 | + $statement = $this->platform->getCreateTemporaryTableSnippetSQL().' '.$tempTable |
|
| 244 | + . ' ('.$this->platform->getColumnDeclarationListSQL($columnDefinitions).')'; |
|
| 245 | 245 | |
| 246 | 246 | $this->conn->executeUpdate($statement); |
| 247 | 247 | |
| 248 | 248 | // 2) Build insert table records into temporary table |
| 249 | - $dql = ' SELECT t0.' . implode(', t0.', $rootClass->getIdentifierFieldNames()) |
|
| 250 | - . ' FROM ' . $targetClass->getClassName() . ' t0 WHERE t0.' . $association->getMappedBy() . ' = :owner'; |
|
| 249 | + $dql = ' SELECT t0.'.implode(', t0.', $rootClass->getIdentifierFieldNames()) |
|
| 250 | + . ' FROM '.$targetClass->getClassName().' t0 WHERE t0.'.$association->getMappedBy().' = :owner'; |
|
| 251 | 251 | $query = $this->em->createQuery($dql)->setParameter('owner', $collection->getOwner()); |
| 252 | 252 | |
| 253 | - $statement = 'INSERT INTO ' . $tempTable . ' (' . $idColumnNameList . ') ' . $query->getSQL(); |
|
| 253 | + $statement = 'INSERT INTO '.$tempTable.' ('.$idColumnNameList.') '.$query->getSQL(); |
|
| 254 | 254 | $parameters = array_values($sourcePersister->getIdentifier($collection->getOwner())); |
| 255 | 255 | $numDeleted = $this->conn->executeUpdate($statement, $parameters); |
| 256 | 256 | |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | // 4) Delete records on each table in the hierarchy |
| 266 | 266 | $hierarchyClasses = array_merge( |
| 267 | 267 | array_map( |
| 268 | - function ($className) { |
|
| 268 | + function($className) { |
|
| 269 | 269 | return $this->em->getClassMetadata($className); |
| 270 | 270 | }, |
| 271 | 271 | array_reverse($targetClass->getSubClasses()) |