@@ -33,7 +33,7 @@ |
||
33 | 33 | /** |
34 | 34 | * @var string |
35 | 35 | */ |
36 | - protected $preSeparator = ''; |
|
36 | + protected $preSeparator = ''; |
|
37 | 37 | |
38 | 38 | /** |
39 | 39 | * @var string |
@@ -102,7 +102,7 @@ |
||
102 | 102 | [$pathExpression] |
103 | 103 | ); |
104 | 104 | $expression = new InExpression($arithmeticExpression); |
105 | - $expression->literals[] = new InputParameter(":" . self::PAGINATOR_ID_ALIAS); |
|
105 | + $expression->literals[] = new InputParameter(":".self::PAGINATOR_ID_ALIAS); |
|
106 | 106 | |
107 | 107 | } else { |
108 | 108 | $expression = new NullComparisonExpression($pathExpression); |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | $schema = []; |
76 | 76 | foreach ($this->from as $path) { |
77 | 77 | if (is_dir($path)) { |
78 | - $files = glob($path . '/*.yml'); |
|
78 | + $files = glob($path.'/*.yml'); |
|
79 | 79 | foreach ($files as $file) { |
80 | 80 | $schema = array_merge($schema, (array) Yaml::parse(file_get_contents($file))); |
81 | 81 | } |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_SEQUENCE); |
239 | 239 | |
240 | 240 | $definition = [ |
241 | - 'sequenceName' => is_array($column['sequence']) ? $column['sequence']['name']:$column['sequence'] |
|
241 | + 'sequenceName' => is_array($column['sequence']) ? $column['sequence']['name'] : $column['sequence'] |
|
242 | 242 | ]; |
243 | 243 | |
244 | 244 | if (isset($column['sequence']['size'])) { |
@@ -1525,11 +1525,21 @@ |
||
1525 | 1525 | if ($associationMapping['cascade']) { |
1526 | 1526 | $cascades = []; |
1527 | 1527 | |
1528 | - if ($associationMapping['isCascadePersist']) $cascades[] = '"persist"'; |
|
1529 | - if ($associationMapping['isCascadeRemove']) $cascades[] = '"remove"'; |
|
1530 | - if ($associationMapping['isCascadeDetach']) $cascades[] = '"detach"'; |
|
1531 | - if ($associationMapping['isCascadeMerge']) $cascades[] = '"merge"'; |
|
1532 | - if ($associationMapping['isCascadeRefresh']) $cascades[] = '"refresh"'; |
|
1528 | + if ($associationMapping['isCascadePersist']) { |
|
1529 | + $cascades[] = '"persist"'; |
|
1530 | + } |
|
1531 | + if ($associationMapping['isCascadeRemove']) { |
|
1532 | + $cascades[] = '"remove"'; |
|
1533 | + } |
|
1534 | + if ($associationMapping['isCascadeDetach']) { |
|
1535 | + $cascades[] = '"detach"'; |
|
1536 | + } |
|
1537 | + if ($associationMapping['isCascadeMerge']) { |
|
1538 | + $cascades[] = '"merge"'; |
|
1539 | + } |
|
1540 | + if ($associationMapping['isCascadeRefresh']) { |
|
1541 | + $cascades[] = '"refresh"'; |
|
1542 | + } |
|
1533 | 1543 | |
1534 | 1544 | if (count($cascades) === 5) { |
1535 | 1545 | $cascades = ['"all"']; |
@@ -1363,7 +1363,7 @@ discard block |
||
1363 | 1363 | |
1364 | 1364 | $lines[] = $this->generateAssociationMappingPropertyDocBlock($associationMapping, $metadata); |
1365 | 1365 | $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $associationMapping['fieldName'] |
1366 | - . ($associationMapping['type'] == 'manyToMany' ? ' = array()' : null) . ";\n"; |
|
1366 | + . ($associationMapping['type'] == 'manyToMany' ? ' = array()' : null) . ";\n"; |
|
1367 | 1367 | } |
1368 | 1368 | |
1369 | 1369 | return implode("\n", $lines); |
@@ -1388,7 +1388,7 @@ discard block |
||
1388 | 1388 | |
1389 | 1389 | $lines[] = $this->generateFieldMappingPropertyDocBlock($fieldMapping, $metadata); |
1390 | 1390 | $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $fieldMapping['fieldName'] |
1391 | - . (isset($fieldMapping['options']['default']) ? ' = ' . var_export($fieldMapping['options']['default'], true) : null) . ";\n"; |
|
1391 | + . (isset($fieldMapping['options']['default']) ? ' = ' . var_export($fieldMapping['options']['default'], true) : null) . ";\n"; |
|
1392 | 1392 | } |
1393 | 1393 | |
1394 | 1394 | return implode("\n", $lines); |
@@ -1461,15 +1461,15 @@ discard block |
||
1461 | 1461 | } |
1462 | 1462 | |
1463 | 1463 | $replacements = [ |
1464 | - '<description>' => ucfirst($type) . ' ' . $variableName, |
|
1465 | - '<methodTypeHint>' => $methodTypeHint, |
|
1466 | - '<variableType>' => $variableType . (null !== $defaultValue ? ('|' . $defaultValue) : ''), |
|
1467 | - '<variableName>' => $variableName, |
|
1468 | - '<methodName>' => $methodName, |
|
1469 | - '<fieldName>' => $fieldName, |
|
1470 | - '<variableDefault>' => ($defaultValue !== null ) ? (' = ' . $defaultValue) : '', |
|
1471 | - '<entity>' => $this->getClassName($metadata), |
|
1472 | - '<methodTypeReturn>' => $methodReturnType, |
|
1464 | + '<description>' => ucfirst($type) . ' ' . $variableName, |
|
1465 | + '<methodTypeHint>' => $methodTypeHint, |
|
1466 | + '<variableType>' => $variableType . (null !== $defaultValue ? ('|' . $defaultValue) : ''), |
|
1467 | + '<variableName>' => $variableName, |
|
1468 | + '<methodName>' => $methodName, |
|
1469 | + '<fieldName>' => $fieldName, |
|
1470 | + '<variableDefault>' => ($defaultValue !== null ) ? (' = ' . $defaultValue) : '', |
|
1471 | + '<entity>' => $this->getClassName($metadata), |
|
1472 | + '<methodTypeReturn>' => $methodReturnType, |
|
1473 | 1473 | ]; |
1474 | 1474 | |
1475 | 1475 | $method = str_replace( |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | */ |
394 | 394 | public function writeEntityClass(ClassMetadataInfo $metadata, $outputDirectory) |
395 | 395 | { |
396 | - $path = $outputDirectory . '/' . str_replace('\\', DIRECTORY_SEPARATOR, $metadata->name) . $this->extension; |
|
396 | + $path = $outputDirectory.'/'.str_replace('\\', DIRECTORY_SEPARATOR, $metadata->name).$this->extension; |
|
397 | 397 | $dir = dirname($path); |
398 | 398 | |
399 | 399 | if ( ! is_dir($dir)) { |
@@ -409,8 +409,8 @@ discard block |
||
409 | 409 | } |
410 | 410 | |
411 | 411 | if ($this->backupExisting && file_exists($path)) { |
412 | - $backupPath = dirname($path) . DIRECTORY_SEPARATOR . basename($path) . "~"; |
|
413 | - if (!copy($path, $backupPath)) { |
|
412 | + $backupPath = dirname($path).DIRECTORY_SEPARATOR.basename($path)."~"; |
|
413 | + if ( ! copy($path, $backupPath)) { |
|
414 | 414 | throw new \RuntimeException("Attempt to backup overwritten entity file but copy operation failed."); |
415 | 415 | } |
416 | 416 | } |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | $body = str_replace('<spaces>', $this->spaces, $body); |
474 | 474 | $last = strrpos($currentCode, '}'); |
475 | 475 | |
476 | - return substr($currentCode, 0, $last) . $body . ($body ? "\n" : '') . "}\n"; |
|
476 | + return substr($currentCode, 0, $last).$body.($body ? "\n" : '')."}\n"; |
|
477 | 477 | } |
478 | 478 | |
479 | 479 | /** |
@@ -537,7 +537,7 @@ discard block |
||
537 | 537 | public function setFieldVisibility($visibility) |
538 | 538 | { |
539 | 539 | if ($visibility !== static::FIELD_VISIBLE_PRIVATE && $visibility !== static::FIELD_VISIBLE_PROTECTED) { |
540 | - throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): ' . $visibility); |
|
540 | + throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): '.$visibility); |
|
541 | 541 | } |
542 | 542 | |
543 | 543 | $this->fieldVisibility = $visibility; |
@@ -670,11 +670,11 @@ discard block |
||
670 | 670 | */ |
671 | 671 | protected function generateEntityNamespace(ClassMetadataInfo $metadata) |
672 | 672 | { |
673 | - if (! $this->hasNamespace($metadata)) { |
|
673 | + if ( ! $this->hasNamespace($metadata)) { |
|
674 | 674 | return ''; |
675 | 675 | } |
676 | 676 | |
677 | - return 'namespace ' . $this->getNamespace($metadata) .';'; |
|
677 | + return 'namespace '.$this->getNamespace($metadata).';'; |
|
678 | 678 | } |
679 | 679 | |
680 | 680 | /** |
@@ -682,7 +682,7 @@ discard block |
||
682 | 682 | */ |
683 | 683 | protected function generateEntityUse() |
684 | 684 | { |
685 | - if (! $this->generateAnnotations) { |
|
685 | + if ( ! $this->generateAnnotations) { |
|
686 | 686 | return ''; |
687 | 687 | } |
688 | 688 | |
@@ -696,8 +696,8 @@ discard block |
||
696 | 696 | */ |
697 | 697 | protected function generateEntityClassName(ClassMetadataInfo $metadata) |
698 | 698 | { |
699 | - return 'class ' . $this->getClassName($metadata) . |
|
700 | - ($this->extendsClass() ? ' extends ' . $this->getClassToExtendName() : null); |
|
699 | + return 'class '.$this->getClassName($metadata). |
|
700 | + ($this->extendsClass() ? ' extends '.$this->getClassToExtendName() : null); |
|
701 | 701 | } |
702 | 702 | |
703 | 703 | /** |
@@ -799,13 +799,13 @@ discard block |
||
799 | 799 | $fieldMappings = array_merge($requiredFields, $optionalFields); |
800 | 800 | |
801 | 801 | foreach ($metadata->embeddedClasses as $fieldName => $embeddedClass) { |
802 | - $paramType = '\\' . ltrim($embeddedClass['class'], '\\'); |
|
803 | - $paramVariable = '$' . $fieldName; |
|
802 | + $paramType = '\\'.ltrim($embeddedClass['class'], '\\'); |
|
803 | + $paramVariable = '$'.$fieldName; |
|
804 | 804 | |
805 | 805 | $paramTypes[] = $paramType; |
806 | 806 | $paramVariables[] = $paramVariable; |
807 | - $params[] = $paramType . ' ' . $paramVariable; |
|
808 | - $fields[] = '$this->' . $fieldName . ' = ' . $paramVariable . ';'; |
|
807 | + $params[] = $paramType.' '.$paramVariable; |
|
808 | + $fields[] = '$this->'.$fieldName.' = '.$paramVariable.';'; |
|
809 | 809 | } |
810 | 810 | |
811 | 811 | foreach ($fieldMappings as $fieldMapping) { |
@@ -813,27 +813,27 @@ discard block |
||
813 | 813 | continue; |
814 | 814 | } |
815 | 815 | |
816 | - $paramTypes[] = $this->getType($fieldMapping['type']) . (!empty($fieldMapping['nullable']) ? '|null' : ''); |
|
817 | - $param = '$' . $fieldMapping['fieldName']; |
|
816 | + $paramTypes[] = $this->getType($fieldMapping['type']).( ! empty($fieldMapping['nullable']) ? '|null' : ''); |
|
817 | + $param = '$'.$fieldMapping['fieldName']; |
|
818 | 818 | $paramVariables[] = $param; |
819 | 819 | |
820 | 820 | if ($fieldMapping['type'] === 'datetime') { |
821 | - $param = $this->getType($fieldMapping['type']) . ' ' . $param; |
|
821 | + $param = $this->getType($fieldMapping['type']).' '.$param; |
|
822 | 822 | } |
823 | 823 | |
824 | - if (!empty($fieldMapping['nullable'])) { |
|
824 | + if ( ! empty($fieldMapping['nullable'])) { |
|
825 | 825 | $param .= ' = null'; |
826 | 826 | } |
827 | 827 | |
828 | 828 | $params[] = $param; |
829 | 829 | |
830 | - $fields[] = '$this->' . $fieldMapping['fieldName'] . ' = $' . $fieldMapping['fieldName'] . ';'; |
|
830 | + $fields[] = '$this->'.$fieldMapping['fieldName'].' = $'.$fieldMapping['fieldName'].';'; |
|
831 | 831 | } |
832 | 832 | |
833 | 833 | $maxParamTypeLength = max(array_map('strlen', $paramTypes)); |
834 | 834 | $paramTags = array_map( |
835 | - function ($type, $variable) use ($maxParamTypeLength) { |
|
836 | - return '@param ' . $type . str_repeat(' ', $maxParamTypeLength - strlen($type) + 1) . $variable; |
|
835 | + function($type, $variable) use ($maxParamTypeLength) { |
|
836 | + return '@param '.$type.str_repeat(' ', $maxParamTypeLength - strlen($type) + 1).$variable; |
|
837 | 837 | }, |
838 | 838 | $paramTypes, |
839 | 839 | $paramVariables |
@@ -841,8 +841,8 @@ discard block |
||
841 | 841 | |
842 | 842 | // Generate multi line constructor if the signature exceeds 120 characters. |
843 | 843 | if (array_sum(array_map('strlen', $params)) + count($params) * 2 + 29 > 120) { |
844 | - $delimiter = "\n" . $this->spaces; |
|
845 | - $params = $delimiter . implode(',' . $delimiter, $params) . "\n"; |
|
844 | + $delimiter = "\n".$this->spaces; |
|
845 | + $params = $delimiter.implode(','.$delimiter, $params)."\n"; |
|
846 | 846 | } else { |
847 | 847 | $params = implode(', ', $params); |
848 | 848 | } |
@@ -850,7 +850,7 @@ discard block |
||
850 | 850 | $replacements = [ |
851 | 851 | '<paramTags>' => implode("\n * ", $paramTags), |
852 | 852 | '<params>' => $params, |
853 | - '<fields>' => implode("\n" . $this->spaces, $fields), |
|
853 | + '<fields>' => implode("\n".$this->spaces, $fields), |
|
854 | 854 | ]; |
855 | 855 | |
856 | 856 | $constructor = str_replace( |
@@ -895,7 +895,7 @@ discard block |
||
895 | 895 | |
896 | 896 | if ($inClass) { |
897 | 897 | $inClass = false; |
898 | - $lastSeenClass = $lastSeenNamespace . ($lastSeenNamespace ? '\\' : '') . $token[1]; |
|
898 | + $lastSeenClass = $lastSeenNamespace.($lastSeenNamespace ? '\\' : '').$token[1]; |
|
899 | 899 | $this->staticReflection[$lastSeenClass]['properties'] = []; |
900 | 900 | $this->staticReflection[$lastSeenClass]['methods'] = []; |
901 | 901 | } |
@@ -903,16 +903,16 @@ discard block |
||
903 | 903 | if (T_NAMESPACE === $token[0]) { |
904 | 904 | $lastSeenNamespace = ''; |
905 | 905 | $inNamespace = true; |
906 | - } elseif (T_CLASS === $token[0] && T_DOUBLE_COLON !== $tokens[$i-1][0]) { |
|
906 | + } elseif (T_CLASS === $token[0] && T_DOUBLE_COLON !== $tokens[$i - 1][0]) { |
|
907 | 907 | $inClass = true; |
908 | 908 | } elseif (T_FUNCTION === $token[0]) { |
909 | - if (T_STRING === $tokens[$i+2][0]) { |
|
910 | - $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+2][1]); |
|
911 | - } elseif ($tokens[$i+2] == '&' && T_STRING === $tokens[$i+3][0]) { |
|
912 | - $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+3][1]); |
|
909 | + if (T_STRING === $tokens[$i + 2][0]) { |
|
910 | + $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 2][1]); |
|
911 | + } elseif ($tokens[$i + 2] == '&' && T_STRING === $tokens[$i + 3][0]) { |
|
912 | + $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 3][1]); |
|
913 | 913 | } |
914 | - } elseif (in_array($token[0], [T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED], true) && T_FUNCTION !== $tokens[$i+2][0]) { |
|
915 | - $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i+2][1], 1); |
|
914 | + } elseif (in_array($token[0], [T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED], true) && T_FUNCTION !== $tokens[$i + 2][0]) { |
|
915 | + $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i + 2][1], 1); |
|
916 | 916 | } |
917 | 917 | } |
918 | 918 | } |
@@ -925,7 +925,7 @@ discard block |
||
925 | 925 | */ |
926 | 926 | protected function hasProperty($property, ClassMetadataInfo $metadata) |
927 | 927 | { |
928 | - if ($this->extendsClass() || (!$this->isNew && class_exists($metadata->name))) { |
|
928 | + if ($this->extendsClass() || ( ! $this->isNew && class_exists($metadata->name))) { |
|
929 | 929 | // don't generate property if its already on the base class. |
930 | 930 | $reflClass = new \ReflectionClass($this->getClassToExtend() ?: $metadata->name); |
931 | 931 | if ($reflClass->hasProperty($property)) { |
@@ -954,7 +954,7 @@ discard block |
||
954 | 954 | */ |
955 | 955 | protected function hasMethod($method, ClassMetadataInfo $metadata) |
956 | 956 | { |
957 | - if ($this->extendsClass() || (!$this->isNew && class_exists($metadata->name))) { |
|
957 | + if ($this->extendsClass() || ( ! $this->isNew && class_exists($metadata->name))) { |
|
958 | 958 | // don't generate method if its already on the base class. |
959 | 959 | $reflClass = new \ReflectionClass($this->getClassToExtend() ?: $metadata->name); |
960 | 960 | |
@@ -985,7 +985,7 @@ discard block |
||
985 | 985 | */ |
986 | 986 | protected function getTraits(ClassMetadataInfo $metadata) |
987 | 987 | { |
988 | - if (! ($metadata->reflClass !== null || class_exists($metadata->name))) { |
|
988 | + if ( ! ($metadata->reflClass !== null || class_exists($metadata->name))) { |
|
989 | 989 | return []; |
990 | 990 | } |
991 | 991 | |
@@ -1035,7 +1035,7 @@ discard block |
||
1035 | 1035 | { |
1036 | 1036 | $refl = new \ReflectionClass($this->getClassToExtend()); |
1037 | 1037 | |
1038 | - return '\\' . $refl->getName(); |
|
1038 | + return '\\'.$refl->getName(); |
|
1039 | 1039 | } |
1040 | 1040 | |
1041 | 1041 | /** |
@@ -1068,7 +1068,7 @@ discard block |
||
1068 | 1068 | { |
1069 | 1069 | $lines = []; |
1070 | 1070 | $lines[] = '/**'; |
1071 | - $lines[] = ' * ' . $this->getClassName($metadata); |
|
1071 | + $lines[] = ' * '.$this->getClassName($metadata); |
|
1072 | 1072 | |
1073 | 1073 | if ($this->generateAnnotations) { |
1074 | 1074 | $lines[] = ' *'; |
@@ -1084,12 +1084,12 @@ discard block |
||
1084 | 1084 | |
1085 | 1085 | foreach ($methods as $method) { |
1086 | 1086 | if ($code = $this->$method($metadata)) { |
1087 | - $lines[] = ' * ' . $code; |
|
1087 | + $lines[] = ' * '.$code; |
|
1088 | 1088 | } |
1089 | 1089 | } |
1090 | 1090 | |
1091 | 1091 | if (isset($metadata->lifecycleCallbacks) && $metadata->lifecycleCallbacks) { |
1092 | - $lines[] = ' * @' . $this->annotationsPrefix . 'HasLifecycleCallbacks'; |
|
1092 | + $lines[] = ' * @'.$this->annotationsPrefix.'HasLifecycleCallbacks'; |
|
1093 | 1093 | } |
1094 | 1094 | } |
1095 | 1095 | |
@@ -1105,17 +1105,17 @@ discard block |
||
1105 | 1105 | */ |
1106 | 1106 | protected function generateEntityAnnotation(ClassMetadataInfo $metadata) |
1107 | 1107 | { |
1108 | - $prefix = '@' . $this->annotationsPrefix; |
|
1108 | + $prefix = '@'.$this->annotationsPrefix; |
|
1109 | 1109 | |
1110 | 1110 | if ($metadata->isEmbeddedClass) { |
1111 | - return $prefix . 'Embeddable'; |
|
1111 | + return $prefix.'Embeddable'; |
|
1112 | 1112 | } |
1113 | 1113 | |
1114 | 1114 | $customRepository = $metadata->customRepositoryClassName |
1115 | - ? '(repositoryClass="' . $metadata->customRepositoryClassName . '")' |
|
1115 | + ? '(repositoryClass="'.$metadata->customRepositoryClassName.'")' |
|
1116 | 1116 | : ''; |
1117 | 1117 | |
1118 | - return $prefix . ($metadata->isMappedSuperclass ? 'MappedSuperclass' : 'Entity') . $customRepository; |
|
1118 | + return $prefix.($metadata->isMappedSuperclass ? 'MappedSuperclass' : 'Entity').$customRepository; |
|
1119 | 1119 | } |
1120 | 1120 | |
1121 | 1121 | /** |
@@ -1132,28 +1132,28 @@ discard block |
||
1132 | 1132 | $table = []; |
1133 | 1133 | |
1134 | 1134 | if (isset($metadata->table['schema'])) { |
1135 | - $table[] = 'schema="' . $metadata->table['schema'] . '"'; |
|
1135 | + $table[] = 'schema="'.$metadata->table['schema'].'"'; |
|
1136 | 1136 | } |
1137 | 1137 | |
1138 | 1138 | if (isset($metadata->table['name'])) { |
1139 | - $table[] = 'name="' . $metadata->table['name'] . '"'; |
|
1139 | + $table[] = 'name="'.$metadata->table['name'].'"'; |
|
1140 | 1140 | } |
1141 | 1141 | |
1142 | 1142 | if (isset($metadata->table['options']) && $metadata->table['options']) { |
1143 | - $table[] = 'options={' . $this->exportTableOptions((array) $metadata->table['options']) . '}'; |
|
1143 | + $table[] = 'options={'.$this->exportTableOptions((array) $metadata->table['options']).'}'; |
|
1144 | 1144 | } |
1145 | 1145 | |
1146 | 1146 | if (isset($metadata->table['uniqueConstraints']) && $metadata->table['uniqueConstraints']) { |
1147 | 1147 | $constraints = $this->generateTableConstraints('UniqueConstraint', $metadata->table['uniqueConstraints']); |
1148 | - $table[] = 'uniqueConstraints={' . $constraints . '}'; |
|
1148 | + $table[] = 'uniqueConstraints={'.$constraints.'}'; |
|
1149 | 1149 | } |
1150 | 1150 | |
1151 | 1151 | if (isset($metadata->table['indexes']) && $metadata->table['indexes']) { |
1152 | 1152 | $constraints = $this->generateTableConstraints('Index', $metadata->table['indexes']); |
1153 | - $table[] = 'indexes={' . $constraints . '}'; |
|
1153 | + $table[] = 'indexes={'.$constraints.'}'; |
|
1154 | 1154 | } |
1155 | 1155 | |
1156 | - return '@' . $this->annotationsPrefix . 'Table(' . implode(', ', $table) . ')'; |
|
1156 | + return '@'.$this->annotationsPrefix.'Table('.implode(', ', $table).')'; |
|
1157 | 1157 | } |
1158 | 1158 | |
1159 | 1159 | /** |
@@ -1168,9 +1168,9 @@ discard block |
||
1168 | 1168 | foreach ($constraints as $name => $constraint) { |
1169 | 1169 | $columns = []; |
1170 | 1170 | foreach ($constraint['columns'] as $column) { |
1171 | - $columns[] = '"' . $column . '"'; |
|
1171 | + $columns[] = '"'.$column.'"'; |
|
1172 | 1172 | } |
1173 | - $annotations[] = '@' . $this->annotationsPrefix . $constraintName . '(name="' . $name . '", columns={' . implode(', ', $columns) . '})'; |
|
1173 | + $annotations[] = '@'.$this->annotationsPrefix.$constraintName.'(name="'.$name.'", columns={'.implode(', ', $columns).'})'; |
|
1174 | 1174 | } |
1175 | 1175 | |
1176 | 1176 | return implode(', ', $annotations); |
@@ -1187,7 +1187,7 @@ discard block |
||
1187 | 1187 | return ''; |
1188 | 1188 | } |
1189 | 1189 | |
1190 | - return '@' . $this->annotationsPrefix . 'InheritanceType("'.$this->getInheritanceTypeString($metadata->inheritanceType).'")'; |
|
1190 | + return '@'.$this->annotationsPrefix.'InheritanceType("'.$this->getInheritanceTypeString($metadata->inheritanceType).'")'; |
|
1191 | 1191 | } |
1192 | 1192 | |
1193 | 1193 | /** |
@@ -1202,11 +1202,11 @@ discard block |
||
1202 | 1202 | } |
1203 | 1203 | |
1204 | 1204 | $discrColumn = $metadata->discriminatorColumn; |
1205 | - $columnDefinition = 'name="' . $discrColumn['name'] |
|
1206 | - . '", type="' . $discrColumn['type'] |
|
1207 | - . '", length=' . $discrColumn['length']; |
|
1205 | + $columnDefinition = 'name="'.$discrColumn['name'] |
|
1206 | + . '", type="'.$discrColumn['type'] |
|
1207 | + . '", length='.$discrColumn['length']; |
|
1208 | 1208 | |
1209 | - return '@' . $this->annotationsPrefix . 'DiscriminatorColumn(' . $columnDefinition . ')'; |
|
1209 | + return '@'.$this->annotationsPrefix.'DiscriminatorColumn('.$columnDefinition.')'; |
|
1210 | 1210 | } |
1211 | 1211 | |
1212 | 1212 | /** |
@@ -1223,10 +1223,10 @@ discard block |
||
1223 | 1223 | $inheritanceClassMap = []; |
1224 | 1224 | |
1225 | 1225 | foreach ($metadata->discriminatorMap as $type => $class) { |
1226 | - $inheritanceClassMap[] .= '"' . $type . '" = "' . $class . '"'; |
|
1226 | + $inheritanceClassMap[] .= '"'.$type.'" = "'.$class.'"'; |
|
1227 | 1227 | } |
1228 | 1228 | |
1229 | - return '@' . $this->annotationsPrefix . 'DiscriminatorMap({' . implode(', ', $inheritanceClassMap) . '})'; |
|
1229 | + return '@'.$this->annotationsPrefix.'DiscriminatorMap({'.implode(', ', $inheritanceClassMap).'})'; |
|
1230 | 1230 | } |
1231 | 1231 | |
1232 | 1232 | /** |
@@ -1245,8 +1245,8 @@ discard block |
||
1245 | 1245 | |
1246 | 1246 | $nullableField = $this->nullableFieldExpression($fieldMapping); |
1247 | 1247 | |
1248 | - if ((!$metadata->isEmbeddedClass || !$this->embeddablesImmutable) |
|
1249 | - && (!isset($fieldMapping['id']) || ! $fieldMapping['id'] || $metadata->generatorType === ClassMetadataInfo::GENERATOR_TYPE_NONE) |
|
1248 | + if (( ! $metadata->isEmbeddedClass || ! $this->embeddablesImmutable) |
|
1249 | + && ( ! isset($fieldMapping['id']) || ! $fieldMapping['id'] || $metadata->generatorType === ClassMetadataInfo::GENERATOR_TYPE_NONE) |
|
1250 | 1250 | && $code = $this->generateEntityStubMethod($metadata, 'set', $fieldMapping['fieldName'], $fieldMapping['type'], $nullableField) |
1251 | 1251 | ) { |
1252 | 1252 | $methods[] = $code; |
@@ -1317,7 +1317,7 @@ discard block |
||
1317 | 1317 | } |
1318 | 1318 | |
1319 | 1319 | foreach ($joinColumns as $joinColumn) { |
1320 | - if (isset($joinColumn['nullable']) && !$joinColumn['nullable']) { |
|
1320 | + if (isset($joinColumn['nullable']) && ! $joinColumn['nullable']) { |
|
1321 | 1321 | return false; |
1322 | 1322 | } |
1323 | 1323 | } |
@@ -1362,8 +1362,8 @@ discard block |
||
1362 | 1362 | } |
1363 | 1363 | |
1364 | 1364 | $lines[] = $this->generateAssociationMappingPropertyDocBlock($associationMapping, $metadata); |
1365 | - $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $associationMapping['fieldName'] |
|
1366 | - . ($associationMapping['type'] == 'manyToMany' ? ' = array()' : null) . ";\n"; |
|
1365 | + $lines[] = $this->spaces.$this->fieldVisibility.' $'.$associationMapping['fieldName'] |
|
1366 | + . ($associationMapping['type'] == 'manyToMany' ? ' = array()' : null).";\n"; |
|
1367 | 1367 | } |
1368 | 1368 | |
1369 | 1369 | return implode("\n", $lines); |
@@ -1387,8 +1387,8 @@ discard block |
||
1387 | 1387 | } |
1388 | 1388 | |
1389 | 1389 | $lines[] = $this->generateFieldMappingPropertyDocBlock($fieldMapping, $metadata); |
1390 | - $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $fieldMapping['fieldName'] |
|
1391 | - . (isset($fieldMapping['options']['default']) ? ' = ' . var_export($fieldMapping['options']['default'], true) : null) . ";\n"; |
|
1390 | + $lines[] = $this->spaces.$this->fieldVisibility.' $'.$fieldMapping['fieldName'] |
|
1391 | + . (isset($fieldMapping['options']['default']) ? ' = '.var_export($fieldMapping['options']['default'], true) : null).";\n"; |
|
1392 | 1392 | } |
1393 | 1393 | |
1394 | 1394 | return implode("\n", $lines); |
@@ -1409,7 +1409,7 @@ discard block |
||
1409 | 1409 | } |
1410 | 1410 | |
1411 | 1411 | $lines[] = $this->generateEmbeddedPropertyDocBlock($embeddedClass); |
1412 | - $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $fieldName . ";\n"; |
|
1412 | + $lines[] = $this->spaces.$this->fieldVisibility.' $'.$fieldName.";\n"; |
|
1413 | 1413 | } |
1414 | 1414 | |
1415 | 1415 | return implode("\n", $lines); |
@@ -1426,7 +1426,7 @@ discard block |
||
1426 | 1426 | */ |
1427 | 1427 | protected function generateEntityStubMethod(ClassMetadataInfo $metadata, $type, $fieldName, $typeHint = null, $defaultValue = null) |
1428 | 1428 | { |
1429 | - $methodName = $type . Inflector::classify($fieldName); |
|
1429 | + $methodName = $type.Inflector::classify($fieldName); |
|
1430 | 1430 | $variableName = Inflector::camelize($fieldName); |
1431 | 1431 | if (in_array($type, ["add", "remove"])) { |
1432 | 1432 | $methodName = Inflector::singularize($methodName); |
@@ -1446,8 +1446,8 @@ discard block |
||
1446 | 1446 | $variableType = $typeHint ? $this->getType($typeHint) : null; |
1447 | 1447 | |
1448 | 1448 | if ($typeHint && ! isset($types[$typeHint])) { |
1449 | - $variableType = '\\' . ltrim($variableType, '\\'); |
|
1450 | - $methodTypeHint = '\\' . $typeHint . ' '; |
|
1449 | + $variableType = '\\'.ltrim($variableType, '\\'); |
|
1450 | + $methodTypeHint = '\\'.$typeHint.' '; |
|
1451 | 1451 | } |
1452 | 1452 | |
1453 | 1453 | $methodReturnType = null; |
@@ -1461,13 +1461,13 @@ discard block |
||
1461 | 1461 | } |
1462 | 1462 | |
1463 | 1463 | $replacements = [ |
1464 | - '<description>' => ucfirst($type) . ' ' . $variableName, |
|
1464 | + '<description>' => ucfirst($type).' '.$variableName, |
|
1465 | 1465 | '<methodTypeHint>' => $methodTypeHint, |
1466 | - '<variableType>' => $variableType . (null !== $defaultValue ? ('|' . $defaultValue) : ''), |
|
1466 | + '<variableType>' => $variableType.(null !== $defaultValue ? ('|'.$defaultValue) : ''), |
|
1467 | 1467 | '<variableName>' => $variableName, |
1468 | 1468 | '<methodName>' => $methodName, |
1469 | 1469 | '<fieldName>' => $fieldName, |
1470 | - '<variableDefault>' => ($defaultValue !== null ) ? (' = ' . $defaultValue) : '', |
|
1470 | + '<variableDefault>' => ($defaultValue !== null) ? (' = '.$defaultValue) : '', |
|
1471 | 1471 | '<entity>' => $this->getClassName($metadata), |
1472 | 1472 | '<methodTypeReturn>' => $methodReturnType, |
1473 | 1473 | ]; |
@@ -1497,7 +1497,7 @@ discard block |
||
1497 | 1497 | $this->staticReflection[$metadata->name]['methods'][] = $methodName; |
1498 | 1498 | |
1499 | 1499 | $replacements = [ |
1500 | - '<name>' => $this->annotationsPrefix . ucfirst($name), |
|
1500 | + '<name>' => $this->annotationsPrefix.ucfirst($name), |
|
1501 | 1501 | '<methodName>' => $methodName, |
1502 | 1502 | ]; |
1503 | 1503 | |
@@ -1520,30 +1520,30 @@ discard block |
||
1520 | 1520 | $joinColumnAnnot = []; |
1521 | 1521 | |
1522 | 1522 | if (isset($joinColumn['name'])) { |
1523 | - $joinColumnAnnot[] = 'name="' . $joinColumn['name'] . '"'; |
|
1523 | + $joinColumnAnnot[] = 'name="'.$joinColumn['name'].'"'; |
|
1524 | 1524 | } |
1525 | 1525 | |
1526 | 1526 | if (isset($joinColumn['referencedColumnName'])) { |
1527 | - $joinColumnAnnot[] = 'referencedColumnName="' . $joinColumn['referencedColumnName'] . '"'; |
|
1527 | + $joinColumnAnnot[] = 'referencedColumnName="'.$joinColumn['referencedColumnName'].'"'; |
|
1528 | 1528 | } |
1529 | 1529 | |
1530 | 1530 | if (isset($joinColumn['unique']) && $joinColumn['unique']) { |
1531 | - $joinColumnAnnot[] = 'unique=' . ($joinColumn['unique'] ? 'true' : 'false'); |
|
1531 | + $joinColumnAnnot[] = 'unique='.($joinColumn['unique'] ? 'true' : 'false'); |
|
1532 | 1532 | } |
1533 | 1533 | |
1534 | 1534 | if (isset($joinColumn['nullable'])) { |
1535 | - $joinColumnAnnot[] = 'nullable=' . ($joinColumn['nullable'] ? 'true' : 'false'); |
|
1535 | + $joinColumnAnnot[] = 'nullable='.($joinColumn['nullable'] ? 'true' : 'false'); |
|
1536 | 1536 | } |
1537 | 1537 | |
1538 | 1538 | if (isset($joinColumn['onDelete'])) { |
1539 | - $joinColumnAnnot[] = 'onDelete="' . ($joinColumn['onDelete'] . '"'); |
|
1539 | + $joinColumnAnnot[] = 'onDelete="'.($joinColumn['onDelete'].'"'); |
|
1540 | 1540 | } |
1541 | 1541 | |
1542 | 1542 | if (isset($joinColumn['columnDefinition'])) { |
1543 | - $joinColumnAnnot[] = 'columnDefinition="' . $joinColumn['columnDefinition'] . '"'; |
|
1543 | + $joinColumnAnnot[] = 'columnDefinition="'.$joinColumn['columnDefinition'].'"'; |
|
1544 | 1544 | } |
1545 | 1545 | |
1546 | - return '@' . $this->annotationsPrefix . 'JoinColumn(' . implode(', ', $joinColumnAnnot) . ')'; |
|
1546 | + return '@'.$this->annotationsPrefix.'JoinColumn('.implode(', ', $joinColumnAnnot).')'; |
|
1547 | 1547 | } |
1548 | 1548 | |
1549 | 1549 | /** |
@@ -1555,22 +1555,22 @@ discard block |
||
1555 | 1555 | protected function generateAssociationMappingPropertyDocBlock(array $associationMapping, ClassMetadataInfo $metadata) |
1556 | 1556 | { |
1557 | 1557 | $lines = []; |
1558 | - $lines[] = $this->spaces . '/**'; |
|
1558 | + $lines[] = $this->spaces.'/**'; |
|
1559 | 1559 | |
1560 | 1560 | if ($associationMapping['type'] & ClassMetadataInfo::TO_MANY) { |
1561 | - $lines[] = $this->spaces . ' * @var \Doctrine\Common\Collections\Collection'; |
|
1561 | + $lines[] = $this->spaces.' * @var \Doctrine\Common\Collections\Collection'; |
|
1562 | 1562 | } else { |
1563 | - $lines[] = $this->spaces . ' * @var \\' . ltrim($associationMapping['targetEntity'], '\\'); |
|
1563 | + $lines[] = $this->spaces.' * @var \\'.ltrim($associationMapping['targetEntity'], '\\'); |
|
1564 | 1564 | } |
1565 | 1565 | |
1566 | 1566 | if ($this->generateAnnotations) { |
1567 | - $lines[] = $this->spaces . ' *'; |
|
1567 | + $lines[] = $this->spaces.' *'; |
|
1568 | 1568 | |
1569 | 1569 | if (isset($associationMapping['id']) && $associationMapping['id']) { |
1570 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Id'; |
|
1570 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Id'; |
|
1571 | 1571 | |
1572 | 1572 | if ($generatorType = $this->getIdGeneratorTypeString($metadata->generatorType)) { |
1573 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'GeneratedValue(strategy="' . $generatorType . '")'; |
|
1573 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'GeneratedValue(strategy="'.$generatorType.'")'; |
|
1574 | 1574 | } |
1575 | 1575 | } |
1576 | 1576 | |
@@ -1592,15 +1592,15 @@ discard block |
||
1592 | 1592 | $typeOptions = []; |
1593 | 1593 | |
1594 | 1594 | if (isset($associationMapping['targetEntity'])) { |
1595 | - $typeOptions[] = 'targetEntity="' . $associationMapping['targetEntity'] . '"'; |
|
1595 | + $typeOptions[] = 'targetEntity="'.$associationMapping['targetEntity'].'"'; |
|
1596 | 1596 | } |
1597 | 1597 | |
1598 | 1598 | if (isset($associationMapping['inversedBy'])) { |
1599 | - $typeOptions[] = 'inversedBy="' . $associationMapping['inversedBy'] . '"'; |
|
1599 | + $typeOptions[] = 'inversedBy="'.$associationMapping['inversedBy'].'"'; |
|
1600 | 1600 | } |
1601 | 1601 | |
1602 | 1602 | if (isset($associationMapping['mappedBy'])) { |
1603 | - $typeOptions[] = 'mappedBy="' . $associationMapping['mappedBy'] . '"'; |
|
1603 | + $typeOptions[] = 'mappedBy="'.$associationMapping['mappedBy'].'"'; |
|
1604 | 1604 | } |
1605 | 1605 | |
1606 | 1606 | if ($associationMapping['cascade']) { |
@@ -1616,11 +1616,11 @@ discard block |
||
1616 | 1616 | $cascades = ['"all"']; |
1617 | 1617 | } |
1618 | 1618 | |
1619 | - $typeOptions[] = 'cascade={' . implode(',', $cascades) . '}'; |
|
1619 | + $typeOptions[] = 'cascade={'.implode(',', $cascades).'}'; |
|
1620 | 1620 | } |
1621 | 1621 | |
1622 | 1622 | if (isset($associationMapping['orphanRemoval']) && $associationMapping['orphanRemoval']) { |
1623 | - $typeOptions[] = 'orphanRemoval=' . ($associationMapping['orphanRemoval'] ? 'true' : 'false'); |
|
1623 | + $typeOptions[] = 'orphanRemoval='.($associationMapping['orphanRemoval'] ? 'true' : 'false'); |
|
1624 | 1624 | } |
1625 | 1625 | |
1626 | 1626 | if (isset($associationMapping['fetch']) && $associationMapping['fetch'] !== ClassMetadataInfo::FETCH_LAZY) { |
@@ -1629,71 +1629,71 @@ discard block |
||
1629 | 1629 | ClassMetadataInfo::FETCH_EAGER => 'EAGER', |
1630 | 1630 | ]; |
1631 | 1631 | |
1632 | - $typeOptions[] = 'fetch="' . $fetchMap[$associationMapping['fetch']] . '"'; |
|
1632 | + $typeOptions[] = 'fetch="'.$fetchMap[$associationMapping['fetch']].'"'; |
|
1633 | 1633 | } |
1634 | 1634 | |
1635 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . '' . $type . '(' . implode(', ', $typeOptions) . ')'; |
|
1635 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.''.$type.'('.implode(', ', $typeOptions).')'; |
|
1636 | 1636 | |
1637 | 1637 | if (isset($associationMapping['joinColumns']) && $associationMapping['joinColumns']) { |
1638 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'JoinColumns({'; |
|
1638 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'JoinColumns({'; |
|
1639 | 1639 | |
1640 | 1640 | $joinColumnsLines = []; |
1641 | 1641 | |
1642 | 1642 | foreach ($associationMapping['joinColumns'] as $joinColumn) { |
1643 | 1643 | if ($joinColumnAnnot = $this->generateJoinColumnAnnotation($joinColumn)) { |
1644 | - $joinColumnsLines[] = $this->spaces . ' * ' . $joinColumnAnnot; |
|
1644 | + $joinColumnsLines[] = $this->spaces.' * '.$joinColumnAnnot; |
|
1645 | 1645 | } |
1646 | 1646 | } |
1647 | 1647 | |
1648 | 1648 | $lines[] = implode(",\n", $joinColumnsLines); |
1649 | - $lines[] = $this->spaces . ' * })'; |
|
1649 | + $lines[] = $this->spaces.' * })'; |
|
1650 | 1650 | } |
1651 | 1651 | |
1652 | 1652 | if (isset($associationMapping['joinTable']) && $associationMapping['joinTable']) { |
1653 | 1653 | $joinTable = []; |
1654 | - $joinTable[] = 'name="' . $associationMapping['joinTable']['name'] . '"'; |
|
1654 | + $joinTable[] = 'name="'.$associationMapping['joinTable']['name'].'"'; |
|
1655 | 1655 | |
1656 | 1656 | if (isset($associationMapping['joinTable']['schema'])) { |
1657 | - $joinTable[] = 'schema="' . $associationMapping['joinTable']['schema'] . '"'; |
|
1657 | + $joinTable[] = 'schema="'.$associationMapping['joinTable']['schema'].'"'; |
|
1658 | 1658 | } |
1659 | 1659 | |
1660 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'JoinTable(' . implode(', ', $joinTable) . ','; |
|
1661 | - $lines[] = $this->spaces . ' * joinColumns={'; |
|
1660 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'JoinTable('.implode(', ', $joinTable).','; |
|
1661 | + $lines[] = $this->spaces.' * joinColumns={'; |
|
1662 | 1662 | |
1663 | 1663 | $joinColumnsLines = []; |
1664 | 1664 | |
1665 | 1665 | foreach ($associationMapping['joinTable']['joinColumns'] as $joinColumn) { |
1666 | - $joinColumnsLines[] = $this->spaces . ' * ' . $this->generateJoinColumnAnnotation($joinColumn); |
|
1666 | + $joinColumnsLines[] = $this->spaces.' * '.$this->generateJoinColumnAnnotation($joinColumn); |
|
1667 | 1667 | } |
1668 | 1668 | |
1669 | - $lines[] = implode(",". PHP_EOL, $joinColumnsLines); |
|
1670 | - $lines[] = $this->spaces . ' * },'; |
|
1671 | - $lines[] = $this->spaces . ' * inverseJoinColumns={'; |
|
1669 | + $lines[] = implode(",".PHP_EOL, $joinColumnsLines); |
|
1670 | + $lines[] = $this->spaces.' * },'; |
|
1671 | + $lines[] = $this->spaces.' * inverseJoinColumns={'; |
|
1672 | 1672 | |
1673 | 1673 | $inverseJoinColumnsLines = []; |
1674 | 1674 | |
1675 | 1675 | foreach ($associationMapping['joinTable']['inverseJoinColumns'] as $joinColumn) { |
1676 | - $inverseJoinColumnsLines[] = $this->spaces . ' * ' . $this->generateJoinColumnAnnotation($joinColumn); |
|
1676 | + $inverseJoinColumnsLines[] = $this->spaces.' * '.$this->generateJoinColumnAnnotation($joinColumn); |
|
1677 | 1677 | } |
1678 | 1678 | |
1679 | - $lines[] = implode(",". PHP_EOL, $inverseJoinColumnsLines); |
|
1680 | - $lines[] = $this->spaces . ' * }'; |
|
1681 | - $lines[] = $this->spaces . ' * )'; |
|
1679 | + $lines[] = implode(",".PHP_EOL, $inverseJoinColumnsLines); |
|
1680 | + $lines[] = $this->spaces.' * }'; |
|
1681 | + $lines[] = $this->spaces.' * )'; |
|
1682 | 1682 | } |
1683 | 1683 | |
1684 | 1684 | if (isset($associationMapping['orderBy'])) { |
1685 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'OrderBy({'; |
|
1685 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'OrderBy({'; |
|
1686 | 1686 | |
1687 | 1687 | foreach ($associationMapping['orderBy'] as $name => $direction) { |
1688 | - $lines[] = $this->spaces . ' * "' . $name . '"="' . $direction . '",'; |
|
1688 | + $lines[] = $this->spaces.' * "'.$name.'"="'.$direction.'",'; |
|
1689 | 1689 | } |
1690 | 1690 | |
1691 | 1691 | $lines[count($lines) - 1] = substr($lines[count($lines) - 1], 0, strlen($lines[count($lines) - 1]) - 1); |
1692 | - $lines[] = $this->spaces . ' * })'; |
|
1692 | + $lines[] = $this->spaces.' * })'; |
|
1693 | 1693 | } |
1694 | 1694 | } |
1695 | 1695 | |
1696 | - $lines[] = $this->spaces . ' */'; |
|
1696 | + $lines[] = $this->spaces.' */'; |
|
1697 | 1697 | |
1698 | 1698 | return implode("\n", $lines); |
1699 | 1699 | } |
@@ -1707,37 +1707,37 @@ discard block |
||
1707 | 1707 | protected function generateFieldMappingPropertyDocBlock(array $fieldMapping, ClassMetadataInfo $metadata) |
1708 | 1708 | { |
1709 | 1709 | $lines = []; |
1710 | - $lines[] = $this->spaces . '/**'; |
|
1711 | - $lines[] = $this->spaces . ' * @var ' |
|
1710 | + $lines[] = $this->spaces.'/**'; |
|
1711 | + $lines[] = $this->spaces.' * @var ' |
|
1712 | 1712 | . $this->getType($fieldMapping['type']) |
1713 | 1713 | . ($this->nullableFieldExpression($fieldMapping) ? '|null' : ''); |
1714 | 1714 | |
1715 | 1715 | if ($this->generateAnnotations) { |
1716 | - $lines[] = $this->spaces . ' *'; |
|
1716 | + $lines[] = $this->spaces.' *'; |
|
1717 | 1717 | |
1718 | 1718 | $column = []; |
1719 | 1719 | if (isset($fieldMapping['columnName'])) { |
1720 | - $column[] = 'name="' . $fieldMapping['columnName'] . '"'; |
|
1720 | + $column[] = 'name="'.$fieldMapping['columnName'].'"'; |
|
1721 | 1721 | } |
1722 | 1722 | |
1723 | 1723 | if (isset($fieldMapping['type'])) { |
1724 | - $column[] = 'type="' . $fieldMapping['type'] . '"'; |
|
1724 | + $column[] = 'type="'.$fieldMapping['type'].'"'; |
|
1725 | 1725 | } |
1726 | 1726 | |
1727 | 1727 | if (isset($fieldMapping['length'])) { |
1728 | - $column[] = 'length=' . $fieldMapping['length']; |
|
1728 | + $column[] = 'length='.$fieldMapping['length']; |
|
1729 | 1729 | } |
1730 | 1730 | |
1731 | 1731 | if (isset($fieldMapping['precision'])) { |
1732 | - $column[] = 'precision=' . $fieldMapping['precision']; |
|
1732 | + $column[] = 'precision='.$fieldMapping['precision']; |
|
1733 | 1733 | } |
1734 | 1734 | |
1735 | 1735 | if (isset($fieldMapping['scale'])) { |
1736 | - $column[] = 'scale=' . $fieldMapping['scale']; |
|
1736 | + $column[] = 'scale='.$fieldMapping['scale']; |
|
1737 | 1737 | } |
1738 | 1738 | |
1739 | 1739 | if (isset($fieldMapping['nullable'])) { |
1740 | - $column[] = 'nullable=' . var_export($fieldMapping['nullable'], true); |
|
1740 | + $column[] = 'nullable='.var_export($fieldMapping['nullable'], true); |
|
1741 | 1741 | } |
1742 | 1742 | |
1743 | 1743 | $options = []; |
@@ -1751,47 +1751,47 @@ discard block |
||
1751 | 1751 | } |
1752 | 1752 | |
1753 | 1753 | if (isset($fieldMapping['columnDefinition'])) { |
1754 | - $column[] = 'columnDefinition="' . $fieldMapping['columnDefinition'] . '"'; |
|
1754 | + $column[] = 'columnDefinition="'.$fieldMapping['columnDefinition'].'"'; |
|
1755 | 1755 | } |
1756 | 1756 | |
1757 | 1757 | if (isset($fieldMapping['unique'])) { |
1758 | - $column[] = 'unique=' . var_export($fieldMapping['unique'], true); |
|
1758 | + $column[] = 'unique='.var_export($fieldMapping['unique'], true); |
|
1759 | 1759 | } |
1760 | 1760 | |
1761 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Column(' . implode(', ', $column) . ')'; |
|
1761 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Column('.implode(', ', $column).')'; |
|
1762 | 1762 | |
1763 | 1763 | if (isset($fieldMapping['id']) && $fieldMapping['id']) { |
1764 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Id'; |
|
1764 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Id'; |
|
1765 | 1765 | |
1766 | 1766 | if ($generatorType = $this->getIdGeneratorTypeString($metadata->generatorType)) { |
1767 | - $lines[] = $this->spaces.' * @' . $this->annotationsPrefix . 'GeneratedValue(strategy="' . $generatorType . '")'; |
|
1767 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'GeneratedValue(strategy="'.$generatorType.'")'; |
|
1768 | 1768 | } |
1769 | 1769 | |
1770 | 1770 | if ($metadata->sequenceGeneratorDefinition) { |
1771 | 1771 | $sequenceGenerator = []; |
1772 | 1772 | |
1773 | 1773 | if (isset($metadata->sequenceGeneratorDefinition['sequenceName'])) { |
1774 | - $sequenceGenerator[] = 'sequenceName="' . $metadata->sequenceGeneratorDefinition['sequenceName'] . '"'; |
|
1774 | + $sequenceGenerator[] = 'sequenceName="'.$metadata->sequenceGeneratorDefinition['sequenceName'].'"'; |
|
1775 | 1775 | } |
1776 | 1776 | |
1777 | 1777 | if (isset($metadata->sequenceGeneratorDefinition['allocationSize'])) { |
1778 | - $sequenceGenerator[] = 'allocationSize=' . $metadata->sequenceGeneratorDefinition['allocationSize']; |
|
1778 | + $sequenceGenerator[] = 'allocationSize='.$metadata->sequenceGeneratorDefinition['allocationSize']; |
|
1779 | 1779 | } |
1780 | 1780 | |
1781 | 1781 | if (isset($metadata->sequenceGeneratorDefinition['initialValue'])) { |
1782 | - $sequenceGenerator[] = 'initialValue=' . $metadata->sequenceGeneratorDefinition['initialValue']; |
|
1782 | + $sequenceGenerator[] = 'initialValue='.$metadata->sequenceGeneratorDefinition['initialValue']; |
|
1783 | 1783 | } |
1784 | 1784 | |
1785 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'SequenceGenerator(' . implode(', ', $sequenceGenerator) . ')'; |
|
1785 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'SequenceGenerator('.implode(', ', $sequenceGenerator).')'; |
|
1786 | 1786 | } |
1787 | 1787 | } |
1788 | 1788 | |
1789 | 1789 | if (isset($fieldMapping['version']) && $fieldMapping['version']) { |
1790 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Version'; |
|
1790 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Version'; |
|
1791 | 1791 | } |
1792 | 1792 | } |
1793 | 1793 | |
1794 | - $lines[] = $this->spaces . ' */'; |
|
1794 | + $lines[] = $this->spaces.' */'; |
|
1795 | 1795 | |
1796 | 1796 | return implode("\n", $lines); |
1797 | 1797 | } |
@@ -1804,27 +1804,27 @@ discard block |
||
1804 | 1804 | protected function generateEmbeddedPropertyDocBlock(array $embeddedClass) |
1805 | 1805 | { |
1806 | 1806 | $lines = []; |
1807 | - $lines[] = $this->spaces . '/**'; |
|
1808 | - $lines[] = $this->spaces . ' * @var \\' . ltrim($embeddedClass['class'], '\\'); |
|
1807 | + $lines[] = $this->spaces.'/**'; |
|
1808 | + $lines[] = $this->spaces.' * @var \\'.ltrim($embeddedClass['class'], '\\'); |
|
1809 | 1809 | |
1810 | 1810 | if ($this->generateAnnotations) { |
1811 | - $lines[] = $this->spaces . ' *'; |
|
1811 | + $lines[] = $this->spaces.' *'; |
|
1812 | 1812 | |
1813 | - $embedded = ['class="' . $embeddedClass['class'] . '"']; |
|
1813 | + $embedded = ['class="'.$embeddedClass['class'].'"']; |
|
1814 | 1814 | |
1815 | 1815 | if (isset($embeddedClass['columnPrefix'])) { |
1816 | 1816 | if (is_string($embeddedClass['columnPrefix'])) { |
1817 | - $embedded[] = 'columnPrefix="' . $embeddedClass['columnPrefix'] . '"'; |
|
1817 | + $embedded[] = 'columnPrefix="'.$embeddedClass['columnPrefix'].'"'; |
|
1818 | 1818 | } else { |
1819 | - $embedded[] = 'columnPrefix=' . var_export($embeddedClass['columnPrefix'], true); |
|
1819 | + $embedded[] = 'columnPrefix='.var_export($embeddedClass['columnPrefix'], true); |
|
1820 | 1820 | } |
1821 | 1821 | } |
1822 | 1822 | |
1823 | - $lines[] = $this->spaces . ' * @' . |
|
1824 | - $this->annotationsPrefix . 'Embedded(' . implode(', ', $embedded) . ')'; |
|
1823 | + $lines[] = $this->spaces.' * @'. |
|
1824 | + $this->annotationsPrefix.'Embedded('.implode(', ', $embedded).')'; |
|
1825 | 1825 | } |
1826 | 1826 | |
1827 | - $lines[] = $this->spaces . ' */'; |
|
1827 | + $lines[] = $this->spaces.' */'; |
|
1828 | 1828 | |
1829 | 1829 | return implode("\n", $lines); |
1830 | 1830 | } |
@@ -1838,13 +1838,13 @@ discard block |
||
1838 | 1838 | $processedClasses = []; |
1839 | 1839 | foreach ($metadata->entityListeners as $event => $eventListeners) { |
1840 | 1840 | foreach ($eventListeners as $eventListener) { |
1841 | - $processedClasses[] = '"' . $eventListener['class'] . '"'; |
|
1841 | + $processedClasses[] = '"'.$eventListener['class'].'"'; |
|
1842 | 1842 | } |
1843 | 1843 | } |
1844 | 1844 | |
1845 | 1845 | return \sprintf( |
1846 | 1846 | '%s%s({%s})', |
1847 | - '@' . $this->annotationsPrefix, |
|
1847 | + '@'.$this->annotationsPrefix, |
|
1848 | 1848 | 'EntityListeners', |
1849 | 1849 | \implode(',', \array_unique($processedClasses)) |
1850 | 1850 | ); |
@@ -1862,7 +1862,7 @@ discard block |
||
1862 | 1862 | |
1863 | 1863 | foreach ($lines as $key => $value) { |
1864 | 1864 | if ( ! empty($value)) { |
1865 | - $lines[$key] = str_repeat($this->spaces, $num) . $lines[$key]; |
|
1865 | + $lines[$key] = str_repeat($this->spaces, $num).$lines[$key]; |
|
1866 | 1866 | } |
1867 | 1867 | } |
1868 | 1868 | |
@@ -1944,9 +1944,9 @@ discard block |
||
1944 | 1944 | |
1945 | 1945 | foreach ($options as $name => $option) { |
1946 | 1946 | if (is_array($option)) { |
1947 | - $optionsStr[] = '"' . $name . '"={' . $this->exportTableOptions($option) . '}'; |
|
1947 | + $optionsStr[] = '"'.$name.'"={'.$this->exportTableOptions($option).'}'; |
|
1948 | 1948 | } else { |
1949 | - $optionsStr[] = '"' . $name . '"="' . (string) $option . '"'; |
|
1949 | + $optionsStr[] = '"'.$name.'"="'.(string) $option.'"'; |
|
1950 | 1950 | } |
1951 | 1951 | } |
1952 | 1952 | |
@@ -1969,7 +1969,7 @@ discard block |
||
1969 | 1969 | if ('get' === $type) { |
1970 | 1970 | if ( |
1971 | 1971 | $metadata->isSingleValuedAssociation($fieldName) || |
1972 | - (!$metadata->hasAssociation($fieldName) && $metadata->isNullable($fieldName)) |
|
1972 | + ( ! $metadata->hasAssociation($fieldName) && $metadata->isNullable($fieldName)) |
|
1973 | 1973 | ) { |
1974 | 1974 | return null; |
1975 | 1975 | } |
@@ -721,13 +721,13 @@ |
||
721 | 721 | return $joinColumn; |
722 | 722 | } |
723 | 723 | |
724 | - /** |
|
725 | - * Parses the given field as array. |
|
726 | - * |
|
727 | - * @param SimpleXMLElement $fieldMapping |
|
728 | - * |
|
729 | - * @return array |
|
730 | - */ |
|
724 | + /** |
|
725 | + * Parses the given field as array. |
|
726 | + * |
|
727 | + * @param SimpleXMLElement $fieldMapping |
|
728 | + * |
|
729 | + * @return array |
|
730 | + */ |
|
731 | 731 | private function columnToArray(SimpleXMLElement $fieldMapping) |
732 | 732 | { |
733 | 733 | $mapping = [ |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | |
165 | 165 | if (isset($xmlRoot['inheritance-type'])) { |
166 | 166 | $inheritanceType = (string) $xmlRoot['inheritance-type']; |
167 | - $metadata->setInheritanceType(constant('Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_' . $inheritanceType)); |
|
167 | + $metadata->setInheritanceType(constant('Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_'.$inheritanceType)); |
|
168 | 168 | |
169 | 169 | if ($metadata->inheritanceType != Metadata::INHERITANCE_TYPE_NONE) { |
170 | 170 | // Evaluate <discriminator-column...> |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | } |
367 | 367 | |
368 | 368 | if (isset($oneToOneElement['fetch'])) { |
369 | - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . (string) $oneToOneElement['fetch']); |
|
369 | + $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.(string) $oneToOneElement['fetch']); |
|
370 | 370 | } |
371 | 371 | |
372 | 372 | if (isset($oneToOneElement['mapped-by'])) { |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | ]; |
416 | 416 | |
417 | 417 | if (isset($oneToManyElement['fetch'])) { |
418 | - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . (string) $oneToManyElement['fetch']); |
|
418 | + $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.(string) $oneToManyElement['fetch']); |
|
419 | 419 | } |
420 | 420 | |
421 | 421 | if (isset($oneToManyElement->cascade)) { |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | } |
463 | 463 | |
464 | 464 | if (isset($manyToOneElement['fetch'])) { |
465 | - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . (string) $manyToOneElement['fetch']); |
|
465 | + $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.(string) $manyToOneElement['fetch']); |
|
466 | 466 | } |
467 | 467 | |
468 | 468 | if (isset($manyToOneElement['inversed-by'])) { |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | ]; |
505 | 505 | |
506 | 506 | if (isset($manyToManyElement['fetch'])) { |
507 | - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . (string) $manyToManyElement['fetch']); |
|
507 | + $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.(string) $manyToManyElement['fetch']); |
|
508 | 508 | } |
509 | 509 | |
510 | 510 | if (isset($manyToManyElement['orphan-removal'])) { |
@@ -624,7 +624,7 @@ discard block |
||
624 | 624 | |
625 | 625 | // Check for `fetch` |
626 | 626 | if (isset($overrideElement['fetch'])) { |
627 | - $override['fetch'] = constant(Metadata::class . '::FETCH_' . (string) $overrideElement['fetch']); |
|
627 | + $override['fetch'] = constant(Metadata::class.'::FETCH_'.(string) $overrideElement['fetch']); |
|
628 | 628 | } |
629 | 629 | |
630 | 630 | $metadata->setAssociationOverride($fieldName, $override); |
@@ -634,7 +634,7 @@ discard block |
||
634 | 634 | // Evaluate <lifecycle-callbacks...> |
635 | 635 | if (isset($xmlRoot->{'lifecycle-callbacks'})) { |
636 | 636 | foreach ($xmlRoot->{'lifecycle-callbacks'}->{'lifecycle-callback'} as $lifecycleCallback) { |
637 | - $metadata->addLifecycleCallback((string) $lifecycleCallback['method'], constant('Doctrine\ORM\Events::' . (string) $lifecycleCallback['type'])); |
|
637 | + $metadata->addLifecycleCallback((string) $lifecycleCallback['method'], constant('Doctrine\ORM\Events::'.(string) $lifecycleCallback['type'])); |
|
638 | 638 | } |
639 | 639 | } |
640 | 640 | |
@@ -795,12 +795,12 @@ discard block |
||
795 | 795 | $region = isset($cacheMapping['region']) ? (string) $cacheMapping['region'] : null; |
796 | 796 | $usage = isset($cacheMapping['usage']) ? strtoupper($cacheMapping['usage']) : null; |
797 | 797 | |
798 | - if ($usage && ! defined('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_' . $usage)) { |
|
798 | + if ($usage && ! defined('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_'.$usage)) { |
|
799 | 799 | throw new \InvalidArgumentException(sprintf('Invalid cache usage "%s"', $usage)); |
800 | 800 | } |
801 | 801 | |
802 | 802 | if ($usage) { |
803 | - $usage = constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_' . $usage); |
|
803 | + $usage = constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_'.$usage); |
|
804 | 804 | } |
805 | 805 | |
806 | 806 | return [ |
@@ -30,9 +30,9 @@ |
||
30 | 30 | */ |
31 | 31 | class ReadOnlyCachedCollectionPersister extends NonStrictReadWriteCachedCollectionPersister |
32 | 32 | { |
33 | - /** |
|
34 | - * {@inheritdoc} |
|
35 | - */ |
|
33 | + /** |
|
34 | + * {@inheritdoc} |
|
35 | + */ |
|
36 | 36 | public function update(PersistentCollection $collection) |
37 | 37 | { |
38 | 38 | if ($collection->isDirty() && $collection->getSnapshot()) { |
@@ -37,9 +37,9 @@ discard block |
||
37 | 37 | */ |
38 | 38 | abstract class AbstractCollectionPersister implements CachedCollectionPersister |
39 | 39 | { |
40 | - /** |
|
41 | - * @var \Doctrine\ORM\UnitOfWork |
|
42 | - */ |
|
40 | + /** |
|
41 | + * @var \Doctrine\ORM\UnitOfWork |
|
42 | + */ |
|
43 | 43 | protected $uow; |
44 | 44 | |
45 | 45 | /** |
@@ -67,9 +67,9 @@ discard block |
||
67 | 67 | */ |
68 | 68 | protected $association; |
69 | 69 | |
70 | - /** |
|
71 | - * @var array |
|
72 | - */ |
|
70 | + /** |
|
71 | + * @var array |
|
72 | + */ |
|
73 | 73 | protected $queuedCache = []; |
74 | 74 | |
75 | 75 | /** |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | */ |
74 | 74 | public function getCacheLogger() |
75 | 75 | { |
76 | - return $this->cacheLogger; |
|
76 | + return $this->cacheLogger; |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | /** |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | ); |
116 | 116 | } |
117 | 117 | |
118 | - return $this->queryValidator; |
|
118 | + return $this->queryValidator; |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | /** |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | foreach ($joinColumns as $joinColumn) { |
132 | 132 | $columnName = $this->quoteStrategy->getJoinColumnName($joinColumn, $sourceClass, $this->platform); |
133 | 133 | $referencedName = $joinColumn['referencedColumnName']; |
134 | - $conditions[] = 't.' . $columnName . ' = ?'; |
|
134 | + $conditions[] = 't.'.$columnName.' = ?'; |
|
135 | 135 | $params[] = $id[$sourceClass->getFieldForColumn($referencedName)]; |
136 | 136 | $types[] = PersisterHelper::getTypeOfColumn($referencedName, $sourceClass, $this->em); |
137 | 137 | } |
@@ -160,9 +160,9 @@ discard block |
||
160 | 160 | }*/ |
161 | 161 | |
162 | 162 | $sql = 'SELECT COUNT(*)' |
163 | - . ' FROM ' . $joinTableName . ' t' |
|
163 | + . ' FROM '.$joinTableName.' t' |
|
164 | 164 | . $joinTargetEntitySQL |
165 | - . ' WHERE ' . implode(' AND ', $conditions); |
|
165 | + . ' WHERE '.implode(' AND ', $conditions); |
|
166 | 166 | |
167 | 167 | return $this->conn->fetchColumn($sql, $params, 0, $types); |
168 | 168 | } |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | |
191 | 191 | list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictionsWithKey($collection, $key, true); |
192 | 192 | |
193 | - $sql = 'SELECT 1 FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); |
|
193 | + $sql = 'SELECT 1 FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses); |
|
194 | 194 | |
195 | 195 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
196 | 196 | } |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | |
207 | 207 | list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictions($collection, $element, 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 | } |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | |
223 | 223 | list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictions($collection, $element, false); |
224 | 224 | |
225 | - $sql = 'DELETE FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); |
|
225 | + $sql = 'DELETE FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses); |
|
226 | 226 | |
227 | 227 | return (bool) $this->conn->executeUpdate($sql, $params, $types); |
228 | 228 | } |
@@ -271,11 +271,11 @@ discard block |
||
271 | 271 | $rsm = new Query\ResultSetMappingBuilder($this->em); |
272 | 272 | $rsm->addRootEntityFromClassMetadata($targetClass->name, 'te'); |
273 | 273 | |
274 | - $sql = 'SELECT ' . $rsm->generateSelectClause() |
|
275 | - . ' FROM ' . $tableName . ' te' |
|
276 | - . ' JOIN ' . $joinTable . ' t ON' |
|
274 | + $sql = 'SELECT '.$rsm->generateSelectClause() |
|
275 | + . ' FROM '.$tableName.' te' |
|
276 | + . ' JOIN '.$joinTable.' t ON' |
|
277 | 277 | . implode(' AND ', $onConditions) |
278 | - . ' WHERE ' . implode(' AND ', $whereClauses); |
|
278 | + . ' WHERE '.implode(' AND ', $whereClauses); |
|
279 | 279 | |
280 | 280 | $sql .= $this->getOrderingSql($criteria, $targetClass); |
281 | 281 | |
@@ -316,8 +316,8 @@ discard block |
||
316 | 316 | |
317 | 317 | // A join is needed if there is filtering on the target entity |
318 | 318 | $tableName = $this->quoteStrategy->getTableName($rootClass, $this->platform); |
319 | - $joinSql = ' JOIN ' . $tableName . ' te' |
|
320 | - . ' ON' . implode(' AND ', $this->getOnConditionSQL($mapping)); |
|
319 | + $joinSql = ' JOIN '.$tableName.' te' |
|
320 | + . ' ON'.implode(' AND ', $this->getOnConditionSQL($mapping)); |
|
321 | 321 | |
322 | 322 | return [$joinSql, $filterSql]; |
323 | 323 | } |
@@ -336,12 +336,12 @@ discard block |
||
336 | 336 | |
337 | 337 | foreach ($this->em->getFilters()->getEnabledFilters() as $filter) { |
338 | 338 | if ($filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) { |
339 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
339 | + $filterClauses[] = '('.$filterExpr.')'; |
|
340 | 340 | } |
341 | 341 | } |
342 | 342 | |
343 | 343 | return $filterClauses |
344 | - ? '(' . implode(' AND ', $filterClauses) . ')' |
|
344 | + ? '('.implode(' AND ', $filterClauses).')' |
|
345 | 345 | : ''; |
346 | 346 | } |
347 | 347 | |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | $joinColumnName = $this->quoteStrategy->getJoinColumnName($joinColumn, $targetClass, $this->platform); |
370 | 370 | $refColumnName = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $targetClass, $this->platform); |
371 | 371 | |
372 | - $conditions[] = ' t.' . $joinColumnName . ' = ' . 'te.' . $refColumnName; |
|
372 | + $conditions[] = ' t.'.$joinColumnName.' = '.'te.'.$refColumnName; |
|
373 | 373 | } |
374 | 374 | |
375 | 375 | return $conditions; |
@@ -391,8 +391,8 @@ discard block |
||
391 | 391 | $columns[] = $this->quoteStrategy->getJoinColumnName($joinColumn, $class, $this->platform); |
392 | 392 | } |
393 | 393 | |
394 | - return 'DELETE FROM ' . $joinTable |
|
395 | - . ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?'; |
|
394 | + return 'DELETE FROM '.$joinTable |
|
395 | + . ' WHERE '.implode(' = ? AND ', $columns).' = ?'; |
|
396 | 396 | } |
397 | 397 | |
398 | 398 | /** |
@@ -451,8 +451,8 @@ discard block |
||
451 | 451 | } |
452 | 452 | |
453 | 453 | return [ |
454 | - 'DELETE FROM ' . $this->quoteStrategy->getJoinTableName($mapping, $class, $this->platform) |
|
455 | - . ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?', |
|
454 | + 'DELETE FROM '.$this->quoteStrategy->getJoinTableName($mapping, $class, $this->platform) |
|
455 | + . ' WHERE '.implode(' = ? AND ', $columns).' = ?', |
|
456 | 456 | $types, |
457 | 457 | ]; |
458 | 458 | } |
@@ -500,10 +500,10 @@ discard block |
||
500 | 500 | } |
501 | 501 | |
502 | 502 | return [ |
503 | - 'INSERT INTO ' . $this->quoteStrategy->getJoinTableName($mapping, $class, $this->platform) |
|
504 | - . ' (' . implode(', ', $columns) . ')' |
|
503 | + 'INSERT INTO '.$this->quoteStrategy->getJoinTableName($mapping, $class, $this->platform) |
|
504 | + . ' ('.implode(', ', $columns).')' |
|
505 | 505 | . ' VALUES' |
506 | - . ' (' . implode(', ', array_fill(0, count($columns), '?')) . ')', |
|
506 | + . ' ('.implode(', ', array_fill(0, count($columns), '?')).')', |
|
507 | 507 | $types, |
508 | 508 | ]; |
509 | 509 | } |
@@ -588,7 +588,7 @@ discard block |
||
588 | 588 | $sourceClass = $this->em->getClassMetadata($mapping['sourceEntity']); |
589 | 589 | $targetClass = $this->em->getClassMetadata($mapping['targetEntity']); |
590 | 590 | |
591 | - if (! $mapping['isOwningSide']) { |
|
591 | + if ( ! $mapping['isOwningSide']) { |
|
592 | 592 | $associationSourceClass = $this->em->getClassMetadata($mapping['targetEntity']); |
593 | 593 | $mapping = $associationSourceClass->associationMappings[$mapping['mappedBy']]; |
594 | 594 | $joinColumns = $mapping['joinTable']['joinColumns']; |
@@ -601,7 +601,7 @@ discard block |
||
601 | 601 | $targetRelationMode = 'relationToTargetKeyColumns'; |
602 | 602 | } |
603 | 603 | |
604 | - $quotedJoinTable = $this->quoteStrategy->getJoinTableName($mapping, $associationSourceClass, $this->platform). ' t'; |
|
604 | + $quotedJoinTable = $this->quoteStrategy->getJoinTableName($mapping, $associationSourceClass, $this->platform).' t'; |
|
605 | 605 | $whereClauses = []; |
606 | 606 | $params = []; |
607 | 607 | $types = []; |
@@ -612,14 +612,14 @@ discard block |
||
612 | 612 | $joinConditions = []; |
613 | 613 | |
614 | 614 | foreach ($joinColumns as $joinTableColumn) { |
615 | - $joinConditions[] = 't.' . $joinTableColumn['name'] . ' = tr.' . $joinTableColumn['referencedColumnName']; |
|
615 | + $joinConditions[] = 't.'.$joinTableColumn['name'].' = tr.'.$joinTableColumn['referencedColumnName']; |
|
616 | 616 | } |
617 | 617 | |
618 | 618 | $tableName = $this->quoteStrategy->getTableName($targetClass, $this->platform); |
619 | - $quotedJoinTable .= ' JOIN ' . $tableName . ' tr ON ' . implode(' AND ', $joinConditions); |
|
619 | + $quotedJoinTable .= ' JOIN '.$tableName.' tr ON '.implode(' AND ', $joinConditions); |
|
620 | 620 | $columnName = $targetClass->getColumnName($indexBy); |
621 | 621 | |
622 | - $whereClauses[] = 'tr.' . $columnName . ' = ?'; |
|
622 | + $whereClauses[] = 'tr.'.$columnName.' = ?'; |
|
623 | 623 | $params[] = $key; |
624 | 624 | $types[] = PersisterHelper::getTypeOfColumn($columnName, $targetClass, $this->em); |
625 | 625 | } |
@@ -627,7 +627,7 @@ discard block |
||
627 | 627 | foreach ($mapping['joinTableColumns'] as $joinTableColumn) { |
628 | 628 | if (isset($mapping[$sourceRelationMode][$joinTableColumn])) { |
629 | 629 | $column = $mapping[$sourceRelationMode][$joinTableColumn]; |
630 | - $whereClauses[] = 't.' . $joinTableColumn . ' = ?'; |
|
630 | + $whereClauses[] = 't.'.$joinTableColumn.' = ?'; |
|
631 | 631 | $params[] = $sourceClass->containsForeignIdentifier |
632 | 632 | ? $id[$sourceClass->getFieldForColumn($column)] |
633 | 633 | : $id[$sourceClass->fieldNames[$column]]; |
@@ -635,7 +635,7 @@ discard block |
||
635 | 635 | } elseif ( ! $joinNeeded) { |
636 | 636 | $column = $mapping[$targetRelationMode][$joinTableColumn]; |
637 | 637 | |
638 | - $whereClauses[] = 't.' . $joinTableColumn . ' = ?'; |
|
638 | + $whereClauses[] = 't.'.$joinTableColumn.' = ?'; |
|
639 | 639 | $params[] = $key; |
640 | 640 | $types[] = PersisterHelper::getTypeOfColumn($column, $targetClass, $this->em); |
641 | 641 | } |
@@ -645,7 +645,7 @@ discard block |
||
645 | 645 | list($joinTargetEntitySQL, $filterSql) = $this->getFilterSql($filterMapping); |
646 | 646 | |
647 | 647 | if ($filterSql) { |
648 | - $quotedJoinTable .= ' ' . $joinTargetEntitySQL; |
|
648 | + $quotedJoinTable .= ' '.$joinTargetEntitySQL; |
|
649 | 649 | $whereClauses[] = $filterSql; |
650 | 650 | } |
651 | 651 | } |
@@ -689,7 +689,7 @@ discard block |
||
689 | 689 | $types = []; |
690 | 690 | |
691 | 691 | foreach ($mapping['joinTableColumns'] as $joinTableColumn) { |
692 | - $whereClauses[] = ($addFilters ? 't.' : '') . $joinTableColumn . ' = ?'; |
|
692 | + $whereClauses[] = ($addFilters ? 't.' : '').$joinTableColumn.' = ?'; |
|
693 | 693 | |
694 | 694 | if (isset($mapping['relationToTargetKeyColumns'][$joinTableColumn])) { |
695 | 695 | $targetColumn = $mapping['relationToTargetKeyColumns'][$joinTableColumn]; |
@@ -711,7 +711,7 @@ discard block |
||
711 | 711 | list($joinTargetEntitySQL, $filterSql) = $this->getFilterSql($filterMapping); |
712 | 712 | |
713 | 713 | if ($filterSql) { |
714 | - $quotedJoinTable .= ' ' . $joinTargetEntitySQL; |
|
714 | + $quotedJoinTable .= ' '.$joinTargetEntitySQL; |
|
715 | 715 | $whereClauses[] = $filterSql; |
716 | 716 | } |
717 | 717 | } |
@@ -760,10 +760,10 @@ discard block |
||
760 | 760 | $targetClass, |
761 | 761 | $this->platform |
762 | 762 | ); |
763 | - $orderBy[] = $field . ' ' . $direction; |
|
763 | + $orderBy[] = $field.' '.$direction; |
|
764 | 764 | } |
765 | 765 | |
766 | - return ' ORDER BY ' . implode(', ', $orderBy); |
|
766 | + return ' ORDER BY '.implode(', ', $orderBy); |
|
767 | 767 | } |
768 | 768 | return ''; |
769 | 769 | } |