@@ -1299,7 +1299,7 @@ discard block |
||
1299 | 1299 | |
1300 | 1300 | $lines[] = $this->generateAssociationMappingPropertyDocBlock($associationMapping, $metadata); |
1301 | 1301 | $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $associationMapping['fieldName'] |
1302 | - . ($associationMapping['type'] == 'manyToMany' ? ' = array()' : null) . ";\n"; |
|
1302 | + . ($associationMapping['type'] == 'manyToMany' ? ' = array()' : null) . ";\n"; |
|
1303 | 1303 | } |
1304 | 1304 | |
1305 | 1305 | return implode("\n", $lines); |
@@ -1395,14 +1395,14 @@ discard block |
||
1395 | 1395 | } |
1396 | 1396 | |
1397 | 1397 | $replacements = [ |
1398 | - '<description>' => ucfirst($type) . ' ' . $variableName . '.', |
|
1399 | - '<methodTypeHint>' => $methodTypeHint, |
|
1400 | - '<variableType>' => $variableType . (null !== $defaultValue ? ('|' . $defaultValue) : ''), |
|
1401 | - '<variableName>' => $variableName, |
|
1402 | - '<methodName>' => $methodName, |
|
1403 | - '<fieldName>' => $fieldName, |
|
1404 | - '<variableDefault>' => ($defaultValue !== null ) ? (' = ' . $defaultValue) : '', |
|
1405 | - '<entity>' => $this->getClassName($metadata) |
|
1398 | + '<description>' => ucfirst($type) . ' ' . $variableName . '.', |
|
1399 | + '<methodTypeHint>' => $methodTypeHint, |
|
1400 | + '<variableType>' => $variableType . (null !== $defaultValue ? ('|' . $defaultValue) : ''), |
|
1401 | + '<variableName>' => $variableName, |
|
1402 | + '<methodName>' => $methodName, |
|
1403 | + '<fieldName>' => $fieldName, |
|
1404 | + '<variableDefault>' => ($defaultValue !== null ) ? (' = ' . $defaultValue) : '', |
|
1405 | + '<entity>' => $this->getClassName($metadata) |
|
1406 | 1406 | ]; |
1407 | 1407 | |
1408 | 1408 | $method = str_replace( |
@@ -367,7 +367,7 @@ discard block |
||
367 | 367 | */ |
368 | 368 | public function writeEntityClass(ClassMetadataInfo $metadata, $outputDirectory) |
369 | 369 | { |
370 | - $path = $outputDirectory . '/' . str_replace('\\', DIRECTORY_SEPARATOR, $metadata->name) . $this->extension; |
|
370 | + $path = $outputDirectory.'/'.str_replace('\\', DIRECTORY_SEPARATOR, $metadata->name).$this->extension; |
|
371 | 371 | $dir = dirname($path); |
372 | 372 | |
373 | 373 | if ( ! is_dir($dir)) { |
@@ -383,8 +383,8 @@ discard block |
||
383 | 383 | } |
384 | 384 | |
385 | 385 | if ($this->backupExisting && file_exists($path)) { |
386 | - $backupPath = dirname($path) . DIRECTORY_SEPARATOR . basename($path) . "~"; |
|
387 | - if (!copy($path, $backupPath)) { |
|
386 | + $backupPath = dirname($path).DIRECTORY_SEPARATOR.basename($path)."~"; |
|
387 | + if ( ! copy($path, $backupPath)) { |
|
388 | 388 | throw new \RuntimeException("Attempt to backup overwritten entity file but copy operation failed."); |
389 | 389 | } |
390 | 390 | } |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | $body = str_replace('<spaces>', $this->spaces, $body); |
446 | 446 | $last = strrpos($currentCode, '}'); |
447 | 447 | |
448 | - return substr($currentCode, 0, $last) . $body . ($body ? "\n" : '') . "}\n"; |
|
448 | + return substr($currentCode, 0, $last).$body.($body ? "\n" : '')."}\n"; |
|
449 | 449 | } |
450 | 450 | |
451 | 451 | /** |
@@ -509,7 +509,7 @@ discard block |
||
509 | 509 | public function setFieldVisibility($visibility) |
510 | 510 | { |
511 | 511 | if ($visibility !== static::FIELD_VISIBLE_PRIVATE && $visibility !== static::FIELD_VISIBLE_PROTECTED) { |
512 | - throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): ' . $visibility); |
|
512 | + throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): '.$visibility); |
|
513 | 513 | } |
514 | 514 | |
515 | 515 | $this->fieldVisibility = $visibility; |
@@ -606,11 +606,11 @@ discard block |
||
606 | 606 | */ |
607 | 607 | protected function generateEntityNamespace(ClassMetadataInfo $metadata) |
608 | 608 | { |
609 | - if (! $this->hasNamespace($metadata)) { |
|
609 | + if ( ! $this->hasNamespace($metadata)) { |
|
610 | 610 | return ''; |
611 | 611 | } |
612 | 612 | |
613 | - return 'namespace ' . $this->getNamespace($metadata) .';'; |
|
613 | + return 'namespace '.$this->getNamespace($metadata).';'; |
|
614 | 614 | } |
615 | 615 | |
616 | 616 | /** |
@@ -618,7 +618,7 @@ discard block |
||
618 | 618 | */ |
619 | 619 | protected function generateEntityUse() |
620 | 620 | { |
621 | - if (! $this->generateAnnotations) { |
|
621 | + if ( ! $this->generateAnnotations) { |
|
622 | 622 | return ''; |
623 | 623 | } |
624 | 624 | |
@@ -632,8 +632,8 @@ discard block |
||
632 | 632 | */ |
633 | 633 | protected function generateEntityClassName(ClassMetadataInfo $metadata) |
634 | 634 | { |
635 | - return 'class ' . $this->getClassName($metadata) . |
|
636 | - ($this->extendsClass() ? ' extends ' . $this->getClassToExtendName() : null); |
|
635 | + return 'class '.$this->getClassName($metadata). |
|
636 | + ($this->extendsClass() ? ' extends '.$this->getClassToExtendName() : null); |
|
637 | 637 | } |
638 | 638 | |
639 | 639 | /** |
@@ -735,13 +735,13 @@ discard block |
||
735 | 735 | $fieldMappings = array_merge($requiredFields, $optionalFields); |
736 | 736 | |
737 | 737 | foreach ($metadata->embeddedClasses as $fieldName => $embeddedClass) { |
738 | - $paramType = '\\' . ltrim($embeddedClass['class'], '\\'); |
|
739 | - $paramVariable = '$' . $fieldName; |
|
738 | + $paramType = '\\'.ltrim($embeddedClass['class'], '\\'); |
|
739 | + $paramVariable = '$'.$fieldName; |
|
740 | 740 | |
741 | 741 | $paramTypes[] = $paramType; |
742 | 742 | $paramVariables[] = $paramVariable; |
743 | - $params[] = $paramType . ' ' . $paramVariable; |
|
744 | - $fields[] = '$this->' . $fieldName . ' = ' . $paramVariable . ';'; |
|
743 | + $params[] = $paramType.' '.$paramVariable; |
|
744 | + $fields[] = '$this->'.$fieldName.' = '.$paramVariable.';'; |
|
745 | 745 | } |
746 | 746 | |
747 | 747 | foreach ($fieldMappings as $fieldMapping) { |
@@ -749,27 +749,27 @@ discard block |
||
749 | 749 | continue; |
750 | 750 | } |
751 | 751 | |
752 | - $paramTypes[] = $this->getType($fieldMapping['type']) . (!empty($fieldMapping['nullable']) ? '|null' : ''); |
|
753 | - $param = '$' . $fieldMapping['fieldName']; |
|
752 | + $paramTypes[] = $this->getType($fieldMapping['type']).( ! empty($fieldMapping['nullable']) ? '|null' : ''); |
|
753 | + $param = '$'.$fieldMapping['fieldName']; |
|
754 | 754 | $paramVariables[] = $param; |
755 | 755 | |
756 | 756 | if ($fieldMapping['type'] === 'datetime') { |
757 | - $param = $this->getType($fieldMapping['type']) . ' ' . $param; |
|
757 | + $param = $this->getType($fieldMapping['type']).' '.$param; |
|
758 | 758 | } |
759 | 759 | |
760 | - if (!empty($fieldMapping['nullable'])) { |
|
760 | + if ( ! empty($fieldMapping['nullable'])) { |
|
761 | 761 | $param .= ' = null'; |
762 | 762 | } |
763 | 763 | |
764 | 764 | $params[] = $param; |
765 | 765 | |
766 | - $fields[] = '$this->' . $fieldMapping['fieldName'] . ' = $' . $fieldMapping['fieldName'] . ';'; |
|
766 | + $fields[] = '$this->'.$fieldMapping['fieldName'].' = $'.$fieldMapping['fieldName'].';'; |
|
767 | 767 | } |
768 | 768 | |
769 | 769 | $maxParamTypeLength = max(array_map('strlen', $paramTypes)); |
770 | 770 | $paramTags = array_map( |
771 | - function ($type, $variable) use ($maxParamTypeLength) { |
|
772 | - return '@param ' . $type . str_repeat(' ', $maxParamTypeLength - strlen($type) + 1) . $variable; |
|
771 | + function($type, $variable) use ($maxParamTypeLength) { |
|
772 | + return '@param '.$type.str_repeat(' ', $maxParamTypeLength - strlen($type) + 1).$variable; |
|
773 | 773 | }, |
774 | 774 | $paramTypes, |
775 | 775 | $paramVariables |
@@ -777,8 +777,8 @@ discard block |
||
777 | 777 | |
778 | 778 | // Generate multi line constructor if the signature exceeds 120 characters. |
779 | 779 | if (array_sum(array_map('strlen', $params)) + count($params) * 2 + 29 > 120) { |
780 | - $delimiter = "\n" . $this->spaces; |
|
781 | - $params = $delimiter . implode(',' . $delimiter, $params) . "\n"; |
|
780 | + $delimiter = "\n".$this->spaces; |
|
781 | + $params = $delimiter.implode(','.$delimiter, $params)."\n"; |
|
782 | 782 | } else { |
783 | 783 | $params = implode(', ', $params); |
784 | 784 | } |
@@ -786,7 +786,7 @@ discard block |
||
786 | 786 | $replacements = [ |
787 | 787 | '<paramTags>' => implode("\n * ", $paramTags), |
788 | 788 | '<params>' => $params, |
789 | - '<fields>' => implode("\n" . $this->spaces, $fields), |
|
789 | + '<fields>' => implode("\n".$this->spaces, $fields), |
|
790 | 790 | ]; |
791 | 791 | |
792 | 792 | $constructor = str_replace( |
@@ -831,7 +831,7 @@ discard block |
||
831 | 831 | |
832 | 832 | if ($inClass) { |
833 | 833 | $inClass = false; |
834 | - $lastSeenClass = $lastSeenNamespace . ($lastSeenNamespace ? '\\' : '') . $token[1]; |
|
834 | + $lastSeenClass = $lastSeenNamespace.($lastSeenNamespace ? '\\' : '').$token[1]; |
|
835 | 835 | $this->staticReflection[$lastSeenClass]['properties'] = []; |
836 | 836 | $this->staticReflection[$lastSeenClass]['methods'] = []; |
837 | 837 | } |
@@ -839,16 +839,16 @@ discard block |
||
839 | 839 | if (T_NAMESPACE === $token[0]) { |
840 | 840 | $lastSeenNamespace = ''; |
841 | 841 | $inNamespace = true; |
842 | - } elseif (T_CLASS === $token[0] && T_DOUBLE_COLON !== $tokens[$i-1][0]) { |
|
842 | + } elseif (T_CLASS === $token[0] && T_DOUBLE_COLON !== $tokens[$i - 1][0]) { |
|
843 | 843 | $inClass = true; |
844 | 844 | } elseif (T_FUNCTION === $token[0]) { |
845 | - if (T_STRING === $tokens[$i+2][0]) { |
|
846 | - $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+2][1]); |
|
847 | - } elseif ($tokens[$i+2] == '&' && T_STRING === $tokens[$i+3][0]) { |
|
848 | - $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+3][1]); |
|
845 | + if (T_STRING === $tokens[$i + 2][0]) { |
|
846 | + $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 2][1]); |
|
847 | + } elseif ($tokens[$i + 2] == '&' && T_STRING === $tokens[$i + 3][0]) { |
|
848 | + $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 3][1]); |
|
849 | 849 | } |
850 | - } elseif (in_array($token[0], [T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED], true) && T_FUNCTION !== $tokens[$i+2][0]) { |
|
851 | - $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i+2][1], 1); |
|
850 | + } elseif (in_array($token[0], [T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED], true) && T_FUNCTION !== $tokens[$i + 2][0]) { |
|
851 | + $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i + 2][1], 1); |
|
852 | 852 | } |
853 | 853 | } |
854 | 854 | } |
@@ -861,7 +861,7 @@ discard block |
||
861 | 861 | */ |
862 | 862 | protected function hasProperty($property, ClassMetadataInfo $metadata) |
863 | 863 | { |
864 | - if ($this->extendsClass() || (!$this->isNew && class_exists($metadata->name))) { |
|
864 | + if ($this->extendsClass() || ( ! $this->isNew && class_exists($metadata->name))) { |
|
865 | 865 | // don't generate property if its already on the base class. |
866 | 866 | $reflClass = new \ReflectionClass($this->getClassToExtend() ?: $metadata->name); |
867 | 867 | if ($reflClass->hasProperty($property)) { |
@@ -890,7 +890,7 @@ discard block |
||
890 | 890 | */ |
891 | 891 | protected function hasMethod($method, ClassMetadataInfo $metadata) |
892 | 892 | { |
893 | - if ($this->extendsClass() || (!$this->isNew && class_exists($metadata->name))) { |
|
893 | + if ($this->extendsClass() || ( ! $this->isNew && class_exists($metadata->name))) { |
|
894 | 894 | // don't generate method if its already on the base class. |
895 | 895 | $reflClass = new \ReflectionClass($this->getClassToExtend() ?: $metadata->name); |
896 | 896 | |
@@ -921,7 +921,7 @@ discard block |
||
921 | 921 | */ |
922 | 922 | protected function getTraits(ClassMetadataInfo $metadata) |
923 | 923 | { |
924 | - if (! ($metadata->reflClass !== null || class_exists($metadata->name))) { |
|
924 | + if ( ! ($metadata->reflClass !== null || class_exists($metadata->name))) { |
|
925 | 925 | return []; |
926 | 926 | } |
927 | 927 | |
@@ -971,7 +971,7 @@ discard block |
||
971 | 971 | { |
972 | 972 | $refl = new \ReflectionClass($this->getClassToExtend()); |
973 | 973 | |
974 | - return '\\' . $refl->getName(); |
|
974 | + return '\\'.$refl->getName(); |
|
975 | 975 | } |
976 | 976 | |
977 | 977 | /** |
@@ -1004,7 +1004,7 @@ discard block |
||
1004 | 1004 | { |
1005 | 1005 | $lines = []; |
1006 | 1006 | $lines[] = '/**'; |
1007 | - $lines[] = ' * ' . $this->getClassName($metadata); |
|
1007 | + $lines[] = ' * '.$this->getClassName($metadata); |
|
1008 | 1008 | |
1009 | 1009 | if ($this->generateAnnotations) { |
1010 | 1010 | $lines[] = ' *'; |
@@ -1020,12 +1020,12 @@ discard block |
||
1020 | 1020 | |
1021 | 1021 | foreach ($methods as $method) { |
1022 | 1022 | if ($code = $this->$method($metadata)) { |
1023 | - $lines[] = ' * ' . $code; |
|
1023 | + $lines[] = ' * '.$code; |
|
1024 | 1024 | } |
1025 | 1025 | } |
1026 | 1026 | |
1027 | 1027 | if (isset($metadata->lifecycleCallbacks) && $metadata->lifecycleCallbacks) { |
1028 | - $lines[] = ' * @' . $this->annotationsPrefix . 'HasLifecycleCallbacks'; |
|
1028 | + $lines[] = ' * @'.$this->annotationsPrefix.'HasLifecycleCallbacks'; |
|
1029 | 1029 | } |
1030 | 1030 | } |
1031 | 1031 | |
@@ -1041,17 +1041,17 @@ discard block |
||
1041 | 1041 | */ |
1042 | 1042 | protected function generateEntityAnnotation(ClassMetadataInfo $metadata) |
1043 | 1043 | { |
1044 | - $prefix = '@' . $this->annotationsPrefix; |
|
1044 | + $prefix = '@'.$this->annotationsPrefix; |
|
1045 | 1045 | |
1046 | 1046 | if ($metadata->isEmbeddedClass) { |
1047 | - return $prefix . 'Embeddable'; |
|
1047 | + return $prefix.'Embeddable'; |
|
1048 | 1048 | } |
1049 | 1049 | |
1050 | 1050 | $customRepository = $metadata->customRepositoryClassName |
1051 | - ? '(repositoryClass="' . $metadata->customRepositoryClassName . '")' |
|
1051 | + ? '(repositoryClass="'.$metadata->customRepositoryClassName.'")' |
|
1052 | 1052 | : ''; |
1053 | 1053 | |
1054 | - return $prefix . ($metadata->isMappedSuperclass ? 'MappedSuperclass' : 'Entity') . $customRepository; |
|
1054 | + return $prefix.($metadata->isMappedSuperclass ? 'MappedSuperclass' : 'Entity').$customRepository; |
|
1055 | 1055 | } |
1056 | 1056 | |
1057 | 1057 | /** |
@@ -1068,28 +1068,28 @@ discard block |
||
1068 | 1068 | $table = []; |
1069 | 1069 | |
1070 | 1070 | if (isset($metadata->table['schema'])) { |
1071 | - $table[] = 'schema="' . $metadata->table['schema'] . '"'; |
|
1071 | + $table[] = 'schema="'.$metadata->table['schema'].'"'; |
|
1072 | 1072 | } |
1073 | 1073 | |
1074 | 1074 | if (isset($metadata->table['name'])) { |
1075 | - $table[] = 'name="' . $metadata->table['name'] . '"'; |
|
1075 | + $table[] = 'name="'.$metadata->table['name'].'"'; |
|
1076 | 1076 | } |
1077 | 1077 | |
1078 | 1078 | if (isset($metadata->table['options']) && $metadata->table['options']) { |
1079 | - $table[] = 'options={' . $this->exportTableOptions((array) $metadata->table['options']) . '}'; |
|
1079 | + $table[] = 'options={'.$this->exportTableOptions((array) $metadata->table['options']).'}'; |
|
1080 | 1080 | } |
1081 | 1081 | |
1082 | 1082 | if (isset($metadata->table['uniqueConstraints']) && $metadata->table['uniqueConstraints']) { |
1083 | 1083 | $constraints = $this->generateTableConstraints('UniqueConstraint', $metadata->table['uniqueConstraints']); |
1084 | - $table[] = 'uniqueConstraints={' . $constraints . '}'; |
|
1084 | + $table[] = 'uniqueConstraints={'.$constraints.'}'; |
|
1085 | 1085 | } |
1086 | 1086 | |
1087 | 1087 | if (isset($metadata->table['indexes']) && $metadata->table['indexes']) { |
1088 | 1088 | $constraints = $this->generateTableConstraints('Index', $metadata->table['indexes']); |
1089 | - $table[] = 'indexes={' . $constraints . '}'; |
|
1089 | + $table[] = 'indexes={'.$constraints.'}'; |
|
1090 | 1090 | } |
1091 | 1091 | |
1092 | - return '@' . $this->annotationsPrefix . 'Table(' . implode(', ', $table) . ')'; |
|
1092 | + return '@'.$this->annotationsPrefix.'Table('.implode(', ', $table).')'; |
|
1093 | 1093 | } |
1094 | 1094 | |
1095 | 1095 | /** |
@@ -1104,9 +1104,9 @@ discard block |
||
1104 | 1104 | foreach ($constraints as $name => $constraint) { |
1105 | 1105 | $columns = []; |
1106 | 1106 | foreach ($constraint['columns'] as $column) { |
1107 | - $columns[] = '"' . $column . '"'; |
|
1107 | + $columns[] = '"'.$column.'"'; |
|
1108 | 1108 | } |
1109 | - $annotations[] = '@' . $this->annotationsPrefix . $constraintName . '(name="' . $name . '", columns={' . implode(', ', $columns) . '})'; |
|
1109 | + $annotations[] = '@'.$this->annotationsPrefix.$constraintName.'(name="'.$name.'", columns={'.implode(', ', $columns).'})'; |
|
1110 | 1110 | } |
1111 | 1111 | |
1112 | 1112 | return implode(', ', $annotations); |
@@ -1123,7 +1123,7 @@ discard block |
||
1123 | 1123 | return ''; |
1124 | 1124 | } |
1125 | 1125 | |
1126 | - return '@' . $this->annotationsPrefix . 'InheritanceType("'.$this->getInheritanceTypeString($metadata->inheritanceType).'")'; |
|
1126 | + return '@'.$this->annotationsPrefix.'InheritanceType("'.$this->getInheritanceTypeString($metadata->inheritanceType).'")'; |
|
1127 | 1127 | } |
1128 | 1128 | |
1129 | 1129 | /** |
@@ -1138,11 +1138,11 @@ discard block |
||
1138 | 1138 | } |
1139 | 1139 | |
1140 | 1140 | $discrColumn = $metadata->discriminatorColumn; |
1141 | - $columnDefinition = 'name="' . $discrColumn['name'] |
|
1142 | - . '", type="' . $discrColumn['type'] |
|
1143 | - . '", length=' . $discrColumn['length']; |
|
1141 | + $columnDefinition = 'name="'.$discrColumn['name'] |
|
1142 | + . '", type="'.$discrColumn['type'] |
|
1143 | + . '", length='.$discrColumn['length']; |
|
1144 | 1144 | |
1145 | - return '@' . $this->annotationsPrefix . 'DiscriminatorColumn(' . $columnDefinition . ')'; |
|
1145 | + return '@'.$this->annotationsPrefix.'DiscriminatorColumn('.$columnDefinition.')'; |
|
1146 | 1146 | } |
1147 | 1147 | |
1148 | 1148 | /** |
@@ -1159,10 +1159,10 @@ discard block |
||
1159 | 1159 | $inheritanceClassMap = []; |
1160 | 1160 | |
1161 | 1161 | foreach ($metadata->discriminatorMap as $type => $class) { |
1162 | - $inheritanceClassMap[] .= '"' . $type . '" = "' . $class . '"'; |
|
1162 | + $inheritanceClassMap[] .= '"'.$type.'" = "'.$class.'"'; |
|
1163 | 1163 | } |
1164 | 1164 | |
1165 | - return '@' . $this->annotationsPrefix . 'DiscriminatorMap({' . implode(', ', $inheritanceClassMap) . '})'; |
|
1165 | + return '@'.$this->annotationsPrefix.'DiscriminatorMap({'.implode(', ', $inheritanceClassMap).'})'; |
|
1166 | 1166 | } |
1167 | 1167 | |
1168 | 1168 | /** |
@@ -1181,8 +1181,8 @@ discard block |
||
1181 | 1181 | |
1182 | 1182 | $nullableField = $this->nullableFieldExpression($fieldMapping); |
1183 | 1183 | |
1184 | - if ((!$metadata->isEmbeddedClass || !$this->embeddablesImmutable) |
|
1185 | - && (!isset($fieldMapping['id']) || ! $fieldMapping['id'] || $metadata->generatorType === ClassMetadataInfo::GENERATOR_TYPE_NONE) |
|
1184 | + if (( ! $metadata->isEmbeddedClass || ! $this->embeddablesImmutable) |
|
1185 | + && ( ! isset($fieldMapping['id']) || ! $fieldMapping['id'] || $metadata->generatorType === ClassMetadataInfo::GENERATOR_TYPE_NONE) |
|
1186 | 1186 | && $code = $this->generateEntityStubMethod($metadata, 'set', $fieldMapping['fieldName'], $fieldMapping['type'], $nullableField) |
1187 | 1187 | ) { |
1188 | 1188 | $methods[] = $code; |
@@ -1253,7 +1253,7 @@ discard block |
||
1253 | 1253 | } |
1254 | 1254 | |
1255 | 1255 | foreach ($joinColumns as $joinColumn) { |
1256 | - if (isset($joinColumn['nullable']) && !$joinColumn['nullable']) { |
|
1256 | + if (isset($joinColumn['nullable']) && ! $joinColumn['nullable']) { |
|
1257 | 1257 | return false; |
1258 | 1258 | } |
1259 | 1259 | } |
@@ -1298,8 +1298,8 @@ discard block |
||
1298 | 1298 | } |
1299 | 1299 | |
1300 | 1300 | $lines[] = $this->generateAssociationMappingPropertyDocBlock($associationMapping, $metadata); |
1301 | - $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $associationMapping['fieldName'] |
|
1302 | - . ($associationMapping['type'] == 'manyToMany' ? ' = array()' : null) . ";\n"; |
|
1301 | + $lines[] = $this->spaces.$this->fieldVisibility.' $'.$associationMapping['fieldName'] |
|
1302 | + . ($associationMapping['type'] == 'manyToMany' ? ' = array()' : null).";\n"; |
|
1303 | 1303 | } |
1304 | 1304 | |
1305 | 1305 | return implode("\n", $lines); |
@@ -1327,12 +1327,12 @@ discard block |
||
1327 | 1327 | if ($fieldMapping['type'] === 'boolean' && $fieldMapping['options']['default'] === '1') { |
1328 | 1328 | $defaultValue = " = true"; |
1329 | 1329 | } else { |
1330 | - $defaultValue = ' = ' . var_export($fieldMapping['options']['default'], true); |
|
1330 | + $defaultValue = ' = '.var_export($fieldMapping['options']['default'], true); |
|
1331 | 1331 | } |
1332 | 1332 | } |
1333 | 1333 | |
1334 | 1334 | $lines[] = $this->generateFieldMappingPropertyDocBlock($fieldMapping, $metadata); |
1335 | - $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $fieldMapping['fieldName'] . $defaultValue . ";\n"; |
|
1335 | + $lines[] = $this->spaces.$this->fieldVisibility.' $'.$fieldMapping['fieldName'].$defaultValue.";\n"; |
|
1336 | 1336 | } |
1337 | 1337 | |
1338 | 1338 | return implode("\n", $lines); |
@@ -1353,7 +1353,7 @@ discard block |
||
1353 | 1353 | } |
1354 | 1354 | |
1355 | 1355 | $lines[] = $this->generateEmbeddedPropertyDocBlock($embeddedClass); |
1356 | - $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $fieldName . ";\n"; |
|
1356 | + $lines[] = $this->spaces.$this->fieldVisibility.' $'.$fieldName.";\n"; |
|
1357 | 1357 | } |
1358 | 1358 | |
1359 | 1359 | return implode("\n", $lines); |
@@ -1370,7 +1370,7 @@ discard block |
||
1370 | 1370 | */ |
1371 | 1371 | protected function generateEntityStubMethod(ClassMetadataInfo $metadata, $type, $fieldName, $typeHint = null, $defaultValue = null) |
1372 | 1372 | { |
1373 | - $methodName = $type . Inflector::classify($fieldName); |
|
1373 | + $methodName = $type.Inflector::classify($fieldName); |
|
1374 | 1374 | $variableName = Inflector::camelize($fieldName); |
1375 | 1375 | if (in_array($type, ["add", "remove"])) { |
1376 | 1376 | $methodName = Inflector::singularize($methodName); |
@@ -1390,18 +1390,18 @@ discard block |
||
1390 | 1390 | $variableType = $typeHint ? $this->getType($typeHint) : null; |
1391 | 1391 | |
1392 | 1392 | if ($typeHint && ! isset($types[$typeHint])) { |
1393 | - $variableType = '\\' . ltrim($variableType, '\\'); |
|
1394 | - $methodTypeHint = '\\' . $typeHint . ' '; |
|
1393 | + $variableType = '\\'.ltrim($variableType, '\\'); |
|
1394 | + $methodTypeHint = '\\'.$typeHint.' '; |
|
1395 | 1395 | } |
1396 | 1396 | |
1397 | 1397 | $replacements = [ |
1398 | - '<description>' => ucfirst($type) . ' ' . $variableName . '.', |
|
1398 | + '<description>' => ucfirst($type).' '.$variableName.'.', |
|
1399 | 1399 | '<methodTypeHint>' => $methodTypeHint, |
1400 | - '<variableType>' => $variableType . (null !== $defaultValue ? ('|' . $defaultValue) : ''), |
|
1400 | + '<variableType>' => $variableType.(null !== $defaultValue ? ('|'.$defaultValue) : ''), |
|
1401 | 1401 | '<variableName>' => $variableName, |
1402 | 1402 | '<methodName>' => $methodName, |
1403 | 1403 | '<fieldName>' => $fieldName, |
1404 | - '<variableDefault>' => ($defaultValue !== null ) ? (' = ' . $defaultValue) : '', |
|
1404 | + '<variableDefault>' => ($defaultValue !== null) ? (' = '.$defaultValue) : '', |
|
1405 | 1405 | '<entity>' => $this->getClassName($metadata) |
1406 | 1406 | ]; |
1407 | 1407 | |
@@ -1430,7 +1430,7 @@ discard block |
||
1430 | 1430 | $this->staticReflection[$metadata->name]['methods'][] = $methodName; |
1431 | 1431 | |
1432 | 1432 | $replacements = [ |
1433 | - '<name>' => $this->annotationsPrefix . ucfirst($name), |
|
1433 | + '<name>' => $this->annotationsPrefix.ucfirst($name), |
|
1434 | 1434 | '<methodName>' => $methodName, |
1435 | 1435 | ]; |
1436 | 1436 | |
@@ -1453,30 +1453,30 @@ discard block |
||
1453 | 1453 | $joinColumnAnnot = []; |
1454 | 1454 | |
1455 | 1455 | if (isset($joinColumn['name'])) { |
1456 | - $joinColumnAnnot[] = 'name="' . $joinColumn['name'] . '"'; |
|
1456 | + $joinColumnAnnot[] = 'name="'.$joinColumn['name'].'"'; |
|
1457 | 1457 | } |
1458 | 1458 | |
1459 | 1459 | if (isset($joinColumn['referencedColumnName'])) { |
1460 | - $joinColumnAnnot[] = 'referencedColumnName="' . $joinColumn['referencedColumnName'] . '"'; |
|
1460 | + $joinColumnAnnot[] = 'referencedColumnName="'.$joinColumn['referencedColumnName'].'"'; |
|
1461 | 1461 | } |
1462 | 1462 | |
1463 | 1463 | if (isset($joinColumn['unique']) && $joinColumn['unique']) { |
1464 | - $joinColumnAnnot[] = 'unique=' . ($joinColumn['unique'] ? 'true' : 'false'); |
|
1464 | + $joinColumnAnnot[] = 'unique='.($joinColumn['unique'] ? 'true' : 'false'); |
|
1465 | 1465 | } |
1466 | 1466 | |
1467 | 1467 | if (isset($joinColumn['nullable'])) { |
1468 | - $joinColumnAnnot[] = 'nullable=' . ($joinColumn['nullable'] ? 'true' : 'false'); |
|
1468 | + $joinColumnAnnot[] = 'nullable='.($joinColumn['nullable'] ? 'true' : 'false'); |
|
1469 | 1469 | } |
1470 | 1470 | |
1471 | 1471 | if (isset($joinColumn['onDelete'])) { |
1472 | - $joinColumnAnnot[] = 'onDelete="' . ($joinColumn['onDelete'] . '"'); |
|
1472 | + $joinColumnAnnot[] = 'onDelete="'.($joinColumn['onDelete'].'"'); |
|
1473 | 1473 | } |
1474 | 1474 | |
1475 | 1475 | if (isset($joinColumn['columnDefinition'])) { |
1476 | - $joinColumnAnnot[] = 'columnDefinition="' . $joinColumn['columnDefinition'] . '"'; |
|
1476 | + $joinColumnAnnot[] = 'columnDefinition="'.$joinColumn['columnDefinition'].'"'; |
|
1477 | 1477 | } |
1478 | 1478 | |
1479 | - return '@' . $this->annotationsPrefix . 'JoinColumn(' . implode(', ', $joinColumnAnnot) . ')'; |
|
1479 | + return '@'.$this->annotationsPrefix.'JoinColumn('.implode(', ', $joinColumnAnnot).')'; |
|
1480 | 1480 | } |
1481 | 1481 | |
1482 | 1482 | /** |
@@ -1488,22 +1488,22 @@ discard block |
||
1488 | 1488 | protected function generateAssociationMappingPropertyDocBlock(array $associationMapping, ClassMetadataInfo $metadata) |
1489 | 1489 | { |
1490 | 1490 | $lines = []; |
1491 | - $lines[] = $this->spaces . '/**'; |
|
1491 | + $lines[] = $this->spaces.'/**'; |
|
1492 | 1492 | |
1493 | 1493 | if ($associationMapping['type'] & ClassMetadataInfo::TO_MANY) { |
1494 | - $lines[] = $this->spaces . ' * @var \Doctrine\Common\Collections\Collection'; |
|
1494 | + $lines[] = $this->spaces.' * @var \Doctrine\Common\Collections\Collection'; |
|
1495 | 1495 | } else { |
1496 | - $lines[] = $this->spaces . ' * @var \\' . ltrim($associationMapping['targetEntity'], '\\'); |
|
1496 | + $lines[] = $this->spaces.' * @var \\'.ltrim($associationMapping['targetEntity'], '\\'); |
|
1497 | 1497 | } |
1498 | 1498 | |
1499 | 1499 | if ($this->generateAnnotations) { |
1500 | - $lines[] = $this->spaces . ' *'; |
|
1500 | + $lines[] = $this->spaces.' *'; |
|
1501 | 1501 | |
1502 | 1502 | if (isset($associationMapping['id']) && $associationMapping['id']) { |
1503 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Id'; |
|
1503 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Id'; |
|
1504 | 1504 | |
1505 | 1505 | if ($generatorType = $this->getIdGeneratorTypeString($metadata->generatorType)) { |
1506 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'GeneratedValue(strategy="' . $generatorType . '")'; |
|
1506 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'GeneratedValue(strategy="'.$generatorType.'")'; |
|
1507 | 1507 | } |
1508 | 1508 | } |
1509 | 1509 | |
@@ -1525,15 +1525,15 @@ discard block |
||
1525 | 1525 | $typeOptions = []; |
1526 | 1526 | |
1527 | 1527 | if (isset($associationMapping['targetEntity'])) { |
1528 | - $typeOptions[] = 'targetEntity="' . $associationMapping['targetEntity'] . '"'; |
|
1528 | + $typeOptions[] = 'targetEntity="'.$associationMapping['targetEntity'].'"'; |
|
1529 | 1529 | } |
1530 | 1530 | |
1531 | 1531 | if (isset($associationMapping['inversedBy'])) { |
1532 | - $typeOptions[] = 'inversedBy="' . $associationMapping['inversedBy'] . '"'; |
|
1532 | + $typeOptions[] = 'inversedBy="'.$associationMapping['inversedBy'].'"'; |
|
1533 | 1533 | } |
1534 | 1534 | |
1535 | 1535 | if (isset($associationMapping['mappedBy'])) { |
1536 | - $typeOptions[] = 'mappedBy="' . $associationMapping['mappedBy'] . '"'; |
|
1536 | + $typeOptions[] = 'mappedBy="'.$associationMapping['mappedBy'].'"'; |
|
1537 | 1537 | } |
1538 | 1538 | |
1539 | 1539 | if ($associationMapping['cascade']) { |
@@ -1549,11 +1549,11 @@ discard block |
||
1549 | 1549 | $cascades = ['"all"']; |
1550 | 1550 | } |
1551 | 1551 | |
1552 | - $typeOptions[] = 'cascade={' . implode(',', $cascades) . '}'; |
|
1552 | + $typeOptions[] = 'cascade={'.implode(',', $cascades).'}'; |
|
1553 | 1553 | } |
1554 | 1554 | |
1555 | 1555 | if (isset($associationMapping['orphanRemoval']) && $associationMapping['orphanRemoval']) { |
1556 | - $typeOptions[] = 'orphanRemoval=' . ($associationMapping['orphanRemoval'] ? 'true' : 'false'); |
|
1556 | + $typeOptions[] = 'orphanRemoval='.($associationMapping['orphanRemoval'] ? 'true' : 'false'); |
|
1557 | 1557 | } |
1558 | 1558 | |
1559 | 1559 | if (isset($associationMapping['fetch']) && $associationMapping['fetch'] !== ClassMetadataInfo::FETCH_LAZY) { |
@@ -1562,71 +1562,71 @@ discard block |
||
1562 | 1562 | ClassMetadataInfo::FETCH_EAGER => 'EAGER', |
1563 | 1563 | ]; |
1564 | 1564 | |
1565 | - $typeOptions[] = 'fetch="' . $fetchMap[$associationMapping['fetch']] . '"'; |
|
1565 | + $typeOptions[] = 'fetch="'.$fetchMap[$associationMapping['fetch']].'"'; |
|
1566 | 1566 | } |
1567 | 1567 | |
1568 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . '' . $type . '(' . implode(', ', $typeOptions) . ')'; |
|
1568 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.''.$type.'('.implode(', ', $typeOptions).')'; |
|
1569 | 1569 | |
1570 | 1570 | if (isset($associationMapping['joinColumns']) && $associationMapping['joinColumns']) { |
1571 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'JoinColumns({'; |
|
1571 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'JoinColumns({'; |
|
1572 | 1572 | |
1573 | 1573 | $joinColumnsLines = []; |
1574 | 1574 | |
1575 | 1575 | foreach ($associationMapping['joinColumns'] as $joinColumn) { |
1576 | 1576 | if ($joinColumnAnnot = $this->generateJoinColumnAnnotation($joinColumn)) { |
1577 | - $joinColumnsLines[] = $this->spaces . ' * ' . $joinColumnAnnot; |
|
1577 | + $joinColumnsLines[] = $this->spaces.' * '.$joinColumnAnnot; |
|
1578 | 1578 | } |
1579 | 1579 | } |
1580 | 1580 | |
1581 | 1581 | $lines[] = implode(",\n", $joinColumnsLines); |
1582 | - $lines[] = $this->spaces . ' * })'; |
|
1582 | + $lines[] = $this->spaces.' * })'; |
|
1583 | 1583 | } |
1584 | 1584 | |
1585 | 1585 | if (isset($associationMapping['joinTable']) && $associationMapping['joinTable']) { |
1586 | 1586 | $joinTable = []; |
1587 | - $joinTable[] = 'name="' . $associationMapping['joinTable']['name'] . '"'; |
|
1587 | + $joinTable[] = 'name="'.$associationMapping['joinTable']['name'].'"'; |
|
1588 | 1588 | |
1589 | 1589 | if (isset($associationMapping['joinTable']['schema'])) { |
1590 | - $joinTable[] = 'schema="' . $associationMapping['joinTable']['schema'] . '"'; |
|
1590 | + $joinTable[] = 'schema="'.$associationMapping['joinTable']['schema'].'"'; |
|
1591 | 1591 | } |
1592 | 1592 | |
1593 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'JoinTable(' . implode(', ', $joinTable) . ','; |
|
1594 | - $lines[] = $this->spaces . ' * joinColumns={'; |
|
1593 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'JoinTable('.implode(', ', $joinTable).','; |
|
1594 | + $lines[] = $this->spaces.' * joinColumns={'; |
|
1595 | 1595 | |
1596 | 1596 | $joinColumnsLines = []; |
1597 | 1597 | |
1598 | 1598 | foreach ($associationMapping['joinTable']['joinColumns'] as $joinColumn) { |
1599 | - $joinColumnsLines[] = $this->spaces . ' * ' . $this->generateJoinColumnAnnotation($joinColumn); |
|
1599 | + $joinColumnsLines[] = $this->spaces.' * '.$this->generateJoinColumnAnnotation($joinColumn); |
|
1600 | 1600 | } |
1601 | 1601 | |
1602 | - $lines[] = implode(",". PHP_EOL, $joinColumnsLines); |
|
1603 | - $lines[] = $this->spaces . ' * },'; |
|
1604 | - $lines[] = $this->spaces . ' * inverseJoinColumns={'; |
|
1602 | + $lines[] = implode(",".PHP_EOL, $joinColumnsLines); |
|
1603 | + $lines[] = $this->spaces.' * },'; |
|
1604 | + $lines[] = $this->spaces.' * inverseJoinColumns={'; |
|
1605 | 1605 | |
1606 | 1606 | $inverseJoinColumnsLines = []; |
1607 | 1607 | |
1608 | 1608 | foreach ($associationMapping['joinTable']['inverseJoinColumns'] as $joinColumn) { |
1609 | - $inverseJoinColumnsLines[] = $this->spaces . ' * ' . $this->generateJoinColumnAnnotation($joinColumn); |
|
1609 | + $inverseJoinColumnsLines[] = $this->spaces.' * '.$this->generateJoinColumnAnnotation($joinColumn); |
|
1610 | 1610 | } |
1611 | 1611 | |
1612 | - $lines[] = implode(",". PHP_EOL, $inverseJoinColumnsLines); |
|
1613 | - $lines[] = $this->spaces . ' * }'; |
|
1614 | - $lines[] = $this->spaces . ' * )'; |
|
1612 | + $lines[] = implode(",".PHP_EOL, $inverseJoinColumnsLines); |
|
1613 | + $lines[] = $this->spaces.' * }'; |
|
1614 | + $lines[] = $this->spaces.' * )'; |
|
1615 | 1615 | } |
1616 | 1616 | |
1617 | 1617 | if (isset($associationMapping['orderBy'])) { |
1618 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'OrderBy({'; |
|
1618 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'OrderBy({'; |
|
1619 | 1619 | |
1620 | 1620 | foreach ($associationMapping['orderBy'] as $name => $direction) { |
1621 | - $lines[] = $this->spaces . ' * "' . $name . '"="' . $direction . '",'; |
|
1621 | + $lines[] = $this->spaces.' * "'.$name.'"="'.$direction.'",'; |
|
1622 | 1622 | } |
1623 | 1623 | |
1624 | 1624 | $lines[count($lines) - 1] = substr($lines[count($lines) - 1], 0, strlen($lines[count($lines) - 1]) - 1); |
1625 | - $lines[] = $this->spaces . ' * })'; |
|
1625 | + $lines[] = $this->spaces.' * })'; |
|
1626 | 1626 | } |
1627 | 1627 | } |
1628 | 1628 | |
1629 | - $lines[] = $this->spaces . ' */'; |
|
1629 | + $lines[] = $this->spaces.' */'; |
|
1630 | 1630 | |
1631 | 1631 | return implode("\n", $lines); |
1632 | 1632 | } |
@@ -1640,43 +1640,43 @@ discard block |
||
1640 | 1640 | protected function generateFieldMappingPropertyDocBlock(array $fieldMapping, ClassMetadataInfo $metadata) |
1641 | 1641 | { |
1642 | 1642 | $lines = []; |
1643 | - $lines[] = $this->spaces . '/**'; |
|
1644 | - $lines[] = $this->spaces . ' * @var ' |
|
1643 | + $lines[] = $this->spaces.'/**'; |
|
1644 | + $lines[] = $this->spaces.' * @var ' |
|
1645 | 1645 | . $this->getType($fieldMapping['type']) |
1646 | 1646 | . ($this->nullableFieldExpression($fieldMapping) ? '|null' : ''); |
1647 | 1647 | |
1648 | 1648 | if ($this->generateAnnotations) { |
1649 | - $lines[] = $this->spaces . ' *'; |
|
1649 | + $lines[] = $this->spaces.' *'; |
|
1650 | 1650 | |
1651 | 1651 | $column = []; |
1652 | 1652 | if (isset($fieldMapping['columnName'])) { |
1653 | - $column[] = 'name="' . $fieldMapping['columnName'] . '"'; |
|
1653 | + $column[] = 'name="'.$fieldMapping['columnName'].'"'; |
|
1654 | 1654 | } |
1655 | 1655 | |
1656 | 1656 | if (isset($fieldMapping['type'])) { |
1657 | - $column[] = 'type="' . $fieldMapping['type'] . '"'; |
|
1657 | + $column[] = 'type="'.$fieldMapping['type'].'"'; |
|
1658 | 1658 | } |
1659 | 1659 | |
1660 | 1660 | if (isset($fieldMapping['length'])) { |
1661 | - $column[] = 'length=' . $fieldMapping['length']; |
|
1661 | + $column[] = 'length='.$fieldMapping['length']; |
|
1662 | 1662 | } |
1663 | 1663 | |
1664 | 1664 | if (isset($fieldMapping['precision'])) { |
1665 | - $column[] = 'precision=' . $fieldMapping['precision']; |
|
1665 | + $column[] = 'precision='.$fieldMapping['precision']; |
|
1666 | 1666 | } |
1667 | 1667 | |
1668 | 1668 | if (isset($fieldMapping['scale'])) { |
1669 | - $column[] = 'scale=' . $fieldMapping['scale']; |
|
1669 | + $column[] = 'scale='.$fieldMapping['scale']; |
|
1670 | 1670 | } |
1671 | 1671 | |
1672 | 1672 | if (isset($fieldMapping['nullable'])) { |
1673 | - $column[] = 'nullable=' . var_export($fieldMapping['nullable'], true); |
|
1673 | + $column[] = 'nullable='.var_export($fieldMapping['nullable'], true); |
|
1674 | 1674 | } |
1675 | 1675 | |
1676 | 1676 | $options = []; |
1677 | 1677 | |
1678 | 1678 | if (isset($fieldMapping['options']['default']) && $fieldMapping['options']['default']) { |
1679 | - $options[] = '"default"="' . $fieldMapping['options']['default'] .'"'; |
|
1679 | + $options[] = '"default"="'.$fieldMapping['options']['default'].'"'; |
|
1680 | 1680 | } |
1681 | 1681 | |
1682 | 1682 | if (isset($fieldMapping['options']['unsigned']) && $fieldMapping['options']['unsigned']) { |
@@ -1688,15 +1688,15 @@ discard block |
||
1688 | 1688 | } |
1689 | 1689 | |
1690 | 1690 | if (isset($fieldMapping['options']['comment']) && $fieldMapping['options']['comment']) { |
1691 | - $options[] = '"comment"="' . str_replace('"', '""', $fieldMapping['options']['comment']) . '"'; |
|
1691 | + $options[] = '"comment"="'.str_replace('"', '""', $fieldMapping['options']['comment']).'"'; |
|
1692 | 1692 | } |
1693 | 1693 | |
1694 | 1694 | if (isset($fieldMapping['options']['collation']) && $fieldMapping['options']['collation']) { |
1695 | - $options[] = '"collation"="' . $fieldMapping['options']['collation'] .'"'; |
|
1695 | + $options[] = '"collation"="'.$fieldMapping['options']['collation'].'"'; |
|
1696 | 1696 | } |
1697 | 1697 | |
1698 | 1698 | if (isset($fieldMapping['options']['check']) && $fieldMapping['options']['check']) { |
1699 | - $options[] = '"check"="' . $fieldMapping['options']['check'] .'"'; |
|
1699 | + $options[] = '"check"="'.$fieldMapping['options']['check'].'"'; |
|
1700 | 1700 | } |
1701 | 1701 | |
1702 | 1702 | if ($options) { |
@@ -1704,47 +1704,47 @@ discard block |
||
1704 | 1704 | } |
1705 | 1705 | |
1706 | 1706 | if (isset($fieldMapping['columnDefinition'])) { |
1707 | - $column[] = 'columnDefinition="' . $fieldMapping['columnDefinition'] . '"'; |
|
1707 | + $column[] = 'columnDefinition="'.$fieldMapping['columnDefinition'].'"'; |
|
1708 | 1708 | } |
1709 | 1709 | |
1710 | 1710 | if (isset($fieldMapping['unique'])) { |
1711 | - $column[] = 'unique=' . var_export($fieldMapping['unique'], true); |
|
1711 | + $column[] = 'unique='.var_export($fieldMapping['unique'], true); |
|
1712 | 1712 | } |
1713 | 1713 | |
1714 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Column(' . implode(', ', $column) . ')'; |
|
1714 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Column('.implode(', ', $column).')'; |
|
1715 | 1715 | |
1716 | 1716 | if (isset($fieldMapping['id']) && $fieldMapping['id']) { |
1717 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Id'; |
|
1717 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Id'; |
|
1718 | 1718 | |
1719 | 1719 | if ($generatorType = $this->getIdGeneratorTypeString($metadata->generatorType)) { |
1720 | - $lines[] = $this->spaces.' * @' . $this->annotationsPrefix . 'GeneratedValue(strategy="' . $generatorType . '")'; |
|
1720 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'GeneratedValue(strategy="'.$generatorType.'")'; |
|
1721 | 1721 | } |
1722 | 1722 | |
1723 | 1723 | if ($metadata->sequenceGeneratorDefinition) { |
1724 | 1724 | $sequenceGenerator = []; |
1725 | 1725 | |
1726 | 1726 | if (isset($metadata->sequenceGeneratorDefinition['sequenceName'])) { |
1727 | - $sequenceGenerator[] = 'sequenceName="' . $metadata->sequenceGeneratorDefinition['sequenceName'] . '"'; |
|
1727 | + $sequenceGenerator[] = 'sequenceName="'.$metadata->sequenceGeneratorDefinition['sequenceName'].'"'; |
|
1728 | 1728 | } |
1729 | 1729 | |
1730 | 1730 | if (isset($metadata->sequenceGeneratorDefinition['allocationSize'])) { |
1731 | - $sequenceGenerator[] = 'allocationSize=' . $metadata->sequenceGeneratorDefinition['allocationSize']; |
|
1731 | + $sequenceGenerator[] = 'allocationSize='.$metadata->sequenceGeneratorDefinition['allocationSize']; |
|
1732 | 1732 | } |
1733 | 1733 | |
1734 | 1734 | if (isset($metadata->sequenceGeneratorDefinition['initialValue'])) { |
1735 | - $sequenceGenerator[] = 'initialValue=' . $metadata->sequenceGeneratorDefinition['initialValue']; |
|
1735 | + $sequenceGenerator[] = 'initialValue='.$metadata->sequenceGeneratorDefinition['initialValue']; |
|
1736 | 1736 | } |
1737 | 1737 | |
1738 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'SequenceGenerator(' . implode(', ', $sequenceGenerator) . ')'; |
|
1738 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'SequenceGenerator('.implode(', ', $sequenceGenerator).')'; |
|
1739 | 1739 | } |
1740 | 1740 | } |
1741 | 1741 | |
1742 | 1742 | if (isset($fieldMapping['version']) && $fieldMapping['version']) { |
1743 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Version'; |
|
1743 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Version'; |
|
1744 | 1744 | } |
1745 | 1745 | } |
1746 | 1746 | |
1747 | - $lines[] = $this->spaces . ' */'; |
|
1747 | + $lines[] = $this->spaces.' */'; |
|
1748 | 1748 | |
1749 | 1749 | return implode("\n", $lines); |
1750 | 1750 | } |
@@ -1757,27 +1757,27 @@ discard block |
||
1757 | 1757 | protected function generateEmbeddedPropertyDocBlock(array $embeddedClass) |
1758 | 1758 | { |
1759 | 1759 | $lines = []; |
1760 | - $lines[] = $this->spaces . '/**'; |
|
1761 | - $lines[] = $this->spaces . ' * @var \\' . ltrim($embeddedClass['class'], '\\'); |
|
1760 | + $lines[] = $this->spaces.'/**'; |
|
1761 | + $lines[] = $this->spaces.' * @var \\'.ltrim($embeddedClass['class'], '\\'); |
|
1762 | 1762 | |
1763 | 1763 | if ($this->generateAnnotations) { |
1764 | - $lines[] = $this->spaces . ' *'; |
|
1764 | + $lines[] = $this->spaces.' *'; |
|
1765 | 1765 | |
1766 | - $embedded = ['class="' . $embeddedClass['class'] . '"']; |
|
1766 | + $embedded = ['class="'.$embeddedClass['class'].'"']; |
|
1767 | 1767 | |
1768 | 1768 | if (isset($embeddedClass['columnPrefix'])) { |
1769 | 1769 | if (is_string($embeddedClass['columnPrefix'])) { |
1770 | - $embedded[] = 'columnPrefix="' . $embeddedClass['columnPrefix'] . '"'; |
|
1770 | + $embedded[] = 'columnPrefix="'.$embeddedClass['columnPrefix'].'"'; |
|
1771 | 1771 | } else { |
1772 | - $embedded[] = 'columnPrefix=' . var_export($embeddedClass['columnPrefix'], true); |
|
1772 | + $embedded[] = 'columnPrefix='.var_export($embeddedClass['columnPrefix'], true); |
|
1773 | 1773 | } |
1774 | 1774 | } |
1775 | 1775 | |
1776 | - $lines[] = $this->spaces . ' * @' . |
|
1777 | - $this->annotationsPrefix . 'Embedded(' . implode(', ', $embedded) . ')'; |
|
1776 | + $lines[] = $this->spaces.' * @'. |
|
1777 | + $this->annotationsPrefix.'Embedded('.implode(', ', $embedded).')'; |
|
1778 | 1778 | } |
1779 | 1779 | |
1780 | - $lines[] = $this->spaces . ' */'; |
|
1780 | + $lines[] = $this->spaces.' */'; |
|
1781 | 1781 | |
1782 | 1782 | return implode("\n", $lines); |
1783 | 1783 | } |
@@ -1791,13 +1791,13 @@ discard block |
||
1791 | 1791 | $processedClasses = []; |
1792 | 1792 | foreach ($metadata->entityListeners as $event => $eventListeners) { |
1793 | 1793 | foreach ($eventListeners as $eventListener) { |
1794 | - $processedClasses[] = '"' . $eventListener['class'] . '"'; |
|
1794 | + $processedClasses[] = '"'.$eventListener['class'].'"'; |
|
1795 | 1795 | } |
1796 | 1796 | } |
1797 | 1797 | |
1798 | 1798 | return \sprintf( |
1799 | 1799 | '%s%s({%s})', |
1800 | - '@' . $this->annotationsPrefix, |
|
1800 | + '@'.$this->annotationsPrefix, |
|
1801 | 1801 | 'EntityListeners', |
1802 | 1802 | \implode(',', \array_unique($processedClasses)) |
1803 | 1803 | ); |
@@ -1815,7 +1815,7 @@ discard block |
||
1815 | 1815 | |
1816 | 1816 | foreach ($lines as $key => $value) { |
1817 | 1817 | if ( ! empty($value)) { |
1818 | - $lines[$key] = str_repeat($this->spaces, $num) . $lines[$key]; |
|
1818 | + $lines[$key] = str_repeat($this->spaces, $num).$lines[$key]; |
|
1819 | 1819 | } |
1820 | 1820 | } |
1821 | 1821 | |
@@ -1897,9 +1897,9 @@ discard block |
||
1897 | 1897 | |
1898 | 1898 | foreach ($options as $name => $option) { |
1899 | 1899 | if (is_array($option)) { |
1900 | - $optionsStr[] = '"' . $name . '"={' . $this->exportTableOptions($option) . '}'; |
|
1900 | + $optionsStr[] = '"'.$name.'"={'.$this->exportTableOptions($option).'}'; |
|
1901 | 1901 | } else { |
1902 | - $optionsStr[] = '"' . $name . '"="' . (string) $option . '"'; |
|
1902 | + $optionsStr[] = '"'.$name.'"="'.(string) $option.'"'; |
|
1903 | 1903 | } |
1904 | 1904 | } |
1905 | 1905 |