@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | $this->ensureDirectoryIsReady(dirname($filePath)); |
| 38 | 38 | |
| 39 | - $tmpFileName = $filePath . '.' . uniqid('', true); |
|
| 39 | + $tmpFileName = $filePath.'.'.uniqid('', true); |
|
| 40 | 40 | |
| 41 | 41 | file_put_contents($tmpFileName, $sourceCode); |
| 42 | 42 | @chmod($tmpFileName, 0664); |
@@ -50,11 +50,11 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | private function ensureDirectoryIsReady(string $directory) |
| 52 | 52 | { |
| 53 | - if (! is_dir($directory) && (@mkdir($directory, 0775, true) === false)) { |
|
| 53 | + if ( ! is_dir($directory) && (@mkdir($directory, 0775, true) === false)) { |
|
| 54 | 54 | throw new RuntimeException(sprintf('Your metadata directory "%s" must be writable', $directory)); |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - if (! is_writable($directory)) { |
|
| 57 | + if ( ! is_writable($directory)) { |
|
| 58 | 58 | throw new RuntimeException(sprintf('Your proxy directory "%s" must be writable', $directory)); |
| 59 | 59 | } |
| 60 | 60 | } |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | */ |
| 43 | 43 | public function register($object) |
| 44 | 44 | { |
| 45 | - if (! is_object($object)) { |
|
| 45 | + if ( ! is_object($object)) { |
|
| 46 | 46 | throw new InvalidArgumentException(sprintf('An object was expected, but got "%s".', gettype($object))); |
| 47 | 47 | } |
| 48 | 48 | |
@@ -24,30 +24,30 @@ |
||
| 24 | 24 | */ |
| 25 | 25 | public function export($value, int $indentationLevel = 0) : string |
| 26 | 26 | { |
| 27 | - if (! is_array($value)) { |
|
| 27 | + if ( ! is_array($value)) { |
|
| 28 | 28 | return var_export($value, true); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | $indentation = str_repeat(self::INDENTATION, $indentationLevel); |
| 32 | - $longestKey = array_reduce(array_keys($value), static function ($k, $v) { |
|
| 32 | + $longestKey = array_reduce(array_keys($value), static function($k, $v) { |
|
| 33 | 33 | return (string) (strlen((string) $k) > strlen((string) $v) ? $k : $v); |
| 34 | 34 | }); |
| 35 | 35 | $maxKeyLength = strlen($longestKey) + (is_numeric($longestKey) ? 0 : 2); |
| 36 | 36 | |
| 37 | 37 | $lines = []; |
| 38 | 38 | |
| 39 | - $lines[] = $indentation . '['; |
|
| 39 | + $lines[] = $indentation.'['; |
|
| 40 | 40 | |
| 41 | 41 | foreach ($value as $entryKey => $entryValue) { |
| 42 | 42 | $lines[] = sprintf( |
| 43 | 43 | '%s%s => %s,', |
| 44 | - $indentation . self::INDENTATION, |
|
| 44 | + $indentation.self::INDENTATION, |
|
| 45 | 45 | str_pad(var_export($entryKey, true), $maxKeyLength), |
| 46 | 46 | ltrim($this->export($entryValue, $indentationLevel + 1)) |
| 47 | 47 | ); |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - $lines[] = $indentation . ']'; |
|
| 50 | + $lines[] = $indentation.']'; |
|
| 51 | 51 | |
| 52 | 52 | return implode(PHP_EOL, $lines); |
| 53 | 53 | } |
@@ -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 | } |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | { |
| 38 | 38 | $association = $collection->getMapping(); |
| 39 | 39 | |
| 40 | - if (! $association->isOwningSide()) { |
|
| 40 | + if ( ! $association->isOwningSide()) { |
|
| 41 | 41 | return; // ignore inverse side |
| 42 | 42 | } |
| 43 | 43 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | /** @var JoinColumnMetadata $joinColumn */ |
| 50 | 50 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 51 | 51 | |
| 52 | - if (! $joinColumn->getType()) { |
|
| 52 | + if ( ! $joinColumn->getType()) { |
|
| 53 | 53 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em)); |
| 54 | 54 | } |
| 55 | 55 | |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | { |
| 70 | 70 | $association = $collection->getMapping(); |
| 71 | 71 | |
| 72 | - if (! $association->isOwningSide()) { |
|
| 72 | + if ( ! $association->isOwningSide()) { |
|
| 73 | 73 | return; // ignore inverse side |
| 74 | 74 | } |
| 75 | 75 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | { |
| 101 | 101 | $association = $collection->getMapping(); |
| 102 | 102 | |
| 103 | - if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
| 103 | + if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
| 104 | 104 | throw new BadMethodCallException('Selecting a collection by index is only supported on indexed collections.'); |
| 105 | 105 | } |
| 106 | 106 | |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 145 | 145 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 146 | 146 | |
| 147 | - if (! $joinColumn->getType()) { |
|
| 147 | + if ( ! $joinColumn->getType()) { |
|
| 148 | 148 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $sourceClass, $this->em)); |
| 149 | 149 | } |
| 150 | 150 | |
@@ -176,9 +176,9 @@ discard block |
||
| 176 | 176 | }*/ |
| 177 | 177 | |
| 178 | 178 | $sql = 'SELECT COUNT(*)' |
| 179 | - . ' FROM ' . $joinTableName . ' t' |
|
| 179 | + . ' FROM '.$joinTableName.' t' |
|
| 180 | 180 | . $joinTargetEntitySQL |
| 181 | - . ' WHERE ' . implode(' AND ', $conditions); |
|
| 181 | + . ' WHERE '.implode(' AND ', $conditions); |
|
| 182 | 182 | |
| 183 | 183 | return $this->conn->fetchColumn($sql, $params, 0, $types); |
| 184 | 184 | } |
@@ -200,13 +200,13 @@ discard block |
||
| 200 | 200 | { |
| 201 | 201 | $association = $collection->getMapping(); |
| 202 | 202 | |
| 203 | - if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
| 203 | + if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
| 204 | 204 | throw new BadMethodCallException('Selecting a collection by index is only supported on indexed collections.'); |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | [$quotedJoinTable, $whereClauses, $params, $types] = $this->getJoinTableRestrictionsWithKey($collection, $key, true); |
| 208 | 208 | |
| 209 | - $sql = 'SELECT 1 FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); |
|
| 209 | + $sql = 'SELECT 1 FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses); |
|
| 210 | 210 | |
| 211 | 211 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
| 212 | 212 | } |
@@ -216,13 +216,13 @@ discard block |
||
| 216 | 216 | */ |
| 217 | 217 | public function contains(PersistentCollection $collection, $element) |
| 218 | 218 | { |
| 219 | - if (! $this->isValidEntityState($element)) { |
|
| 219 | + if ( ! $this->isValidEntityState($element)) { |
|
| 220 | 220 | return false; |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | [$quotedJoinTable, $whereClauses, $params, $types] = $this->getJoinTableRestrictions($collection, $element, true); |
| 224 | 224 | |
| 225 | - $sql = 'SELECT 1 FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); |
|
| 225 | + $sql = 'SELECT 1 FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses); |
|
| 226 | 226 | |
| 227 | 227 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
| 228 | 228 | } |
@@ -232,13 +232,13 @@ discard block |
||
| 232 | 232 | */ |
| 233 | 233 | public function removeElement(PersistentCollection $collection, $element) |
| 234 | 234 | { |
| 235 | - if (! $this->isValidEntityState($element)) { |
|
| 235 | + if ( ! $this->isValidEntityState($element)) { |
|
| 236 | 236 | return false; |
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | [$quotedJoinTable, $whereClauses, $params, $types] = $this->getJoinTableRestrictions($collection, $element, false); |
| 240 | 240 | |
| 241 | - $sql = 'DELETE FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); |
|
| 241 | + $sql = 'DELETE FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses); |
|
| 242 | 242 | |
| 243 | 243 | return (bool) $this->conn->executeUpdate($sql, $params, $types); |
| 244 | 244 | } |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | $onConditions = $this->getOnConditionSQL($association); |
| 257 | 257 | $whereClauses = $params = $types = []; |
| 258 | 258 | |
| 259 | - if (! $association->isOwningSide()) { |
|
| 259 | + if ( ! $association->isOwningSide()) { |
|
| 260 | 260 | $association = $targetClass->getProperty($association->getMappedBy()); |
| 261 | 261 | $joinColumns = $association->getJoinTable()->getInverseJoinColumns(); |
| 262 | 262 | } else { |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 269 | 269 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 270 | 270 | |
| 271 | - if (! $joinColumn->getType()) { |
|
| 271 | + if ( ! $joinColumn->getType()) { |
|
| 272 | 272 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $ownerMetadata, $this->em)); |
| 273 | 273 | } |
| 274 | 274 | |
@@ -296,11 +296,11 @@ discard block |
||
| 296 | 296 | |
| 297 | 297 | $resultSetMapping->addRootEntityFromClassMetadata($targetClass->getClassName(), 'te'); |
| 298 | 298 | |
| 299 | - $sql = 'SELECT ' . $resultSetMapping->generateSelectClause() |
|
| 300 | - . ' FROM ' . $tableName . ' te' |
|
| 301 | - . ' JOIN ' . $joinTableName . ' t ON' |
|
| 299 | + $sql = 'SELECT '.$resultSetMapping->generateSelectClause() |
|
| 300 | + . ' FROM '.$tableName.' te' |
|
| 301 | + . ' JOIN '.$joinTableName.' t ON' |
|
| 302 | 302 | . implode(' AND ', $onConditions) |
| 303 | - . ' WHERE ' . implode(' AND ', $whereClauses); |
|
| 303 | + . ' WHERE '.implode(' AND ', $whereClauses); |
|
| 304 | 304 | |
| 305 | 305 | $sql .= $this->getOrderingSql($criteria, $targetClass); |
| 306 | 306 | $sql .= $this->getLimitSql($criteria); |
@@ -335,8 +335,8 @@ discard block |
||
| 335 | 335 | |
| 336 | 336 | // A join is needed if there is filtering on the target entity |
| 337 | 337 | $tableName = $rootClass->table->getQuotedQualifiedName($this->platform); |
| 338 | - $joinSql = ' JOIN ' . $tableName . ' te' |
|
| 339 | - . ' ON' . implode(' AND ', $this->getOnConditionSQL($association)); |
|
| 338 | + $joinSql = ' JOIN '.$tableName.' te' |
|
| 339 | + . ' ON'.implode(' AND ', $this->getOnConditionSQL($association)); |
|
| 340 | 340 | |
| 341 | 341 | return [$joinSql, $filterSql]; |
| 342 | 342 | } |
@@ -357,18 +357,18 @@ discard block |
||
| 357 | 357 | $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias); |
| 358 | 358 | |
| 359 | 359 | if ($filterExpr) { |
| 360 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
| 360 | + $filterClauses[] = '('.$filterExpr.')'; |
|
| 361 | 361 | } |
| 362 | 362 | } |
| 363 | 363 | |
| 364 | - if (! $filterClauses) { |
|
| 364 | + if ( ! $filterClauses) { |
|
| 365 | 365 | return ''; |
| 366 | 366 | } |
| 367 | 367 | |
| 368 | 368 | $filterSql = implode(' AND ', $filterClauses); |
| 369 | 369 | |
| 370 | 370 | return isset($filterClauses[1]) |
| 371 | - ? '(' . $filterSql . ')' |
|
| 371 | + ? '('.$filterSql.')' |
|
| 372 | 372 | : $filterSql; |
| 373 | 373 | } |
| 374 | 374 | |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 396 | 396 | $quotedReferencedColumnName = $this->platform->quoteIdentifier($joinColumn->getReferencedColumnName()); |
| 397 | 397 | |
| 398 | - $conditions[] = ' t.' . $quotedColumnName . ' = te.' . $quotedReferencedColumnName; |
|
| 398 | + $conditions[] = ' t.'.$quotedColumnName.' = te.'.$quotedReferencedColumnName; |
|
| 399 | 399 | } |
| 400 | 400 | |
| 401 | 401 | return $conditions; |
@@ -417,7 +417,7 @@ discard block |
||
| 417 | 417 | $columns[] = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 418 | 418 | } |
| 419 | 419 | |
| 420 | - return 'DELETE FROM ' . $joinTableName . ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?'; |
|
| 420 | + return 'DELETE FROM '.$joinTableName.' WHERE '.implode(' = ? AND ', $columns).' = ?'; |
|
| 421 | 421 | } |
| 422 | 422 | |
| 423 | 423 | /** |
@@ -472,7 +472,7 @@ discard block |
||
| 472 | 472 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 473 | 473 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 474 | 474 | |
| 475 | - if (! $joinColumn->getType()) { |
|
| 475 | + if ( ! $joinColumn->getType()) { |
|
| 476 | 476 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em)); |
| 477 | 477 | } |
| 478 | 478 | |
@@ -485,7 +485,7 @@ discard block |
||
| 485 | 485 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 486 | 486 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 487 | 487 | |
| 488 | - if (! $joinColumn->getType()) { |
|
| 488 | + if ( ! $joinColumn->getType()) { |
|
| 489 | 489 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 490 | 490 | } |
| 491 | 491 | |
@@ -536,7 +536,7 @@ discard block |
||
| 536 | 536 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 537 | 537 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 538 | 538 | |
| 539 | - if (! $joinColumn->getType()) { |
|
| 539 | + if ( ! $joinColumn->getType()) { |
|
| 540 | 540 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em)); |
| 541 | 541 | } |
| 542 | 542 | |
@@ -549,7 +549,7 @@ discard block |
||
| 549 | 549 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 550 | 550 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 551 | 551 | |
| 552 | - if (! $joinColumn->getType()) { |
|
| 552 | + if ( ! $joinColumn->getType()) { |
|
| 553 | 553 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 554 | 554 | } |
| 555 | 555 | |
@@ -633,7 +633,7 @@ discard block |
||
| 633 | 633 | $sourceClass = $this->em->getClassMetadata($owningAssociation->getSourceEntity()); |
| 634 | 634 | $targetClass = $this->em->getClassMetadata($owningAssociation->getTargetEntity()); |
| 635 | 635 | |
| 636 | - if (! $owningAssociation->isOwningSide()) { |
|
| 636 | + if ( ! $owningAssociation->isOwningSide()) { |
|
| 637 | 637 | $owningAssociation = $targetClass->getProperty($owningAssociation->getMappedBy()); |
| 638 | 638 | $joinTable = $owningAssociation->getJoinTable(); |
| 639 | 639 | $joinColumns = $joinTable->getJoinColumns(); |
@@ -645,7 +645,7 @@ discard block |
||
| 645 | 645 | } |
| 646 | 646 | |
| 647 | 647 | $joinTableName = $joinTable->getQuotedQualifiedName($this->platform); |
| 648 | - $quotedJoinTable = $joinTableName . ' t'; |
|
| 648 | + $quotedJoinTable = $joinTableName.' t'; |
|
| 649 | 649 | $whereClauses = []; |
| 650 | 650 | $params = []; |
| 651 | 651 | $types = []; |
@@ -659,11 +659,11 @@ discard block |
||
| 659 | 659 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 660 | 660 | $quotedReferencedColumnName = $this->platform->quoteIdentifier($joinColumn->getReferencedColumnName()); |
| 661 | 661 | |
| 662 | - $joinConditions[] = ' t.' . $quotedColumnName . ' = tr.' . $quotedReferencedColumnName; |
|
| 662 | + $joinConditions[] = ' t.'.$quotedColumnName.' = tr.'.$quotedReferencedColumnName; |
|
| 663 | 663 | } |
| 664 | 664 | |
| 665 | 665 | $tableName = $targetClass->table->getQuotedQualifiedName($this->platform); |
| 666 | - $quotedJoinTable .= ' JOIN ' . $tableName . ' tr ON ' . implode(' AND ', $joinConditions); |
|
| 666 | + $quotedJoinTable .= ' JOIN '.$tableName.' tr ON '.implode(' AND ', $joinConditions); |
|
| 667 | 667 | $indexByProperty = $targetClass->getProperty($indexBy); |
| 668 | 668 | |
| 669 | 669 | switch (true) { |
@@ -686,7 +686,7 @@ discard block |
||
| 686 | 686 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 687 | 687 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 688 | 688 | |
| 689 | - if (! $joinColumn->getType()) { |
|
| 689 | + if ( ! $joinColumn->getType()) { |
|
| 690 | 690 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $sourceClass, $this->em)); |
| 691 | 691 | } |
| 692 | 692 | |
@@ -695,13 +695,13 @@ discard block |
||
| 695 | 695 | $types[] = $joinColumn->getType(); |
| 696 | 696 | } |
| 697 | 697 | |
| 698 | - if (! $joinNeeded) { |
|
| 698 | + if ( ! $joinNeeded) { |
|
| 699 | 699 | foreach ($joinColumns as $joinColumn) { |
| 700 | 700 | /** @var JoinColumnMetadata $joinColumn */ |
| 701 | 701 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 702 | 702 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 703 | 703 | |
| 704 | - if (! $joinColumn->getType()) { |
|
| 704 | + if ( ! $joinColumn->getType()) { |
|
| 705 | 705 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 706 | 706 | } |
| 707 | 707 | |
@@ -715,7 +715,7 @@ discard block |
||
| 715 | 715 | [$joinTargetEntitySQL, $filterSql] = $this->getFilterSql($association); |
| 716 | 716 | |
| 717 | 717 | if ($filterSql) { |
| 718 | - $quotedJoinTable .= ' ' . $joinTargetEntitySQL; |
|
| 718 | + $quotedJoinTable .= ' '.$joinTargetEntitySQL; |
|
| 719 | 719 | $whereClauses[] = $filterSql; |
| 720 | 720 | } |
| 721 | 721 | } |
@@ -738,7 +738,7 @@ discard block |
||
| 738 | 738 | $association = $collection->getMapping(); |
| 739 | 739 | $owningAssociation = $association; |
| 740 | 740 | |
| 741 | - if (! $association->isOwningSide()) { |
|
| 741 | + if ( ! $association->isOwningSide()) { |
|
| 742 | 742 | $sourceClass = $this->em->getClassMetadata($association->getTargetEntity()); |
| 743 | 743 | $targetClass = $this->em->getClassMetadata($association->getSourceEntity()); |
| 744 | 744 | $sourceIdentifier = $this->uow->getEntityIdentifier($element); |
@@ -764,11 +764,11 @@ discard block |
||
| 764 | 764 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 765 | 765 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 766 | 766 | |
| 767 | - if (! $joinColumn->getType()) { |
|
| 767 | + if ( ! $joinColumn->getType()) { |
|
| 768 | 768 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $sourceClass, $this->em)); |
| 769 | 769 | } |
| 770 | 770 | |
| 771 | - $whereClauses[] = ($addFilters ? 't.' : '') . $quotedColumnName . ' = ?'; |
|
| 771 | + $whereClauses[] = ($addFilters ? 't.' : '').$quotedColumnName.' = ?'; |
|
| 772 | 772 | $params[] = $sourceIdentifier[$sourceClass->fieldNames[$referencedColumnName]]; |
| 773 | 773 | $types[] = $joinColumn->getType(); |
| 774 | 774 | } |
@@ -778,11 +778,11 @@ discard block |
||
| 778 | 778 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 779 | 779 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 780 | 780 | |
| 781 | - if (! $joinColumn->getType()) { |
|
| 781 | + if ( ! $joinColumn->getType()) { |
|
| 782 | 782 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 783 | 783 | } |
| 784 | 784 | |
| 785 | - $whereClauses[] = ($addFilters ? 't.' : '') . $quotedColumnName . ' = ?'; |
|
| 785 | + $whereClauses[] = ($addFilters ? 't.' : '').$quotedColumnName.' = ?'; |
|
| 786 | 786 | $params[] = $targetIdentifier[$targetClass->fieldNames[$referencedColumnName]]; |
| 787 | 787 | $types[] = $joinColumn->getType(); |
| 788 | 788 | } |
@@ -793,7 +793,7 @@ discard block |
||
| 793 | 793 | [$joinTargetEntitySQL, $filterSql] = $this->getFilterSql($association); |
| 794 | 794 | |
| 795 | 795 | if ($filterSql) { |
| 796 | - $quotedJoinTable .= ' ' . $joinTargetEntitySQL; |
|
| 796 | + $quotedJoinTable .= ' '.$joinTargetEntitySQL; |
|
| 797 | 797 | $whereClauses[] = $filterSql; |
| 798 | 798 | } |
| 799 | 799 | } |
@@ -838,10 +838,10 @@ discard block |
||
| 838 | 838 | $property = $targetClass->getProperty($name); |
| 839 | 839 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
| 840 | 840 | |
| 841 | - $orderBy[] = $columnName . ' ' . $direction; |
|
| 841 | + $orderBy[] = $columnName.' '.$direction; |
|
| 842 | 842 | } |
| 843 | 843 | |
| 844 | - return ' ORDER BY ' . implode(', ', $orderBy); |
|
| 844 | + return ' ORDER BY '.implode(', ', $orderBy); |
|
| 845 | 845 | } |
| 846 | 846 | return ''; |
| 847 | 847 | } |
@@ -74,13 +74,13 @@ |
||
| 74 | 74 | |
| 75 | 75 | switch ($expr->getType()) { |
| 76 | 76 | case CompositeExpression::TYPE_AND: |
| 77 | - return '(' . implode(' AND ', $expressionList) . ')'; |
|
| 77 | + return '('.implode(' AND ', $expressionList).')'; |
|
| 78 | 78 | |
| 79 | 79 | case CompositeExpression::TYPE_OR: |
| 80 | - return '(' . implode(' OR ', $expressionList) . ')'; |
|
| 80 | + return '('.implode(' OR ', $expressionList).')'; |
|
| 81 | 81 | |
| 82 | 82 | default: |
| 83 | - throw new RuntimeException('Unknown composite ' . $expr->getType()); |
|
| 83 | + throw new RuntimeException('Unknown composite '.$expr->getType()); |
|
| 84 | 84 | } |
| 85 | 85 | } |
| 86 | 86 | |
@@ -162,7 +162,7 @@ |
||
| 162 | 162 | |
| 163 | 163 | // Recognize identifiers, aliased or qualified names |
| 164 | 164 | case ctype_alpha($value[0]) || $value[0] === '_' || $value[0] === '\\': |
| 165 | - $name = 'Doctrine\ORM\Query\Lexer::T_' . strtoupper($value); |
|
| 165 | + $name = 'Doctrine\ORM\Query\Lexer::T_'.strtoupper($value); |
|
| 166 | 166 | |
| 167 | 167 | if (defined($name)) { |
| 168 | 168 | $type = constant($name); |