@@ -364,14 +364,14 @@ discard block |
||
| 364 | 364 | */ |
| 365 | 365 | public function writeEntityClass(ClassMetadataInfo $metadata, $outputDirectory) |
| 366 | 366 | { |
| 367 | - $path = $outputDirectory . '/' . str_replace('\\', DIRECTORY_SEPARATOR, $metadata->name) . $this->extension; |
|
| 367 | + $path = $outputDirectory.'/'.str_replace('\\', DIRECTORY_SEPARATOR, $metadata->name).$this->extension; |
|
| 368 | 368 | $dir = dirname($path); |
| 369 | 369 | |
| 370 | 370 | if ( ! is_dir($dir)) { |
| 371 | 371 | mkdir($dir, 0775, true); |
| 372 | 372 | } |
| 373 | 373 | |
| 374 | - $this->isNew = !file_exists($path) || (file_exists($path) && $this->regenerateEntityIfExists); |
|
| 374 | + $this->isNew = ! file_exists($path) || (file_exists($path) && $this->regenerateEntityIfExists); |
|
| 375 | 375 | |
| 376 | 376 | if ( ! $this->isNew) { |
| 377 | 377 | $this->parseTokensInEntityFile(file_get_contents($path)); |
@@ -380,8 +380,8 @@ discard block |
||
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | if ($this->backupExisting && file_exists($path)) { |
| 383 | - $backupPath = dirname($path) . DIRECTORY_SEPARATOR . basename($path) . "~"; |
|
| 384 | - if (!copy($path, $backupPath)) { |
|
| 383 | + $backupPath = dirname($path).DIRECTORY_SEPARATOR.basename($path)."~"; |
|
| 384 | + if ( ! copy($path, $backupPath)) { |
|
| 385 | 385 | throw new \RuntimeException("Attempt to backup overwritten entity file but copy operation failed."); |
| 386 | 386 | } |
| 387 | 387 | } |
@@ -421,7 +421,7 @@ discard block |
||
| 421 | 421 | $this->generateEntityBody($metadata) |
| 422 | 422 | ); |
| 423 | 423 | |
| 424 | - $code = str_replace($placeHolders, $replacements, static::$classTemplate) . "\n"; |
|
| 424 | + $code = str_replace($placeHolders, $replacements, static::$classTemplate)."\n"; |
|
| 425 | 425 | |
| 426 | 426 | return str_replace('<spaces>', $this->spaces, $code); |
| 427 | 427 | } |
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | $body = str_replace('<spaces>', $this->spaces, $body); |
| 443 | 443 | $last = strrpos($currentCode, '}'); |
| 444 | 444 | |
| 445 | - return substr($currentCode, 0, $last) . $body . (strlen($body) > 0 ? "\n" : '') . "}\n"; |
|
| 445 | + return substr($currentCode, 0, $last).$body.(strlen($body) > 0 ? "\n" : '')."}\n"; |
|
| 446 | 446 | } |
| 447 | 447 | |
| 448 | 448 | /** |
@@ -506,7 +506,7 @@ discard block |
||
| 506 | 506 | public function setFieldVisibility($visibility) |
| 507 | 507 | { |
| 508 | 508 | if ($visibility !== static::FIELD_VISIBLE_PRIVATE && $visibility !== static::FIELD_VISIBLE_PROTECTED) { |
| 509 | - throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): ' . $visibility); |
|
| 509 | + throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): '.$visibility); |
|
| 510 | 510 | } |
| 511 | 511 | |
| 512 | 512 | $this->fieldVisibility = $visibility; |
@@ -604,7 +604,7 @@ discard block |
||
| 604 | 604 | protected function generateEntityNamespace(ClassMetadataInfo $metadata) |
| 605 | 605 | { |
| 606 | 606 | if ($this->hasNamespace($metadata)) { |
| 607 | - return 'namespace ' . $this->getNamespace($metadata) .';'; |
|
| 607 | + return 'namespace '.$this->getNamespace($metadata).';'; |
|
| 608 | 608 | } |
| 609 | 609 | } |
| 610 | 610 | |
@@ -624,8 +624,8 @@ discard block |
||
| 624 | 624 | */ |
| 625 | 625 | protected function generateEntityClassName(ClassMetadataInfo $metadata) |
| 626 | 626 | { |
| 627 | - return 'class ' . $this->getClassName($metadata) . |
|
| 628 | - ($this->extendsClass() ? ' extends ' . $this->getClassToExtendName() : null); |
|
| 627 | + return 'class '.$this->getClassName($metadata). |
|
| 628 | + ($this->extendsClass() ? ' extends '.$this->getClassToExtendName() : null); |
|
| 629 | 629 | } |
| 630 | 630 | |
| 631 | 631 | /** |
@@ -727,13 +727,13 @@ discard block |
||
| 727 | 727 | $fieldMappings = array_merge($requiredFields, $optionalFields); |
| 728 | 728 | |
| 729 | 729 | foreach ($metadata->embeddedClasses as $fieldName => $embeddedClass) { |
| 730 | - $paramType = '\\' . ltrim($embeddedClass['class'], '\\'); |
|
| 731 | - $paramVariable = '$' . $fieldName; |
|
| 730 | + $paramType = '\\'.ltrim($embeddedClass['class'], '\\'); |
|
| 731 | + $paramVariable = '$'.$fieldName; |
|
| 732 | 732 | |
| 733 | 733 | $paramTypes[] = $paramType; |
| 734 | 734 | $paramVariables[] = $paramVariable; |
| 735 | - $params[] = $paramType . ' ' . $paramVariable; |
|
| 736 | - $fields[] = '$this->' . $fieldName . ' = ' . $paramVariable . ';'; |
|
| 735 | + $params[] = $paramType.' '.$paramVariable; |
|
| 736 | + $fields[] = '$this->'.$fieldName.' = '.$paramVariable.';'; |
|
| 737 | 737 | } |
| 738 | 738 | |
| 739 | 739 | foreach ($fieldMappings as $fieldMapping) { |
@@ -743,27 +743,27 @@ discard block |
||
| 743 | 743 | continue; |
| 744 | 744 | } |
| 745 | 745 | |
| 746 | - $paramTypes[] = $this->getType($fieldMapping['type']) . (!empty($fieldMapping['nullable']) ? '|null' : ''); |
|
| 747 | - $param = '$' . $fieldMapping['fieldName']; |
|
| 746 | + $paramTypes[] = $this->getType($fieldMapping['type']).( ! empty($fieldMapping['nullable']) ? '|null' : ''); |
|
| 747 | + $param = '$'.$fieldMapping['fieldName']; |
|
| 748 | 748 | $paramVariables[] = $param; |
| 749 | 749 | |
| 750 | 750 | if ($fieldMapping['type'] === 'datetime') { |
| 751 | - $param = $this->getType($fieldMapping['type']) . ' ' . $param; |
|
| 751 | + $param = $this->getType($fieldMapping['type']).' '.$param; |
|
| 752 | 752 | } |
| 753 | 753 | |
| 754 | - if (!empty($fieldMapping['nullable'])) { |
|
| 754 | + if ( ! empty($fieldMapping['nullable'])) { |
|
| 755 | 755 | $param .= ' = null'; |
| 756 | 756 | } |
| 757 | 757 | |
| 758 | 758 | $params[] = $param; |
| 759 | 759 | |
| 760 | - $fields[] = '$this->' . $fieldMapping['fieldName'] . ' = $' . $fieldMapping['fieldName'] . ';'; |
|
| 760 | + $fields[] = '$this->'.$fieldMapping['fieldName'].' = $'.$fieldMapping['fieldName'].';'; |
|
| 761 | 761 | } |
| 762 | 762 | |
| 763 | 763 | $maxParamTypeLength = max(array_map('strlen', $paramTypes)); |
| 764 | 764 | $paramTags = array_map( |
| 765 | - function ($type, $variable) use ($maxParamTypeLength) { |
|
| 766 | - return '@param ' . $type . str_repeat(' ', $maxParamTypeLength - strlen($type) + 1) . $variable; |
|
| 765 | + function($type, $variable) use ($maxParamTypeLength) { |
|
| 766 | + return '@param '.$type.str_repeat(' ', $maxParamTypeLength - strlen($type) + 1).$variable; |
|
| 767 | 767 | }, |
| 768 | 768 | $paramTypes, |
| 769 | 769 | $paramVariables |
@@ -771,8 +771,8 @@ discard block |
||
| 771 | 771 | |
| 772 | 772 | // Generate multi line constructor if the signature exceeds 120 characters. |
| 773 | 773 | if (array_sum(array_map('strlen', $params)) + count($params) * 2 + 29 > 120) { |
| 774 | - $delimiter = "\n" . $this->spaces; |
|
| 775 | - $params = $delimiter . implode(',' . $delimiter, $params) . "\n"; |
|
| 774 | + $delimiter = "\n".$this->spaces; |
|
| 775 | + $params = $delimiter.implode(','.$delimiter, $params)."\n"; |
|
| 776 | 776 | } else { |
| 777 | 777 | $params = implode(', ', $params); |
| 778 | 778 | } |
@@ -780,7 +780,7 @@ discard block |
||
| 780 | 780 | $replacements = array( |
| 781 | 781 | '<paramTags>' => implode("\n * ", $paramTags), |
| 782 | 782 | '<params>' => $params, |
| 783 | - '<fields>' => implode("\n" . $this->spaces, $fields), |
|
| 783 | + '<fields>' => implode("\n".$this->spaces, $fields), |
|
| 784 | 784 | ); |
| 785 | 785 | |
| 786 | 786 | $constructor = str_replace( |
@@ -824,7 +824,7 @@ discard block |
||
| 824 | 824 | |
| 825 | 825 | if ($inClass) { |
| 826 | 826 | $inClass = false; |
| 827 | - $lastSeenClass = $lastSeenNamespace . ($lastSeenNamespace ? '\\' : '') . $token[1]; |
|
| 827 | + $lastSeenClass = $lastSeenNamespace.($lastSeenNamespace ? '\\' : '').$token[1]; |
|
| 828 | 828 | $this->staticReflection[$lastSeenClass]['properties'] = array(); |
| 829 | 829 | $this->staticReflection[$lastSeenClass]['methods'] = array(); |
| 830 | 830 | } |
@@ -832,16 +832,16 @@ discard block |
||
| 832 | 832 | if ($token[0] == T_NAMESPACE) { |
| 833 | 833 | $lastSeenNamespace = ""; |
| 834 | 834 | $inNamespace = true; |
| 835 | - } elseif ($token[0] == T_CLASS && $tokens[$i-1][0] != T_DOUBLE_COLON) { |
|
| 835 | + } elseif ($token[0] == T_CLASS && $tokens[$i - 1][0] != T_DOUBLE_COLON) { |
|
| 836 | 836 | $inClass = true; |
| 837 | 837 | } elseif ($token[0] == T_FUNCTION) { |
| 838 | - if ($tokens[$i+2][0] == T_STRING) { |
|
| 839 | - $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+2][1]); |
|
| 840 | - } elseif ($tokens[$i+2] == "&" && $tokens[$i+3][0] == T_STRING) { |
|
| 841 | - $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+3][1]); |
|
| 838 | + if ($tokens[$i + 2][0] == T_STRING) { |
|
| 839 | + $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 2][1]); |
|
| 840 | + } elseif ($tokens[$i + 2] == "&" && $tokens[$i + 3][0] == T_STRING) { |
|
| 841 | + $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 3][1]); |
|
| 842 | 842 | } |
| 843 | - } elseif (in_array($token[0], array(T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED)) && $tokens[$i+2][0] != T_FUNCTION) { |
|
| 844 | - $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i+2][1], 1); |
|
| 843 | + } elseif (in_array($token[0], array(T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED)) && $tokens[$i + 2][0] != T_FUNCTION) { |
|
| 844 | + $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i + 2][1], 1); |
|
| 845 | 845 | } |
| 846 | 846 | } |
| 847 | 847 | } |
@@ -854,7 +854,7 @@ discard block |
||
| 854 | 854 | */ |
| 855 | 855 | protected function hasProperty($property, ClassMetadataInfo $metadata) |
| 856 | 856 | { |
| 857 | - if ($this->extendsClass() || (!$this->isNew && class_exists($metadata->name))) { |
|
| 857 | + if ($this->extendsClass() || ( ! $this->isNew && class_exists($metadata->name))) { |
|
| 858 | 858 | // don't generate property if its already on the base class. |
| 859 | 859 | $reflClass = new \ReflectionClass($this->getClassToExtend() ?: $metadata->name); |
| 860 | 860 | if ($reflClass->hasProperty($property)) { |
@@ -883,7 +883,7 @@ discard block |
||
| 883 | 883 | */ |
| 884 | 884 | protected function hasMethod($method, ClassMetadataInfo $metadata) |
| 885 | 885 | { |
| 886 | - if ($this->extendsClass() || (!$this->isNew && class_exists($metadata->name))) { |
|
| 886 | + if ($this->extendsClass() || ( ! $this->isNew && class_exists($metadata->name))) { |
|
| 887 | 887 | // don't generate method if its already on the base class. |
| 888 | 888 | $reflClass = new \ReflectionClass($this->getClassToExtend() ?: $metadata->name); |
| 889 | 889 | |
@@ -912,7 +912,7 @@ discard block |
||
| 912 | 912 | */ |
| 913 | 913 | protected function getTraits(ClassMetadataInfo $metadata) |
| 914 | 914 | { |
| 915 | - if (! ($metadata->reflClass !== null || class_exists($metadata->name))) { |
|
| 915 | + if ( ! ($metadata->reflClass !== null || class_exists($metadata->name))) { |
|
| 916 | 916 | return []; |
| 917 | 917 | } |
| 918 | 918 | |
@@ -964,7 +964,7 @@ discard block |
||
| 964 | 964 | { |
| 965 | 965 | $refl = new \ReflectionClass($this->getClassToExtend()); |
| 966 | 966 | |
| 967 | - return '\\' . $refl->getName(); |
|
| 967 | + return '\\'.$refl->getName(); |
|
| 968 | 968 | } |
| 969 | 969 | |
| 970 | 970 | /** |
@@ -997,7 +997,7 @@ discard block |
||
| 997 | 997 | { |
| 998 | 998 | $lines = array(); |
| 999 | 999 | $lines[] = '/**'; |
| 1000 | - $lines[] = ' * ' . $this->getClassName($metadata); |
|
| 1000 | + $lines[] = ' * '.$this->getClassName($metadata); |
|
| 1001 | 1001 | |
| 1002 | 1002 | if ($this->generateAnnotations) { |
| 1003 | 1003 | $lines[] = ' *'; |
@@ -1013,12 +1013,12 @@ discard block |
||
| 1013 | 1013 | |
| 1014 | 1014 | foreach ($methods as $method) { |
| 1015 | 1015 | if ($code = $this->$method($metadata)) { |
| 1016 | - $lines[] = ' * ' . $code; |
|
| 1016 | + $lines[] = ' * '.$code; |
|
| 1017 | 1017 | } |
| 1018 | 1018 | } |
| 1019 | 1019 | |
| 1020 | 1020 | if (isset($metadata->lifecycleCallbacks) && $metadata->lifecycleCallbacks) { |
| 1021 | - $lines[] = ' * @' . $this->annotationsPrefix . 'HasLifecycleCallbacks'; |
|
| 1021 | + $lines[] = ' * @'.$this->annotationsPrefix.'HasLifecycleCallbacks'; |
|
| 1022 | 1022 | } |
| 1023 | 1023 | } |
| 1024 | 1024 | |
@@ -1034,17 +1034,17 @@ discard block |
||
| 1034 | 1034 | */ |
| 1035 | 1035 | protected function generateEntityAnnotation(ClassMetadataInfo $metadata) |
| 1036 | 1036 | { |
| 1037 | - $prefix = '@' . $this->annotationsPrefix; |
|
| 1037 | + $prefix = '@'.$this->annotationsPrefix; |
|
| 1038 | 1038 | |
| 1039 | 1039 | if ($metadata->isEmbeddedClass) { |
| 1040 | - return $prefix . 'Embeddable'; |
|
| 1040 | + return $prefix.'Embeddable'; |
|
| 1041 | 1041 | } |
| 1042 | 1042 | |
| 1043 | 1043 | $customRepository = $metadata->customRepositoryClassName |
| 1044 | - ? '(repositoryClass="' . $metadata->customRepositoryClassName . '")' |
|
| 1044 | + ? '(repositoryClass="'.$metadata->customRepositoryClassName.'")' |
|
| 1045 | 1045 | : ''; |
| 1046 | 1046 | |
| 1047 | - return $prefix . ($metadata->isMappedSuperclass ? 'MappedSuperclass' : 'Entity') . $customRepository; |
|
| 1047 | + return $prefix.($metadata->isMappedSuperclass ? 'MappedSuperclass' : 'Entity').$customRepository; |
|
| 1048 | 1048 | } |
| 1049 | 1049 | |
| 1050 | 1050 | /** |
@@ -1061,28 +1061,28 @@ discard block |
||
| 1061 | 1061 | $table = array(); |
| 1062 | 1062 | |
| 1063 | 1063 | if (isset($metadata->table['schema'])) { |
| 1064 | - $table[] = 'schema="' . $metadata->table['schema'] . '"'; |
|
| 1064 | + $table[] = 'schema="'.$metadata->table['schema'].'"'; |
|
| 1065 | 1065 | } |
| 1066 | 1066 | |
| 1067 | 1067 | if (isset($metadata->table['name'])) { |
| 1068 | - $table[] = 'name="' . $metadata->table['name'] . '"'; |
|
| 1068 | + $table[] = 'name="'.$metadata->table['name'].'"'; |
|
| 1069 | 1069 | } |
| 1070 | 1070 | |
| 1071 | 1071 | if (isset($metadata->table['options']) && $metadata->table['options']) { |
| 1072 | - $table[] = 'options={' . $this->exportTableOptions((array) $metadata->table['options']) . '}'; |
|
| 1072 | + $table[] = 'options={'.$this->exportTableOptions((array) $metadata->table['options']).'}'; |
|
| 1073 | 1073 | } |
| 1074 | 1074 | |
| 1075 | 1075 | if (isset($metadata->table['uniqueConstraints']) && $metadata->table['uniqueConstraints']) { |
| 1076 | 1076 | $constraints = $this->generateTableConstraints('UniqueConstraint', $metadata->table['uniqueConstraints']); |
| 1077 | - $table[] = 'uniqueConstraints={' . $constraints . '}'; |
|
| 1077 | + $table[] = 'uniqueConstraints={'.$constraints.'}'; |
|
| 1078 | 1078 | } |
| 1079 | 1079 | |
| 1080 | 1080 | if (isset($metadata->table['indexes']) && $metadata->table['indexes']) { |
| 1081 | 1081 | $constraints = $this->generateTableConstraints('Index', $metadata->table['indexes']); |
| 1082 | - $table[] = 'indexes={' . $constraints . '}'; |
|
| 1082 | + $table[] = 'indexes={'.$constraints.'}'; |
|
| 1083 | 1083 | } |
| 1084 | 1084 | |
| 1085 | - return '@' . $this->annotationsPrefix . 'Table(' . implode(', ', $table) . ')'; |
|
| 1085 | + return '@'.$this->annotationsPrefix.'Table('.implode(', ', $table).')'; |
|
| 1086 | 1086 | } |
| 1087 | 1087 | |
| 1088 | 1088 | /** |
@@ -1097,9 +1097,9 @@ discard block |
||
| 1097 | 1097 | foreach ($constraints as $name => $constraint) { |
| 1098 | 1098 | $columns = array(); |
| 1099 | 1099 | foreach ($constraint['columns'] as $column) { |
| 1100 | - $columns[] = '"' . $column . '"'; |
|
| 1100 | + $columns[] = '"'.$column.'"'; |
|
| 1101 | 1101 | } |
| 1102 | - $annotations[] = '@' . $this->annotationsPrefix . $constraintName . '(name="' . $name . '", columns={' . implode(', ', $columns) . '})'; |
|
| 1102 | + $annotations[] = '@'.$this->annotationsPrefix.$constraintName.'(name="'.$name.'", columns={'.implode(', ', $columns).'})'; |
|
| 1103 | 1103 | } |
| 1104 | 1104 | |
| 1105 | 1105 | return implode(', ', $annotations); |
@@ -1113,7 +1113,7 @@ discard block |
||
| 1113 | 1113 | protected function generateInheritanceAnnotation($metadata) |
| 1114 | 1114 | { |
| 1115 | 1115 | if ($metadata->inheritanceType != ClassMetadataInfo::INHERITANCE_TYPE_NONE) { |
| 1116 | - return '@' . $this->annotationsPrefix . 'InheritanceType("'.$this->getInheritanceTypeString($metadata->inheritanceType).'")'; |
|
| 1116 | + return '@'.$this->annotationsPrefix.'InheritanceType("'.$this->getInheritanceTypeString($metadata->inheritanceType).'")'; |
|
| 1117 | 1117 | } |
| 1118 | 1118 | } |
| 1119 | 1119 | |
@@ -1126,11 +1126,11 @@ discard block |
||
| 1126 | 1126 | { |
| 1127 | 1127 | if ($metadata->inheritanceType != ClassMetadataInfo::INHERITANCE_TYPE_NONE) { |
| 1128 | 1128 | $discrColumn = $metadata->discriminatorColumn; |
| 1129 | - $columnDefinition = 'name="' . $discrColumn['name'] |
|
| 1130 | - . '", type="' . $discrColumn['type'] |
|
| 1131 | - . '", length=' . $discrColumn['length']; |
|
| 1129 | + $columnDefinition = 'name="'.$discrColumn['name'] |
|
| 1130 | + . '", type="'.$discrColumn['type'] |
|
| 1131 | + . '", length='.$discrColumn['length']; |
|
| 1132 | 1132 | |
| 1133 | - return '@' . $this->annotationsPrefix . 'DiscriminatorColumn(' . $columnDefinition . ')'; |
|
| 1133 | + return '@'.$this->annotationsPrefix.'DiscriminatorColumn('.$columnDefinition.')'; |
|
| 1134 | 1134 | } |
| 1135 | 1135 | } |
| 1136 | 1136 | |
@@ -1145,10 +1145,10 @@ discard block |
||
| 1145 | 1145 | $inheritanceClassMap = array(); |
| 1146 | 1146 | |
| 1147 | 1147 | foreach ($metadata->discriminatorMap as $type => $class) { |
| 1148 | - $inheritanceClassMap[] .= '"' . $type . '" = "' . $class . '"'; |
|
| 1148 | + $inheritanceClassMap[] .= '"'.$type.'" = "'.$class.'"'; |
|
| 1149 | 1149 | } |
| 1150 | 1150 | |
| 1151 | - return '@' . $this->annotationsPrefix . 'DiscriminatorMap({' . implode(', ', $inheritanceClassMap) . '})'; |
|
| 1151 | + return '@'.$this->annotationsPrefix.'DiscriminatorMap({'.implode(', ', $inheritanceClassMap).'})'; |
|
| 1152 | 1152 | } |
| 1153 | 1153 | } |
| 1154 | 1154 | |
@@ -1171,7 +1171,7 @@ discard block |
||
| 1171 | 1171 | if (( ! isset($fieldMapping['id']) || |
| 1172 | 1172 | ! $fieldMapping['id'] || |
| 1173 | 1173 | $metadata->generatorType == ClassMetadataInfo::GENERATOR_TYPE_NONE |
| 1174 | - ) && (! $metadata->isEmbeddedClass || ! $this->embeddablesImmutable) |
|
| 1174 | + ) && ( ! $metadata->isEmbeddedClass || ! $this->embeddablesImmutable) |
|
| 1175 | 1175 | ) { |
| 1176 | 1176 | if ($code = $this->generateEntityStubMethod($metadata, 'set', $fieldMapping['fieldName'], $fieldMapping['type'])) { |
| 1177 | 1177 | $methods[] = $code; |
@@ -1243,7 +1243,7 @@ discard block |
||
| 1243 | 1243 | } |
| 1244 | 1244 | |
| 1245 | 1245 | foreach ($joinColumns as $joinColumn) { |
| 1246 | - if (isset($joinColumn['nullable']) && !$joinColumn['nullable']) { |
|
| 1246 | + if (isset($joinColumn['nullable']) && ! $joinColumn['nullable']) { |
|
| 1247 | 1247 | return false; |
| 1248 | 1248 | } |
| 1249 | 1249 | } |
@@ -1290,8 +1290,8 @@ discard block |
||
| 1290 | 1290 | } |
| 1291 | 1291 | |
| 1292 | 1292 | $lines[] = $this->generateAssociationMappingPropertyDocBlock($associationMapping, $metadata); |
| 1293 | - $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $associationMapping['fieldName'] |
|
| 1294 | - . ($associationMapping['type'] == 'manyToMany' ? ' = array()' : null) . ";\n"; |
|
| 1293 | + $lines[] = $this->spaces.$this->fieldVisibility.' $'.$associationMapping['fieldName'] |
|
| 1294 | + . ($associationMapping['type'] == 'manyToMany' ? ' = array()' : null).";\n"; |
|
| 1295 | 1295 | } |
| 1296 | 1296 | |
| 1297 | 1297 | return implode("\n", $lines); |
@@ -1318,8 +1318,8 @@ discard block |
||
| 1318 | 1318 | } |
| 1319 | 1319 | |
| 1320 | 1320 | $lines[] = $this->generateFieldMappingPropertyDocBlock($fieldMapping, $metadata); |
| 1321 | - $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $fieldMapping['fieldName'] |
|
| 1322 | - . (isset($fieldMapping['options']['default']) ? ' = ' . var_export($fieldMapping['options']['default'], true) : null) . ";\n"; |
|
| 1321 | + $lines[] = $this->spaces.$this->fieldVisibility.' $'.$fieldMapping['fieldName'] |
|
| 1322 | + . (isset($fieldMapping['options']['default']) ? ' = '.var_export($fieldMapping['options']['default'], true) : null).";\n"; |
|
| 1323 | 1323 | } |
| 1324 | 1324 | |
| 1325 | 1325 | return implode("\n", $lines); |
@@ -1340,7 +1340,7 @@ discard block |
||
| 1340 | 1340 | } |
| 1341 | 1341 | |
| 1342 | 1342 | $lines[] = $this->generateEmbeddedPropertyDocBlock($embeddedClass); |
| 1343 | - $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $fieldName . ";\n"; |
|
| 1343 | + $lines[] = $this->spaces.$this->fieldVisibility.' $'.$fieldName.";\n"; |
|
| 1344 | 1344 | } |
| 1345 | 1345 | |
| 1346 | 1346 | return implode("\n", $lines); |
@@ -1355,9 +1355,9 @@ discard block |
||
| 1355 | 1355 | * |
| 1356 | 1356 | * @return string |
| 1357 | 1357 | */ |
| 1358 | - protected function generateEntityStubMethod(ClassMetadataInfo $metadata, $type, $fieldName, $typeHint = null, $defaultValue = null) |
|
| 1358 | + protected function generateEntityStubMethod(ClassMetadataInfo $metadata, $type, $fieldName, $typeHint = null, $defaultValue = null) |
|
| 1359 | 1359 | { |
| 1360 | - $methodName = $type . Inflector::classify($fieldName); |
|
| 1360 | + $methodName = $type.Inflector::classify($fieldName); |
|
| 1361 | 1361 | $variableName = Inflector::camelize($fieldName); |
| 1362 | 1362 | if (in_array($type, array("add", "remove"))) { |
| 1363 | 1363 | $methodName = Inflector::singularize($methodName); |
@@ -1377,18 +1377,18 @@ discard block |
||
| 1377 | 1377 | $variableType = $typeHint ? $this->getType($typeHint) : null; |
| 1378 | 1378 | |
| 1379 | 1379 | if ($typeHint && ! isset($types[$typeHint])) { |
| 1380 | - $variableType = '\\' . ltrim($variableType, '\\'); |
|
| 1381 | - $methodTypeHint = '\\' . $typeHint . ' '; |
|
| 1380 | + $variableType = '\\'.ltrim($variableType, '\\'); |
|
| 1381 | + $methodTypeHint = '\\'.$typeHint.' '; |
|
| 1382 | 1382 | } |
| 1383 | 1383 | |
| 1384 | 1384 | $replacements = array( |
| 1385 | - '<description>' => ucfirst($type) . ' ' . $variableName, |
|
| 1385 | + '<description>' => ucfirst($type).' '.$variableName, |
|
| 1386 | 1386 | '<methodTypeHint>' => $methodTypeHint, |
| 1387 | 1387 | '<variableType>' => $variableType, |
| 1388 | 1388 | '<variableName>' => $variableName, |
| 1389 | 1389 | '<methodName>' => $methodName, |
| 1390 | 1390 | '<fieldName>' => $fieldName, |
| 1391 | - '<variableDefault>' => ($defaultValue !== null ) ? (' = '.$defaultValue) : '', |
|
| 1391 | + '<variableDefault>' => ($defaultValue !== null) ? (' = '.$defaultValue) : '', |
|
| 1392 | 1392 | '<entity>' => $this->getClassName($metadata) |
| 1393 | 1393 | ); |
| 1394 | 1394 | |
@@ -1416,7 +1416,7 @@ discard block |
||
| 1416 | 1416 | $this->staticReflection[$metadata->name]['methods'][] = $methodName; |
| 1417 | 1417 | |
| 1418 | 1418 | $replacements = array( |
| 1419 | - '<name>' => $this->annotationsPrefix . ucfirst($name), |
|
| 1419 | + '<name>' => $this->annotationsPrefix.ucfirst($name), |
|
| 1420 | 1420 | '<methodName>' => $methodName, |
| 1421 | 1421 | ); |
| 1422 | 1422 | |
@@ -1439,30 +1439,30 @@ discard block |
||
| 1439 | 1439 | $joinColumnAnnot = array(); |
| 1440 | 1440 | |
| 1441 | 1441 | if (isset($joinColumn['name'])) { |
| 1442 | - $joinColumnAnnot[] = 'name="' . $joinColumn['name'] . '"'; |
|
| 1442 | + $joinColumnAnnot[] = 'name="'.$joinColumn['name'].'"'; |
|
| 1443 | 1443 | } |
| 1444 | 1444 | |
| 1445 | 1445 | if (isset($joinColumn['referencedColumnName'])) { |
| 1446 | - $joinColumnAnnot[] = 'referencedColumnName="' . $joinColumn['referencedColumnName'] . '"'; |
|
| 1446 | + $joinColumnAnnot[] = 'referencedColumnName="'.$joinColumn['referencedColumnName'].'"'; |
|
| 1447 | 1447 | } |
| 1448 | 1448 | |
| 1449 | 1449 | if (isset($joinColumn['unique']) && $joinColumn['unique']) { |
| 1450 | - $joinColumnAnnot[] = 'unique=' . ($joinColumn['unique'] ? 'true' : 'false'); |
|
| 1450 | + $joinColumnAnnot[] = 'unique='.($joinColumn['unique'] ? 'true' : 'false'); |
|
| 1451 | 1451 | } |
| 1452 | 1452 | |
| 1453 | 1453 | if (isset($joinColumn['nullable'])) { |
| 1454 | - $joinColumnAnnot[] = 'nullable=' . ($joinColumn['nullable'] ? 'true' : 'false'); |
|
| 1454 | + $joinColumnAnnot[] = 'nullable='.($joinColumn['nullable'] ? 'true' : 'false'); |
|
| 1455 | 1455 | } |
| 1456 | 1456 | |
| 1457 | 1457 | if (isset($joinColumn['onDelete'])) { |
| 1458 | - $joinColumnAnnot[] = 'onDelete="' . ($joinColumn['onDelete'] . '"'); |
|
| 1458 | + $joinColumnAnnot[] = 'onDelete="'.($joinColumn['onDelete'].'"'); |
|
| 1459 | 1459 | } |
| 1460 | 1460 | |
| 1461 | 1461 | if (isset($joinColumn['columnDefinition'])) { |
| 1462 | - $joinColumnAnnot[] = 'columnDefinition="' . $joinColumn['columnDefinition'] . '"'; |
|
| 1462 | + $joinColumnAnnot[] = 'columnDefinition="'.$joinColumn['columnDefinition'].'"'; |
|
| 1463 | 1463 | } |
| 1464 | 1464 | |
| 1465 | - return '@' . $this->annotationsPrefix . 'JoinColumn(' . implode(', ', $joinColumnAnnot) . ')'; |
|
| 1465 | + return '@'.$this->annotationsPrefix.'JoinColumn('.implode(', ', $joinColumnAnnot).')'; |
|
| 1466 | 1466 | } |
| 1467 | 1467 | |
| 1468 | 1468 | /** |
@@ -1474,22 +1474,22 @@ discard block |
||
| 1474 | 1474 | protected function generateAssociationMappingPropertyDocBlock(array $associationMapping, ClassMetadataInfo $metadata) |
| 1475 | 1475 | { |
| 1476 | 1476 | $lines = array(); |
| 1477 | - $lines[] = $this->spaces . '/**'; |
|
| 1477 | + $lines[] = $this->spaces.'/**'; |
|
| 1478 | 1478 | |
| 1479 | 1479 | if ($associationMapping['type'] & ClassMetadataInfo::TO_MANY) { |
| 1480 | - $lines[] = $this->spaces . ' * @var \Doctrine\Common\Collections\Collection'; |
|
| 1480 | + $lines[] = $this->spaces.' * @var \Doctrine\Common\Collections\Collection'; |
|
| 1481 | 1481 | } else { |
| 1482 | - $lines[] = $this->spaces . ' * @var \\' . ltrim($associationMapping['targetEntity'], '\\'); |
|
| 1482 | + $lines[] = $this->spaces.' * @var \\'.ltrim($associationMapping['targetEntity'], '\\'); |
|
| 1483 | 1483 | } |
| 1484 | 1484 | |
| 1485 | 1485 | if ($this->generateAnnotations) { |
| 1486 | - $lines[] = $this->spaces . ' *'; |
|
| 1486 | + $lines[] = $this->spaces.' *'; |
|
| 1487 | 1487 | |
| 1488 | 1488 | if (isset($associationMapping['id']) && $associationMapping['id']) { |
| 1489 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Id'; |
|
| 1489 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Id'; |
|
| 1490 | 1490 | |
| 1491 | 1491 | if ($generatorType = $this->getIdGeneratorTypeString($metadata->generatorType)) { |
| 1492 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'GeneratedValue(strategy="' . $generatorType . '")'; |
|
| 1492 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'GeneratedValue(strategy="'.$generatorType.'")'; |
|
| 1493 | 1493 | } |
| 1494 | 1494 | } |
| 1495 | 1495 | |
@@ -1511,15 +1511,15 @@ discard block |
||
| 1511 | 1511 | $typeOptions = array(); |
| 1512 | 1512 | |
| 1513 | 1513 | if (isset($associationMapping['targetEntity'])) { |
| 1514 | - $typeOptions[] = 'targetEntity="' . $associationMapping['targetEntity'] . '"'; |
|
| 1514 | + $typeOptions[] = 'targetEntity="'.$associationMapping['targetEntity'].'"'; |
|
| 1515 | 1515 | } |
| 1516 | 1516 | |
| 1517 | 1517 | if (isset($associationMapping['inversedBy'])) { |
| 1518 | - $typeOptions[] = 'inversedBy="' . $associationMapping['inversedBy'] . '"'; |
|
| 1518 | + $typeOptions[] = 'inversedBy="'.$associationMapping['inversedBy'].'"'; |
|
| 1519 | 1519 | } |
| 1520 | 1520 | |
| 1521 | 1521 | if (isset($associationMapping['mappedBy'])) { |
| 1522 | - $typeOptions[] = 'mappedBy="' . $associationMapping['mappedBy'] . '"'; |
|
| 1522 | + $typeOptions[] = 'mappedBy="'.$associationMapping['mappedBy'].'"'; |
|
| 1523 | 1523 | } |
| 1524 | 1524 | |
| 1525 | 1525 | if ($associationMapping['cascade']) { |
@@ -1535,11 +1535,11 @@ discard block |
||
| 1535 | 1535 | $cascades = array('"all"'); |
| 1536 | 1536 | } |
| 1537 | 1537 | |
| 1538 | - $typeOptions[] = 'cascade={' . implode(',', $cascades) . '}'; |
|
| 1538 | + $typeOptions[] = 'cascade={'.implode(',', $cascades).'}'; |
|
| 1539 | 1539 | } |
| 1540 | 1540 | |
| 1541 | 1541 | if (isset($associationMapping['orphanRemoval']) && $associationMapping['orphanRemoval']) { |
| 1542 | - $typeOptions[] = 'orphanRemoval=' . ($associationMapping['orphanRemoval'] ? 'true' : 'false'); |
|
| 1542 | + $typeOptions[] = 'orphanRemoval='.($associationMapping['orphanRemoval'] ? 'true' : 'false'); |
|
| 1543 | 1543 | } |
| 1544 | 1544 | |
| 1545 | 1545 | if (isset($associationMapping['fetch']) && $associationMapping['fetch'] !== ClassMetadataInfo::FETCH_LAZY) { |
@@ -1548,71 +1548,71 @@ discard block |
||
| 1548 | 1548 | ClassMetadataInfo::FETCH_EAGER => 'EAGER', |
| 1549 | 1549 | ); |
| 1550 | 1550 | |
| 1551 | - $typeOptions[] = 'fetch="' . $fetchMap[$associationMapping['fetch']] . '"'; |
|
| 1551 | + $typeOptions[] = 'fetch="'.$fetchMap[$associationMapping['fetch']].'"'; |
|
| 1552 | 1552 | } |
| 1553 | 1553 | |
| 1554 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . '' . $type . '(' . implode(', ', $typeOptions) . ')'; |
|
| 1554 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.''.$type.'('.implode(', ', $typeOptions).')'; |
|
| 1555 | 1555 | |
| 1556 | 1556 | if (isset($associationMapping['joinColumns']) && $associationMapping['joinColumns']) { |
| 1557 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'JoinColumns({'; |
|
| 1557 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'JoinColumns({'; |
|
| 1558 | 1558 | |
| 1559 | 1559 | $joinColumnsLines = array(); |
| 1560 | 1560 | |
| 1561 | 1561 | foreach ($associationMapping['joinColumns'] as $joinColumn) { |
| 1562 | 1562 | if ($joinColumnAnnot = $this->generateJoinColumnAnnotation($joinColumn)) { |
| 1563 | - $joinColumnsLines[] = $this->spaces . ' * ' . $joinColumnAnnot; |
|
| 1563 | + $joinColumnsLines[] = $this->spaces.' * '.$joinColumnAnnot; |
|
| 1564 | 1564 | } |
| 1565 | 1565 | } |
| 1566 | 1566 | |
| 1567 | 1567 | $lines[] = implode(",\n", $joinColumnsLines); |
| 1568 | - $lines[] = $this->spaces . ' * })'; |
|
| 1568 | + $lines[] = $this->spaces.' * })'; |
|
| 1569 | 1569 | } |
| 1570 | 1570 | |
| 1571 | 1571 | if (isset($associationMapping['joinTable']) && $associationMapping['joinTable']) { |
| 1572 | 1572 | $joinTable = array(); |
| 1573 | - $joinTable[] = 'name="' . $associationMapping['joinTable']['name'] . '"'; |
|
| 1573 | + $joinTable[] = 'name="'.$associationMapping['joinTable']['name'].'"'; |
|
| 1574 | 1574 | |
| 1575 | 1575 | if (isset($associationMapping['joinTable']['schema'])) { |
| 1576 | - $joinTable[] = 'schema="' . $associationMapping['joinTable']['schema'] . '"'; |
|
| 1576 | + $joinTable[] = 'schema="'.$associationMapping['joinTable']['schema'].'"'; |
|
| 1577 | 1577 | } |
| 1578 | 1578 | |
| 1579 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'JoinTable(' . implode(', ', $joinTable) . ','; |
|
| 1580 | - $lines[] = $this->spaces . ' * joinColumns={'; |
|
| 1579 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'JoinTable('.implode(', ', $joinTable).','; |
|
| 1580 | + $lines[] = $this->spaces.' * joinColumns={'; |
|
| 1581 | 1581 | |
| 1582 | 1582 | $joinColumnsLines = array(); |
| 1583 | 1583 | |
| 1584 | 1584 | foreach ($associationMapping['joinTable']['joinColumns'] as $joinColumn) { |
| 1585 | - $joinColumnsLines[] = $this->spaces . ' * ' . $this->generateJoinColumnAnnotation($joinColumn); |
|
| 1585 | + $joinColumnsLines[] = $this->spaces.' * '.$this->generateJoinColumnAnnotation($joinColumn); |
|
| 1586 | 1586 | } |
| 1587 | 1587 | |
| 1588 | - $lines[] = implode(",". PHP_EOL, $joinColumnsLines); |
|
| 1589 | - $lines[] = $this->spaces . ' * },'; |
|
| 1590 | - $lines[] = $this->spaces . ' * inverseJoinColumns={'; |
|
| 1588 | + $lines[] = implode(",".PHP_EOL, $joinColumnsLines); |
|
| 1589 | + $lines[] = $this->spaces.' * },'; |
|
| 1590 | + $lines[] = $this->spaces.' * inverseJoinColumns={'; |
|
| 1591 | 1591 | |
| 1592 | 1592 | $inverseJoinColumnsLines = array(); |
| 1593 | 1593 | |
| 1594 | 1594 | foreach ($associationMapping['joinTable']['inverseJoinColumns'] as $joinColumn) { |
| 1595 | - $inverseJoinColumnsLines[] = $this->spaces . ' * ' . $this->generateJoinColumnAnnotation($joinColumn); |
|
| 1595 | + $inverseJoinColumnsLines[] = $this->spaces.' * '.$this->generateJoinColumnAnnotation($joinColumn); |
|
| 1596 | 1596 | } |
| 1597 | 1597 | |
| 1598 | - $lines[] = implode(",". PHP_EOL, $inverseJoinColumnsLines); |
|
| 1599 | - $lines[] = $this->spaces . ' * }'; |
|
| 1600 | - $lines[] = $this->spaces . ' * )'; |
|
| 1598 | + $lines[] = implode(",".PHP_EOL, $inverseJoinColumnsLines); |
|
| 1599 | + $lines[] = $this->spaces.' * }'; |
|
| 1600 | + $lines[] = $this->spaces.' * )'; |
|
| 1601 | 1601 | } |
| 1602 | 1602 | |
| 1603 | 1603 | if (isset($associationMapping['orderBy'])) { |
| 1604 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'OrderBy({'; |
|
| 1604 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'OrderBy({'; |
|
| 1605 | 1605 | |
| 1606 | 1606 | foreach ($associationMapping['orderBy'] as $name => $direction) { |
| 1607 | - $lines[] = $this->spaces . ' * "' . $name . '"="' . $direction . '",'; |
|
| 1607 | + $lines[] = $this->spaces.' * "'.$name.'"="'.$direction.'",'; |
|
| 1608 | 1608 | } |
| 1609 | 1609 | |
| 1610 | 1610 | $lines[count($lines) - 1] = substr($lines[count($lines) - 1], 0, strlen($lines[count($lines) - 1]) - 1); |
| 1611 | - $lines[] = $this->spaces . ' * })'; |
|
| 1611 | + $lines[] = $this->spaces.' * })'; |
|
| 1612 | 1612 | } |
| 1613 | 1613 | } |
| 1614 | 1614 | |
| 1615 | - $lines[] = $this->spaces . ' */'; |
|
| 1615 | + $lines[] = $this->spaces.' */'; |
|
| 1616 | 1616 | |
| 1617 | 1617 | return implode("\n", $lines); |
| 1618 | 1618 | } |
@@ -1626,35 +1626,35 @@ discard block |
||
| 1626 | 1626 | protected function generateFieldMappingPropertyDocBlock(array $fieldMapping, ClassMetadataInfo $metadata) |
| 1627 | 1627 | { |
| 1628 | 1628 | $lines = array(); |
| 1629 | - $lines[] = $this->spaces . '/**'; |
|
| 1630 | - $lines[] = $this->spaces . ' * @var ' . $this->getType($fieldMapping['type']); |
|
| 1629 | + $lines[] = $this->spaces.'/**'; |
|
| 1630 | + $lines[] = $this->spaces.' * @var '.$this->getType($fieldMapping['type']); |
|
| 1631 | 1631 | |
| 1632 | 1632 | if ($this->generateAnnotations) { |
| 1633 | - $lines[] = $this->spaces . ' *'; |
|
| 1633 | + $lines[] = $this->spaces.' *'; |
|
| 1634 | 1634 | |
| 1635 | 1635 | $column = array(); |
| 1636 | 1636 | if (isset($fieldMapping['columnName'])) { |
| 1637 | - $column[] = 'name="' . $fieldMapping['columnName'] . '"'; |
|
| 1637 | + $column[] = 'name="'.$fieldMapping['columnName'].'"'; |
|
| 1638 | 1638 | } |
| 1639 | 1639 | |
| 1640 | 1640 | if (isset($fieldMapping['type'])) { |
| 1641 | - $column[] = 'type="' . $fieldMapping['type'] . '"'; |
|
| 1641 | + $column[] = 'type="'.$fieldMapping['type'].'"'; |
|
| 1642 | 1642 | } |
| 1643 | 1643 | |
| 1644 | 1644 | if (isset($fieldMapping['length'])) { |
| 1645 | - $column[] = 'length=' . $fieldMapping['length']; |
|
| 1645 | + $column[] = 'length='.$fieldMapping['length']; |
|
| 1646 | 1646 | } |
| 1647 | 1647 | |
| 1648 | 1648 | if (isset($fieldMapping['precision'])) { |
| 1649 | - $column[] = 'precision=' . $fieldMapping['precision']; |
|
| 1649 | + $column[] = 'precision='.$fieldMapping['precision']; |
|
| 1650 | 1650 | } |
| 1651 | 1651 | |
| 1652 | 1652 | if (isset($fieldMapping['scale'])) { |
| 1653 | - $column[] = 'scale=' . $fieldMapping['scale']; |
|
| 1653 | + $column[] = 'scale='.$fieldMapping['scale']; |
|
| 1654 | 1654 | } |
| 1655 | 1655 | |
| 1656 | 1656 | if (isset($fieldMapping['nullable'])) { |
| 1657 | - $column[] = 'nullable=' . var_export($fieldMapping['nullable'], true); |
|
| 1657 | + $column[] = 'nullable='.var_export($fieldMapping['nullable'], true); |
|
| 1658 | 1658 | } |
| 1659 | 1659 | |
| 1660 | 1660 | $options = []; |
@@ -1668,47 +1668,47 @@ discard block |
||
| 1668 | 1668 | } |
| 1669 | 1669 | |
| 1670 | 1670 | if (isset($fieldMapping['columnDefinition'])) { |
| 1671 | - $column[] = 'columnDefinition="' . $fieldMapping['columnDefinition'] . '"'; |
|
| 1671 | + $column[] = 'columnDefinition="'.$fieldMapping['columnDefinition'].'"'; |
|
| 1672 | 1672 | } |
| 1673 | 1673 | |
| 1674 | 1674 | if (isset($fieldMapping['unique'])) { |
| 1675 | - $column[] = 'unique=' . var_export($fieldMapping['unique'], true); |
|
| 1675 | + $column[] = 'unique='.var_export($fieldMapping['unique'], true); |
|
| 1676 | 1676 | } |
| 1677 | 1677 | |
| 1678 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Column(' . implode(', ', $column) . ')'; |
|
| 1678 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Column('.implode(', ', $column).')'; |
|
| 1679 | 1679 | |
| 1680 | 1680 | if (isset($fieldMapping['id']) && $fieldMapping['id']) { |
| 1681 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Id'; |
|
| 1681 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Id'; |
|
| 1682 | 1682 | |
| 1683 | 1683 | if ($generatorType = $this->getIdGeneratorTypeString($metadata->generatorType)) { |
| 1684 | - $lines[] = $this->spaces.' * @' . $this->annotationsPrefix . 'GeneratedValue(strategy="' . $generatorType . '")'; |
|
| 1684 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'GeneratedValue(strategy="'.$generatorType.'")'; |
|
| 1685 | 1685 | } |
| 1686 | 1686 | |
| 1687 | 1687 | if ($metadata->sequenceGeneratorDefinition) { |
| 1688 | 1688 | $sequenceGenerator = array(); |
| 1689 | 1689 | |
| 1690 | 1690 | if (isset($metadata->sequenceGeneratorDefinition['sequenceName'])) { |
| 1691 | - $sequenceGenerator[] = 'sequenceName="' . $metadata->sequenceGeneratorDefinition['sequenceName'] . '"'; |
|
| 1691 | + $sequenceGenerator[] = 'sequenceName="'.$metadata->sequenceGeneratorDefinition['sequenceName'].'"'; |
|
| 1692 | 1692 | } |
| 1693 | 1693 | |
| 1694 | 1694 | if (isset($metadata->sequenceGeneratorDefinition['allocationSize'])) { |
| 1695 | - $sequenceGenerator[] = 'allocationSize=' . $metadata->sequenceGeneratorDefinition['allocationSize']; |
|
| 1695 | + $sequenceGenerator[] = 'allocationSize='.$metadata->sequenceGeneratorDefinition['allocationSize']; |
|
| 1696 | 1696 | } |
| 1697 | 1697 | |
| 1698 | 1698 | if (isset($metadata->sequenceGeneratorDefinition['initialValue'])) { |
| 1699 | - $sequenceGenerator[] = 'initialValue=' . $metadata->sequenceGeneratorDefinition['initialValue']; |
|
| 1699 | + $sequenceGenerator[] = 'initialValue='.$metadata->sequenceGeneratorDefinition['initialValue']; |
|
| 1700 | 1700 | } |
| 1701 | 1701 | |
| 1702 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'SequenceGenerator(' . implode(', ', $sequenceGenerator) . ')'; |
|
| 1702 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'SequenceGenerator('.implode(', ', $sequenceGenerator).')'; |
|
| 1703 | 1703 | } |
| 1704 | 1704 | } |
| 1705 | 1705 | |
| 1706 | 1706 | if (isset($fieldMapping['version']) && $fieldMapping['version']) { |
| 1707 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Version'; |
|
| 1707 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Version'; |
|
| 1708 | 1708 | } |
| 1709 | 1709 | } |
| 1710 | 1710 | |
| 1711 | - $lines[] = $this->spaces . ' */'; |
|
| 1711 | + $lines[] = $this->spaces.' */'; |
|
| 1712 | 1712 | |
| 1713 | 1713 | return implode("\n", $lines); |
| 1714 | 1714 | } |
@@ -1721,23 +1721,23 @@ discard block |
||
| 1721 | 1721 | protected function generateEmbeddedPropertyDocBlock(array $embeddedClass) |
| 1722 | 1722 | { |
| 1723 | 1723 | $lines = array(); |
| 1724 | - $lines[] = $this->spaces . '/**'; |
|
| 1725 | - $lines[] = $this->spaces . ' * @var \\' . ltrim($embeddedClass['class'], '\\'); |
|
| 1724 | + $lines[] = $this->spaces.'/**'; |
|
| 1725 | + $lines[] = $this->spaces.' * @var \\'.ltrim($embeddedClass['class'], '\\'); |
|
| 1726 | 1726 | |
| 1727 | 1727 | if ($this->generateAnnotations) { |
| 1728 | - $lines[] = $this->spaces . ' *'; |
|
| 1728 | + $lines[] = $this->spaces.' *'; |
|
| 1729 | 1729 | |
| 1730 | - $embedded = array('class="' . $embeddedClass['class'] . '"'); |
|
| 1730 | + $embedded = array('class="'.$embeddedClass['class'].'"'); |
|
| 1731 | 1731 | |
| 1732 | 1732 | if (isset($fieldMapping['columnPrefix'])) { |
| 1733 | - $embedded[] = 'columnPrefix=' . var_export($embeddedClass['columnPrefix'], true); |
|
| 1733 | + $embedded[] = 'columnPrefix='.var_export($embeddedClass['columnPrefix'], true); |
|
| 1734 | 1734 | } |
| 1735 | 1735 | |
| 1736 | - $lines[] = $this->spaces . ' * @' . |
|
| 1737 | - $this->annotationsPrefix . 'Embedded(' . implode(', ', $embedded) . ')'; |
|
| 1736 | + $lines[] = $this->spaces.' * @'. |
|
| 1737 | + $this->annotationsPrefix.'Embedded('.implode(', ', $embedded).')'; |
|
| 1738 | 1738 | } |
| 1739 | 1739 | |
| 1740 | - $lines[] = $this->spaces . ' */'; |
|
| 1740 | + $lines[] = $this->spaces.' */'; |
|
| 1741 | 1741 | |
| 1742 | 1742 | return implode("\n", $lines); |
| 1743 | 1743 | } |
@@ -1757,13 +1757,13 @@ discard block |
||
| 1757 | 1757 | |
| 1758 | 1758 | foreach ($metadata->entityListeners as $event => $eventListeners) { |
| 1759 | 1759 | foreach ($eventListeners as $eventListener) { |
| 1760 | - $processedClasses[] = '"' . $eventListener['class'] . '"'; |
|
| 1760 | + $processedClasses[] = '"'.$eventListener['class'].'"'; |
|
| 1761 | 1761 | } |
| 1762 | 1762 | } |
| 1763 | 1763 | |
| 1764 | 1764 | return sprintf( |
| 1765 | 1765 | '%s%s({%s})', |
| 1766 | - '@' . $this->annotationsPrefix, |
|
| 1766 | + '@'.$this->annotationsPrefix, |
|
| 1767 | 1767 | 'EntityListeners', |
| 1768 | 1768 | implode(',', array_unique($processedClasses)) |
| 1769 | 1769 | ); |
@@ -1781,7 +1781,7 @@ discard block |
||
| 1781 | 1781 | |
| 1782 | 1782 | foreach ($lines as $key => $value) { |
| 1783 | 1783 | if ( ! empty($value)) { |
| 1784 | - $lines[$key] = str_repeat($this->spaces, $num) . $lines[$key]; |
|
| 1784 | + $lines[$key] = str_repeat($this->spaces, $num).$lines[$key]; |
|
| 1785 | 1785 | } |
| 1786 | 1786 | } |
| 1787 | 1787 | |
@@ -1849,9 +1849,9 @@ discard block |
||
| 1849 | 1849 | |
| 1850 | 1850 | foreach ($options as $name => $option) { |
| 1851 | 1851 | if (is_array($option)) { |
| 1852 | - $optionsStr[] = '"' . $name . '"={' . $this->exportTableOptions($option) . '}'; |
|
| 1852 | + $optionsStr[] = '"'.$name.'"={'.$this->exportTableOptions($option).'}'; |
|
| 1853 | 1853 | } else { |
| 1854 | - $optionsStr[] = '"' . $name . '"="' . (string) $option . '"'; |
|
| 1854 | + $optionsStr[] = '"'.$name.'"="'.(string) $option.'"'; |
|
| 1855 | 1855 | } |
| 1856 | 1856 | } |
| 1857 | 1857 | |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | public function exportClassMetadata(ClassMetadataInfo $metadata) |
| 42 | 42 | { |
| 43 | 43 | $xml = new \SimpleXmlElement("<?xml version=\"1.0\" encoding=\"utf-8\"?><doctrine-mapping ". |
| 44 | - "xmlns=\"http://doctrine-project.org/schemas/orm/doctrine-mapping\" " . |
|
| 44 | + "xmlns=\"http://doctrine-project.org/schemas/orm/doctrine-mapping\" ". |
|
| 45 | 45 | "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ". |
| 46 | 46 | "xsi:schemaLocation=\"http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd\" />"); |
| 47 | 47 | |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | $trackingPolicy = $this->_getChangeTrackingPolicyString($metadata->changeTrackingPolicy); |
| 99 | 99 | |
| 100 | - if ( $trackingPolicy != 'DEFERRED_IMPLICIT') { |
|
| 100 | + if ($trackingPolicy != 'DEFERRED_IMPLICIT') { |
|
| 101 | 101 | $root->addChild('change-tracking-policy', $trackingPolicy); |
| 102 | 102 | } |
| 103 | 103 | |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | if (count($cascade) === 5) { |
| 298 | - $cascade = array('cascade-all'); |
|
| 298 | + $cascade = array('cascade-all'); |
|
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 | if ($cascade) { |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | } |
| 378 | 378 | } |
| 379 | 379 | |
| 380 | - if (isset($metadata->lifecycleCallbacks) && count($metadata->lifecycleCallbacks)>0) { |
|
| 380 | + if (isset($metadata->lifecycleCallbacks) && count($metadata->lifecycleCallbacks) > 0) { |
|
| 381 | 381 | $lifecycleCallbacksXml = $root->addChild('lifecycle-callbacks'); |
| 382 | 382 | |
| 383 | 383 | foreach ($metadata->lifecycleCallbacks as $name => $methods) { |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | |
| 396 | 396 | foreach ($metadata->entityListeners as $event => $entityListenerConfig) { |
| 397 | 397 | foreach ($entityListenerConfig as $entityListener) { |
| 398 | - if (!isset($entityListenersXmlMap[$entityListener['class']])) { |
|
| 398 | + if ( ! isset($entityListenersXmlMap[$entityListener['class']])) { |
|
| 399 | 399 | $entityListenerXml = $entityListenersXml->addChild('entity-listener'); |
| 400 | 400 | $entityListenerXml->addAttribute('class', $entityListener['class']); |
| 401 | 401 | $entityListenersXmlMap[$entityListener['class']] = $entityListenerXml; |
@@ -447,7 +447,7 @@ discard block |
||
| 447 | 447 | { |
| 448 | 448 | $sequenceDefinition = $metadata->sequenceGeneratorDefinition; |
| 449 | 449 | |
| 450 | - if (! ($metadata->generatorType === ClassMetadataInfo::GENERATOR_TYPE_SEQUENCE && $sequenceDefinition)) { |
|
| 450 | + if ( ! ($metadata->generatorType === ClassMetadataInfo::GENERATOR_TYPE_SEQUENCE && $sequenceDefinition)) { |
|
| 451 | 451 | return; |
| 452 | 452 | } |
| 453 | 453 | |
@@ -219,7 +219,7 @@ |
||
| 219 | 219 | |
| 220 | 220 | foreach ($metadata->entityListeners as $event => $entityListenerConfig) { |
| 221 | 221 | foreach ($entityListenerConfig as $entityListener) { |
| 222 | - if (!isset($array['entityListeners'][$entityListener['class']])) { |
|
| 222 | + if ( ! isset($array['entityListeners'][$entityListener['class']])) { |
|
| 223 | 223 | $array['entityListeners'][$entityListener['class']] = null; |
| 224 | 224 | } |
| 225 | 225 | |