@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | ?string $className = null, |
| 81 | 81 | ?string $embeddedClassName = null |
| 82 | 82 | ) : string { |
| 83 | - return $this->underscore($propertyName) . '_' . $embeddedColumnName; |
|
| 83 | + return $this->underscore($propertyName).'_'.$embeddedColumnName; |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | /** |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | */ |
| 97 | 97 | public function joinColumnName(string $propertyName, ?string $className = null) : string |
| 98 | 98 | { |
| 99 | - return $this->underscore($propertyName) . '_' . $this->referenceColumnName(); |
|
| 99 | + return $this->underscore($propertyName).'_'.$this->referenceColumnName(); |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | /** |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | */ |
| 105 | 105 | public function joinTableName(string $sourceEntity, string $targetEntity, ?string $propertyName = null) : string |
| 106 | 106 | { |
| 107 | - return $this->classToTableName($sourceEntity) . '_' . $this->classToTableName($targetEntity); |
|
| 107 | + return $this->classToTableName($sourceEntity).'_'.$this->classToTableName($targetEntity); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | /** |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | */ |
| 113 | 113 | public function joinKeyColumnName(string $entityName, ?string $referencedColumnName = null) : string |
| 114 | 114 | { |
| 115 | - return $this->classToTableName($entityName) . '_' . |
|
| 115 | + return $this->classToTableName($entityName).'_'. |
|
| 116 | 116 | ($referencedColumnName ?: $this->referenceColumnName()); |
| 117 | 117 | } |
| 118 | 118 | |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | ) : ClassMetadataDefinition { |
| 31 | 31 | $definition = $this->createDefinition($className, $parentMetadata); |
| 32 | 32 | |
| 33 | - if (! class_exists($definition->metadataClassName, false)) { |
|
| 33 | + if ( ! class_exists($definition->metadataClassName, false)) { |
|
| 34 | 34 | $metadataClassPath = $this->resolver->resolveMetadataClassPath($className); |
| 35 | 35 | |
| 36 | 36 | $this->generatorStrategy->generate($metadataClassPath, $definition, $metadataBuildingContext); |
@@ -143,8 +143,8 @@ discard block |
||
| 143 | 143 | ) : Mapping\ComponentMetadata { |
| 144 | 144 | $this->reverseEngineerMappingFromDatabase(); |
| 145 | 145 | |
| 146 | - if (! isset($this->classToTableNames[$className])) { |
|
| 147 | - throw new InvalidArgumentException('Unknown class ' . $className); |
|
| 146 | + if ( ! isset($this->classToTableNames[$className])) { |
|
| 147 | + throw new InvalidArgumentException('Unknown class '.$className); |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | $metadata = new Mapping\ClassMetadata($className, $parent, $metadataBuildingContext); |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | } |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | - if (! $otherFk) { |
|
| 176 | + if ( ! $otherFk) { |
|
| 177 | 177 | // the definition of this many to many table does not contain |
| 178 | 178 | // enough foreign key information to continue reverse engineering. |
| 179 | 179 | continue; |
@@ -256,9 +256,9 @@ discard block |
||
| 256 | 256 | $allForeignKeyColumns = array_merge($allForeignKeyColumns, $foreignKey->getLocalColumns()); |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | - if (! $table->hasPrimaryKey()) { |
|
| 259 | + if ( ! $table->hasPrimaryKey()) { |
|
| 260 | 260 | throw new Mapping\MappingException( |
| 261 | - 'Table ' . $table->getName() . ' has no primary key. Doctrine does not ' . |
|
| 261 | + 'Table '.$table->getName().' has no primary key. Doctrine does not '. |
|
| 262 | 262 | "support reverse engineering from tables that don't have a primary key." |
| 263 | 263 | ); |
| 264 | 264 | } |
@@ -448,7 +448,7 @@ discard block |
||
| 448 | 448 | } |
| 449 | 449 | |
| 450 | 450 | // Here we need to check if $fkColumns are the same as $primaryKeys |
| 451 | - if (! array_diff($fkColumns, $primaryKeys)) { |
|
| 451 | + if ( ! array_diff($fkColumns, $primaryKeys)) { |
|
| 452 | 452 | $metadata->addProperty($associationMapping); |
| 453 | 453 | } else { |
| 454 | 454 | $metadata->addProperty($associationMapping); |
@@ -493,7 +493,7 @@ discard block |
||
| 493 | 493 | */ |
| 494 | 494 | private function getClassNameForTable($tableName) |
| 495 | 495 | { |
| 496 | - return $this->namespace . ( |
|
| 496 | + return $this->namespace.( |
|
| 497 | 497 | $this->classNamesForTables[$tableName] |
| 498 | 498 | ?? Inflector::classify(strtolower($tableName)) |
| 499 | 499 | ); |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | $lines[] = null; |
| 30 | 30 | |
| 31 | 31 | if ($namespace) { |
| 32 | - $lines[] = 'namespace ' . $namespace . ';'; |
|
| 32 | + $lines[] = 'namespace '.$namespace.';'; |
|
| 33 | 33 | $lines[] = null; |
| 34 | 34 | } |
| 35 | 35 | |
@@ -64,31 +64,31 @@ discard block |
||
| 64 | 64 | { |
| 65 | 65 | $indentation = str_repeat(self::INDENTATION, $indentationLevel); |
| 66 | 66 | $bodyIndentation = str_repeat(self::INDENTATION, $indentationLevel + 1); |
| 67 | - $objectReference = $bodyIndentation . self::VARIABLE; |
|
| 67 | + $objectReference = $bodyIndentation.self::VARIABLE; |
|
| 68 | 68 | $lines = []; |
| 69 | 69 | |
| 70 | - $lines[] = $indentation . 'public function __construct('; |
|
| 71 | - $lines[] = $bodyIndentation . 'ClassMetadataBuildingContext $metadataBuildingContext,'; |
|
| 72 | - $lines[] = $bodyIndentation . '?ClassMetadata $parent = null'; |
|
| 73 | - $lines[] = $indentation . ')'; |
|
| 74 | - $lines[] = $indentation . '{'; |
|
| 75 | - $lines[] = $bodyIndentation . 'parent::__construct("' . $metadata->getClassName() . '", $parent, $metadataBuildingContext);'; |
|
| 70 | + $lines[] = $indentation.'public function __construct('; |
|
| 71 | + $lines[] = $bodyIndentation.'ClassMetadataBuildingContext $metadataBuildingContext,'; |
|
| 72 | + $lines[] = $bodyIndentation.'?ClassMetadata $parent = null'; |
|
| 73 | + $lines[] = $indentation.')'; |
|
| 74 | + $lines[] = $indentation.'{'; |
|
| 75 | + $lines[] = $bodyIndentation.'parent::__construct("'.$metadata->getClassName().'", $parent, $metadataBuildingContext);'; |
|
| 76 | 76 | |
| 77 | 77 | if ($metadata->getCustomRepositoryClassName()) { |
| 78 | 78 | $lines[] = null; |
| 79 | - $lines[] = $objectReference . '->setCustomRepositoryClassName("' . $metadata->getCustomRepositoryClassName() . '");'; |
|
| 79 | + $lines[] = $objectReference.'->setCustomRepositoryClassName("'.$metadata->getCustomRepositoryClassName().'");'; |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | if ($metadata->changeTrackingPolicy) { |
| 83 | 83 | $lines[] = null; |
| 84 | - $lines[] = $objectReference . '->setChangeTrackingPolicy(Mapping\ChangeTrackingPolicy::' . strtoupper($metadata->changeTrackingPolicy) . ');'; |
|
| 84 | + $lines[] = $objectReference.'->setChangeTrackingPolicy(Mapping\ChangeTrackingPolicy::'.strtoupper($metadata->changeTrackingPolicy).');'; |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | $lines[] = $this->exportInheritance($metadata, $indentationLevel); |
| 88 | 88 | $lines[] = $this->exportTable($metadata, $indentationLevel); |
| 89 | 89 | $lines[] = $this->exportProperties($metadata, $indentationLevel); |
| 90 | 90 | $lines[] = $this->exportLifecycleCallbacks($metadata, $indentationLevel); |
| 91 | - $lines[] = $indentation . '}'; |
|
| 91 | + $lines[] = $indentation.'}'; |
|
| 92 | 92 | |
| 93 | 93 | return implode(PHP_EOL, $lines); |
| 94 | 94 | } |
@@ -96,17 +96,17 @@ discard block |
||
| 96 | 96 | private function exportInheritance(Mapping\ClassMetadata $metadata, int $indentationLevel) : string |
| 97 | 97 | { |
| 98 | 98 | $bodyIndentation = str_repeat(self::INDENTATION, $indentationLevel + 1); |
| 99 | - $objectReference = $bodyIndentation . self::VARIABLE; |
|
| 99 | + $objectReference = $bodyIndentation.self::VARIABLE; |
|
| 100 | 100 | $lines = []; |
| 101 | 101 | |
| 102 | 102 | if ($metadata->inheritanceType) { |
| 103 | 103 | $lines[] = null; |
| 104 | - $lines[] = $objectReference . '->setInheritanceType(Mapping\InheritanceType::' . strtoupper($metadata->inheritanceType) . ');'; |
|
| 104 | + $lines[] = $objectReference.'->setInheritanceType(Mapping\InheritanceType::'.strtoupper($metadata->inheritanceType).');'; |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | if ($metadata->discriminatorColumn) { |
| 108 | 108 | $lines[] = null; |
| 109 | - $lines[] = $bodyIndentation . '// Discriminator mapping'; |
|
| 109 | + $lines[] = $bodyIndentation.'// Discriminator mapping'; |
|
| 110 | 110 | $lines[] = $this->exportDiscriminatorMetadata($metadata, $indentationLevel + 1); |
| 111 | 111 | } |
| 112 | 112 | |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | |
| 121 | 121 | if ($metadata->table) { |
| 122 | 122 | $lines[] = null; |
| 123 | - $lines[] = $bodyIndentation . '// Table'; |
|
| 123 | + $lines[] = $bodyIndentation.'// Table'; |
|
| 124 | 124 | $lines[] = $this->exportTableMetadata($metadata->table, $indentationLevel + 1); |
| 125 | 125 | } |
| 126 | 126 | |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | |
| 135 | 135 | foreach ($metadata->getDeclaredPropertiesIterator() as $name => $property) { |
| 136 | 136 | $lines[] = null; |
| 137 | - $lines[] = $bodyIndentation . '// Property: ' . $name; |
|
| 137 | + $lines[] = $bodyIndentation.'// Property: '.$name; |
|
| 138 | 138 | $lines[] = $this->exportProperty($property, $indentationLevel + 1); |
| 139 | 139 | } |
| 140 | 140 | |
@@ -144,16 +144,16 @@ discard block |
||
| 144 | 144 | private function exportLifecycleCallbacks(Mapping\ClassMetadata $metadata, int $indentationLevel) : string |
| 145 | 145 | { |
| 146 | 146 | $bodyIndentation = str_repeat(self::INDENTATION, $indentationLevel + 1); |
| 147 | - $objectReference = $bodyIndentation . self::VARIABLE; |
|
| 147 | + $objectReference = $bodyIndentation.self::VARIABLE; |
|
| 148 | 148 | $lines = []; |
| 149 | 149 | |
| 150 | 150 | if ($metadata->lifecycleCallbacks) { |
| 151 | 151 | $lines[] = null; |
| 152 | - $lines[] = $bodyIndentation . '// Lifecycle callbacks'; |
|
| 152 | + $lines[] = $bodyIndentation.'// Lifecycle callbacks'; |
|
| 153 | 153 | |
| 154 | 154 | foreach ($metadata->lifecycleCallbacks as $event => $callbacks) { |
| 155 | 155 | foreach ($callbacks as $callback) { |
| 156 | - $lines[] = $objectReference . '->addLifecycleCallback("' . $callback . '", "' . $event . '");'; |
|
| 156 | + $lines[] = $objectReference.'->addLifecycleCallback("'.$callback.'", "'.$event.'");'; |
|
| 157 | 157 | } |
| 158 | 158 | } |
| 159 | 159 | } |
@@ -166,17 +166,17 @@ discard block |
||
| 166 | 166 | $variableExporter = new VariableExporter(); |
| 167 | 167 | $discriminatorExporter = new DiscriminatorColumnMetadataExporter(); |
| 168 | 168 | $indentation = str_repeat(self::INDENTATION, $indentationLevel); |
| 169 | - $objectReference = $indentation . self::VARIABLE; |
|
| 169 | + $objectReference = $indentation.self::VARIABLE; |
|
| 170 | 170 | $lines = []; |
| 171 | 171 | |
| 172 | 172 | $lines[] = $discriminatorExporter->export($metadata->discriminatorColumn, $indentationLevel); |
| 173 | 173 | $lines[] = null; |
| 174 | - $lines[] = $objectReference . '->setDiscriminatorColumn(' . $discriminatorExporter::VARIABLE . ');'; |
|
| 174 | + $lines[] = $objectReference.'->setDiscriminatorColumn('.$discriminatorExporter::VARIABLE.');'; |
|
| 175 | 175 | |
| 176 | 176 | if ($metadata->discriminatorMap) { |
| 177 | 177 | $discriminatorMap = $variableExporter->export($metadata->discriminatorMap, $indentationLevel + 1); |
| 178 | 178 | |
| 179 | - $lines[] = $objectReference . '->setDiscriminatorMap(' . $discriminatorMap . ');'; |
|
| 179 | + $lines[] = $objectReference.'->setDiscriminatorMap('.$discriminatorMap.');'; |
|
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | return implode(PHP_EOL, $lines); |
@@ -186,12 +186,12 @@ discard block |
||
| 186 | 186 | { |
| 187 | 187 | $tableExporter = new TableMetadataExporter(); |
| 188 | 188 | $indentation = str_repeat(self::INDENTATION, $indentationLevel); |
| 189 | - $objectReference = $indentation . self::VARIABLE; |
|
| 189 | + $objectReference = $indentation.self::VARIABLE; |
|
| 190 | 190 | $lines = []; |
| 191 | 191 | |
| 192 | 192 | $lines[] = $tableExporter->export($table, $indentationLevel); |
| 193 | 193 | $lines[] = null; |
| 194 | - $lines[] = $objectReference . '->setTable(' . $tableExporter::VARIABLE . ');'; |
|
| 194 | + $lines[] = $objectReference.'->setTable('.$tableExporter::VARIABLE.');'; |
|
| 195 | 195 | |
| 196 | 196 | return implode(PHP_EOL, $lines); |
| 197 | 197 | } |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | private function exportProperty(Mapping\Property $property, int $indentationLevel) : string |
| 200 | 200 | { |
| 201 | 201 | $indentation = str_repeat(self::INDENTATION, $indentationLevel); |
| 202 | - $objectReference = $indentation . self::VARIABLE; |
|
| 202 | + $objectReference = $indentation.self::VARIABLE; |
|
| 203 | 203 | $lines = []; |
| 204 | 204 | |
| 205 | 205 | switch (true) { |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | |
| 235 | 235 | $lines[] = $propertyExporter->export($property, $indentationLevel); |
| 236 | 236 | $lines[] = null; |
| 237 | - $lines[] = $objectReference . '->addProperty(' . $propertyExporter::VARIABLE . ');'; |
|
| 237 | + $lines[] = $objectReference.'->addProperty('.$propertyExporter::VARIABLE.');'; |
|
| 238 | 238 | |
| 239 | 239 | return implode(PHP_EOL, $lines); |
| 240 | 240 | } |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | public function joinColumnName(string $propertyName, ?string $className = null) : string |
| 19 | 19 | { |
| 20 | 20 | return strtolower($this->classToTableName($className)) |
| 21 | - . '_' . $propertyName |
|
| 22 | - . '_' . $this->referenceColumnName(); |
|
| 21 | + . '_'.$propertyName |
|
| 22 | + . '_'.$this->referenceColumnName(); |
|
| 23 | 23 | } |
| 24 | 24 | } |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | $driver = new DatabaseDriver($sm); |
| 62 | 62 | |
| 63 | 63 | foreach ($driver->getAllClassNames() as $className) { |
| 64 | - if (! in_array(strtolower($className), $classNames, true)) { |
|
| 64 | + if ( ! in_array(strtolower($className), $classNames, true)) { |
|
| 65 | 65 | continue; |
| 66 | 66 | } |
| 67 | 67 | |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | if (count($metadataList) !== count($classNames)) { |
| 74 | - $this->fail("Have not found all classes matching the names '" . implode(', ', $classNames) . "' only tables " . implode(', ', array_keys($metadataList))); |
|
| 74 | + $this->fail("Have not found all classes matching the names '".implode(', ', $classNames)."' only tables ".implode(', ', array_keys($metadataList))); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | return $metadataList; |
@@ -25,13 +25,13 @@ discard block |
||
| 25 | 25 | { |
| 26 | 26 | $config = new Configuration(); |
| 27 | 27 | |
| 28 | - $config->setProxyDir(__DIR__ . '/../Tests/Proxies'); |
|
| 28 | + $config->setProxyDir(__DIR__.'/../Tests/Proxies'); |
|
| 29 | 29 | $config->setProxyNamespace('Doctrine\Tests\Proxies'); |
| 30 | 30 | $config->setAutoGenerateProxyClasses(StaticProxyFactory::AUTOGENERATE_EVAL); |
| 31 | 31 | $config->setMetadataDriverImpl( |
| 32 | 32 | $config->newDefaultAnnotationDriver([ |
| 33 | - realpath(__DIR__ . '/Models/Cache'), |
|
| 34 | - realpath(__DIR__ . '/Models/GeoNames'), |
|
| 33 | + realpath(__DIR__.'/Models/Cache'), |
|
| 34 | + realpath(__DIR__.'/Models/GeoNames'), |
|
| 35 | 35 | ]) |
| 36 | 36 | ); |
| 37 | 37 | |
@@ -53,15 +53,15 @@ discard block |
||
| 53 | 53 | { |
| 54 | 54 | $config = new Configuration(); |
| 55 | 55 | |
| 56 | - $config->setProxyDir(__DIR__ . '/../Tests/Proxies'); |
|
| 56 | + $config->setProxyDir(__DIR__.'/../Tests/Proxies'); |
|
| 57 | 57 | $config->setProxyNamespace('Doctrine\Tests\Proxies'); |
| 58 | 58 | $config->setAutoGenerateProxyClasses(ProxyFactory::AUTOGENERATE_EVAL); |
| 59 | 59 | $config->setMetadataDriverImpl( |
| 60 | 60 | $config->newDefaultAnnotationDriver( |
| 61 | 61 | [ |
| 62 | - realpath(__DIR__ . '/Models/Cache'), |
|
| 63 | - realpath(__DIR__ . '/Models/Generic'), |
|
| 64 | - realpath(__DIR__ . '/Models/GeoNames'), |
|
| 62 | + realpath(__DIR__.'/Models/Cache'), |
|
| 63 | + realpath(__DIR__.'/Models/Generic'), |
|
| 64 | + realpath(__DIR__.'/Models/GeoNames'), |
|
| 65 | 65 | ] |
| 66 | 66 | ) |
| 67 | 67 | ); |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | |
| 19 | 19 | protected function getReflectionService() : ReflectionService |
| 20 | 20 | { |
| 21 | - if (! $this->reflectionService) { |
|
| 21 | + if ( ! $this->reflectionService) { |
|
| 22 | 22 | $this->reflectionService = new StaticReflectionService(); |
| 23 | 23 | } |
| 24 | 24 | |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | |
| 19 | 19 | protected function getReflectionService() : ReflectionService |
| 20 | 20 | { |
| 21 | - if (! $this->reflectionService) { |
|
| 21 | + if ( ! $this->reflectionService) { |
|
| 22 | 22 | $this->reflectionService = new RuntimeReflectionService(); |
| 23 | 23 | } |
| 24 | 24 | |