@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | $this->_em->getClassMetadata(DDC3027Dog::class), |
28 | 28 | ] |
29 | 29 | ); |
30 | - } catch(\Exception $e) { |
|
30 | + } catch (\Exception $e) { |
|
31 | 31 | } |
32 | 32 | } |
33 | 33 | |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $this->assertEquals('United States of America', $person->address->country->name); |
83 | 83 | |
84 | 84 | // 4. check deleting works |
85 | - $personId = $person->id;; |
|
85 | + $personId = $person->id; ; |
|
86 | 86 | $this->_em->remove($person); |
87 | 87 | $this->_em->flush(); |
88 | 88 | |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | $this->_em->flush(); |
107 | 107 | $this->_em->clear(); |
108 | 108 | |
109 | - $dql = "SELECT p FROM " . __NAMESPACE__ . "\DDC93Person p"; |
|
109 | + $dql = "SELECT p FROM ".__NAMESPACE__."\DDC93Person p"; |
|
110 | 110 | $persons = $this->_em->createQuery($dql)->getResult(); |
111 | 111 | |
112 | 112 | $this->assertCount(3, $persons); |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | $this->assertEquals('United States of America', $person->address->country->name); |
120 | 120 | } |
121 | 121 | |
122 | - $dql = "SELECT p FROM " . __NAMESPACE__ . "\DDC93Person p"; |
|
122 | + $dql = "SELECT p FROM ".__NAMESPACE__."\DDC93Person p"; |
|
123 | 123 | $persons = $this->_em->createQuery($dql)->getArrayResult(); |
124 | 124 | |
125 | 125 | foreach ($persons as $person) { |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | $this->_em->flush(); |
145 | 145 | |
146 | 146 | // SELECT |
147 | - $selectDql = "SELECT p FROM " . __NAMESPACE__ ."\\DDC93Person p WHERE p.address.city = :city AND p.address.country.name = :country"; |
|
147 | + $selectDql = "SELECT p FROM ".__NAMESPACE__."\\DDC93Person p WHERE p.address.city = :city AND p.address.country.name = :country"; |
|
148 | 148 | $loadedPerson = $this->_em->createQuery($selectDql) |
149 | 149 | ->setParameter('city', 'Karlsruhe') |
150 | 150 | ->setParameter('country', 'Germany') |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | ); |
160 | 160 | |
161 | 161 | // UPDATE |
162 | - $updateDql = "UPDATE " . __NAMESPACE__ . "\\DDC93Person p SET p.address.street = :street, p.address.country.name = :country WHERE p.address.city = :city"; |
|
162 | + $updateDql = "UPDATE ".__NAMESPACE__."\\DDC93Person p SET p.address.street = :street, p.address.country.name = :country WHERE p.address.city = :city"; |
|
163 | 163 | $this->_em->createQuery($updateDql) |
164 | 164 | ->setParameter('street', 'Boo') |
165 | 165 | ->setParameter('country', 'DE') |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | $this->assertEquals('DE', $person->address->country->name); |
172 | 172 | |
173 | 173 | // DELETE |
174 | - $this->_em->createQuery("DELETE " . __NAMESPACE__ . "\\DDC93Person p WHERE p.address.city = :city AND p.address.country.name = :country") |
|
174 | + $this->_em->createQuery("DELETE ".__NAMESPACE__."\\DDC93Person p WHERE p.address.city = :city AND p.address.country.name = :country") |
|
175 | 175 | ->setParameter('city', 'Karlsruhe') |
176 | 176 | ->setParameter('country', 'DE') |
177 | 177 | ->execute(); |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | $this->_em->clear(); |
189 | 189 | |
190 | 190 | // Prove that the entity was persisted correctly. |
191 | - $dql = "SELECT p FROM " . __NAMESPACE__ ."\\DDC93Person p WHERE p.name = :name"; |
|
191 | + $dql = "SELECT p FROM ".__NAMESPACE__."\\DDC93Person p WHERE p.name = :name"; |
|
192 | 192 | |
193 | 193 | $person = $this->_em->createQuery($dql) |
194 | 194 | ->setParameter('name', 'Karl') |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | // Clear the EM and prove that the embeddable can be the subject of a partial query. |
203 | 203 | $this->_em->clear(); |
204 | 204 | |
205 | - $dql = "SELECT PARTIAL p.{id,address.city} FROM " . __NAMESPACE__ ."\\DDC93Person p WHERE p.name = :name"; |
|
205 | + $dql = "SELECT PARTIAL p.{id,address.city} FROM ".__NAMESPACE__."\\DDC93Person p WHERE p.name = :name"; |
|
206 | 206 | |
207 | 207 | $person = $this->_em->createQuery($dql) |
208 | 208 | ->setParameter('name', 'Karl') |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | // Clear the EM and prove that the embeddable can be the subject of a partial query regardless of attributes positions. |
219 | 219 | $this->_em->clear(); |
220 | 220 | |
221 | - $dql = "SELECT PARTIAL p.{address.city, id} FROM " . __NAMESPACE__ ."\\DDC93Person p WHERE p.name = :name"; |
|
221 | + $dql = "SELECT PARTIAL p.{address.city, id} FROM ".__NAMESPACE__."\\DDC93Person p WHERE p.name = :name"; |
|
222 | 222 | |
223 | 223 | $person = $this->_em->createQuery($dql) |
224 | 224 | ->setParameter('name', 'Karl') |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | $this->expectException(QueryException::class); |
238 | 238 | $this->expectExceptionMessage('no field or association named address.asdfasdf'); |
239 | 239 | |
240 | - $this->_em->createQuery("SELECT p FROM " . __NAMESPACE__ . "\\DDC93Person p WHERE p.address.asdfasdf IS NULL") |
|
240 | + $this->_em->createQuery("SELECT p FROM ".__NAMESPACE__."\\DDC93Person p WHERE p.address.asdfasdf IS NULL") |
|
241 | 241 | ->execute(); |
242 | 242 | } |
243 | 243 | |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | $this->expectException(QueryException::class); |
247 | 247 | $this->expectExceptionMessage("no mapped field named 'address.asdfasdf'"); |
248 | 248 | |
249 | - $this->_em->createQuery("SELECT PARTIAL p.{id,address.asdfasdf} FROM " . __NAMESPACE__ . "\\DDC93Person p") |
|
249 | + $this->_em->createQuery("SELECT PARTIAL p.{id,address.asdfasdf} FROM ".__NAMESPACE__."\\DDC93Person p") |
|
250 | 250 | ->execute(); |
251 | 251 | } |
252 | 252 | |
@@ -308,15 +308,15 @@ discard block |
||
308 | 308 | $this->expectException(MappingException::class); |
309 | 309 | $this->expectExceptionMessage( |
310 | 310 | sprintf( |
311 | - 'Infinite nesting detected for embedded property %s::nested. ' . |
|
311 | + 'Infinite nesting detected for embedded property %s::nested. '. |
|
312 | 312 | 'You cannot embed an embeddable from the same type inside an embeddable.', |
313 | - __NAMESPACE__ . '\\' . $declaredEmbeddableClassName |
|
313 | + __NAMESPACE__.'\\'.$declaredEmbeddableClassName |
|
314 | 314 | ) |
315 | 315 | ); |
316 | 316 | |
317 | 317 | $this->_schemaTool->createSchema( |
318 | 318 | [ |
319 | - $this->_em->getClassMetadata(__NAMESPACE__ . '\\' . $embeddableClassName), |
|
319 | + $this->_em->getClassMetadata(__NAMESPACE__.'\\'.$embeddableClassName), |
|
320 | 320 | ] |
321 | 321 | ); |
322 | 322 | } |
@@ -42,7 +42,7 @@ |
||
42 | 42 | $this->_em->persist($user); |
43 | 43 | $this->_em->flush(); |
44 | 44 | |
45 | - $repository = $this->_em->getRepository(__NAMESPACE__ . "\DDC2984User"); |
|
45 | + $repository = $this->_em->getRepository(__NAMESPACE__."\DDC2984User"); |
|
46 | 46 | |
47 | 47 | $sameUser = $repository->find(new DDC2984DomainUserId('unique_id_within_a_vo')); |
48 | 48 |
@@ -61,7 +61,7 @@ |
||
61 | 61 | protected function execute(InputInterface $input, OutputInterface $output) |
62 | 62 | { |
63 | 63 | $ui = new SymfonyStyle($input, $output); |
64 | - $ui->warning('Command ' . $this->getName() . ' is deprecated and will be removed in Doctrine 3.0.'); |
|
64 | + $ui->warning('Command '.$this->getName().' is deprecated and will be removed in Doctrine 3.0.'); |
|
65 | 65 | |
66 | 66 | $em = $this->getHelper('em')->getEntityManager(); |
67 | 67 |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | protected function execute(InputInterface $input, OutputInterface $output) |
121 | 121 | { |
122 | 122 | $ui = new SymfonyStyle($input, $output); |
123 | - $ui->warning('Command ' . $this->getName() . ' is deprecated and will be removed in Doctrine 3.0.'); |
|
123 | + $ui->warning('Command '.$this->getName().' is deprecated and will be removed in Doctrine 3.0.'); |
|
124 | 124 | |
125 | 125 | // Process source directories |
126 | 126 | $fromPaths = array_merge([$input->getArgument('from-path')], $input->getOption('from')); |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | $exporter->setMetadata($metadata); |
203 | 203 | $exporter->export(); |
204 | 204 | |
205 | - $output->writeln(PHP_EOL . sprintf( |
|
205 | + $output->writeln(PHP_EOL.sprintf( |
|
206 | 206 | 'Converting Doctrine 1.X schema to "<info>%s</info>" mapping type in "<info>%s</info>"', $toType, $destPath |
207 | 207 | )); |
208 | 208 | } else { |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | protected function execute(InputInterface $input, OutputInterface $output) |
90 | 90 | { |
91 | 91 | $ui = new SymfonyStyle($input, $output); |
92 | - $ui->warning('Command ' . $this->getName() . ' is deprecated and will be removed in Doctrine 3.0.'); |
|
92 | + $ui->warning('Command '.$this->getName().' is deprecated and will be removed in Doctrine 3.0.'); |
|
93 | 93 | |
94 | 94 | $em = $this->getHelper('em')->getEntityManager(); |
95 | 95 | |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | $entityGenerator->setRegenerateEntityIfExists($input->getOption('regenerate-entities')); |
126 | 126 | $entityGenerator->setUpdateEntityIfExists($input->getOption('update-entities')); |
127 | 127 | $entityGenerator->setNumSpaces($input->getOption('num-spaces')); |
128 | - $entityGenerator->setBackupExisting(!$input->getOption('no-backup')); |
|
128 | + $entityGenerator->setBackupExisting( ! $input->getOption('no-backup')); |
|
129 | 129 | |
130 | 130 | if (($extend = $input->getOption('extend')) !== null) { |
131 | 131 | $entityGenerator->setClassToExtend($extend); |
@@ -42,7 +42,7 @@ |
||
42 | 42 | |
43 | 43 | public function __construct() |
44 | 44 | { |
45 | - @trigger_error(self::class . ' is deprecated and will be removed in Doctrine 3.0', E_USER_DEPRECATED); |
|
45 | + @trigger_error(self::class.' is deprecated and will be removed in Doctrine 3.0', E_USER_DEPRECATED); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | */ |
60 | 60 | public function __construct($dir = null) |
61 | 61 | { |
62 | - @trigger_error(static::class . ' is deprecated and will be removed in Doctrine 3.0', E_USER_DEPRECATED); |
|
62 | + @trigger_error(static::class.' is deprecated and will be removed in Doctrine 3.0', E_USER_DEPRECATED); |
|
63 | 63 | |
64 | 64 | $this->_outputDir = $dir; |
65 | 65 | } |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | if ( ! is_dir($dir)) { |
146 | 146 | mkdir($dir, 0775, true); |
147 | 147 | } |
148 | - if (file_exists($path) && !$this->_overwriteExistingFiles) { |
|
148 | + if (file_exists($path) && ! $this->_overwriteExistingFiles) { |
|
149 | 149 | throw ExportException::attemptOverwriteExistingFile($path); |
150 | 150 | } |
151 | 151 | file_put_contents($path, $output); |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | */ |
164 | 164 | protected function _generateOutputPath(ClassMetadataInfo $metadata) |
165 | 165 | { |
166 | - return $this->_outputDir . '/' . str_replace('\\', '.', $metadata->name) . $this->_extension; |
|
166 | + return $this->_outputDir.'/'.str_replace('\\', '.', $metadata->name).$this->_extension; |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | /** |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | |
55 | 55 | public function __construct() |
56 | 56 | { |
57 | - @trigger_error(self::class . ' is deprecated and will be removed in Doctrine 3.0', E_USER_DEPRECATED); |
|
57 | + @trigger_error(self::class.' is deprecated and will be removed in Doctrine 3.0', E_USER_DEPRECATED); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | { |
119 | 119 | $namespace = $this->getClassNamespace($fullClassName); |
120 | 120 | |
121 | - return $namespace ? 'namespace ' . $namespace . ';' : ''; |
|
121 | + return $namespace ? 'namespace '.$namespace.';' : ''; |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | /** |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | $repositoryName = $this->repositoryName ?: EntityRepository::class; |
134 | 134 | |
135 | 135 | if ($namespace && $repositoryName[0] !== '\\') { |
136 | - $repositoryName = '\\' . $repositoryName; |
|
136 | + $repositoryName = '\\'.$repositoryName; |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | return $repositoryName; |
@@ -149,8 +149,8 @@ discard block |
||
149 | 149 | { |
150 | 150 | $code = $this->generateEntityRepositoryClass($fullClassName); |
151 | 151 | |
152 | - $path = $outputDirectory . DIRECTORY_SEPARATOR |
|
153 | - . str_replace('\\', \DIRECTORY_SEPARATOR, $fullClassName) . '.php'; |
|
152 | + $path = $outputDirectory.DIRECTORY_SEPARATOR |
|
153 | + . str_replace('\\', \DIRECTORY_SEPARATOR, $fullClassName).'.php'; |
|
154 | 154 | $dir = dirname($path); |
155 | 155 | |
156 | 156 | if ( ! is_dir($dir)) { |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | */ |
339 | 339 | public function __construct() |
340 | 340 | { |
341 | - @trigger_error(self::class . ' is deprecated and will be removed in Doctrine 3.0', E_USER_DEPRECATED); |
|
341 | + @trigger_error(self::class.' is deprecated and will be removed in Doctrine 3.0', E_USER_DEPRECATED); |
|
342 | 342 | |
343 | 343 | if (version_compare(\Doctrine\Common\Version::VERSION, '2.2.0-DEV', '>=')) { |
344 | 344 | $this->annotationsPrefix = 'ORM\\'; |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | */ |
373 | 373 | public function writeEntityClass(ClassMetadataInfo $metadata, $outputDirectory) |
374 | 374 | { |
375 | - $path = $outputDirectory . '/' . str_replace('\\', DIRECTORY_SEPARATOR, $metadata->name) . $this->extension; |
|
375 | + $path = $outputDirectory.'/'.str_replace('\\', DIRECTORY_SEPARATOR, $metadata->name).$this->extension; |
|
376 | 376 | $dir = dirname($path); |
377 | 377 | |
378 | 378 | if ( ! is_dir($dir)) { |
@@ -388,8 +388,8 @@ discard block |
||
388 | 388 | } |
389 | 389 | |
390 | 390 | if ($this->backupExisting && file_exists($path)) { |
391 | - $backupPath = dirname($path) . DIRECTORY_SEPARATOR . basename($path) . "~"; |
|
392 | - if (!copy($path, $backupPath)) { |
|
391 | + $backupPath = dirname($path).DIRECTORY_SEPARATOR.basename($path)."~"; |
|
392 | + if ( ! copy($path, $backupPath)) { |
|
393 | 393 | throw new \RuntimeException("Attempt to backup overwritten entity file but copy operation failed."); |
394 | 394 | } |
395 | 395 | } |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | $body = str_replace('<spaces>', $this->spaces, $body); |
451 | 451 | $last = strrpos($currentCode, '}'); |
452 | 452 | |
453 | - return substr($currentCode, 0, $last) . $body . ($body ? "\n" : '') . "}\n"; |
|
453 | + return substr($currentCode, 0, $last).$body.($body ? "\n" : '')."}\n"; |
|
454 | 454 | } |
455 | 455 | |
456 | 456 | /** |
@@ -514,7 +514,7 @@ discard block |
||
514 | 514 | public function setFieldVisibility($visibility) |
515 | 515 | { |
516 | 516 | if ($visibility !== static::FIELD_VISIBLE_PRIVATE && $visibility !== static::FIELD_VISIBLE_PROTECTED) { |
517 | - throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): ' . $visibility); |
|
517 | + throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): '.$visibility); |
|
518 | 518 | } |
519 | 519 | |
520 | 520 | $this->fieldVisibility = $visibility; |
@@ -611,11 +611,11 @@ discard block |
||
611 | 611 | */ |
612 | 612 | protected function generateEntityNamespace(ClassMetadataInfo $metadata) |
613 | 613 | { |
614 | - if (! $this->hasNamespace($metadata)) { |
|
614 | + if ( ! $this->hasNamespace($metadata)) { |
|
615 | 615 | return ''; |
616 | 616 | } |
617 | 617 | |
618 | - return 'namespace ' . $this->getNamespace($metadata) .';'; |
|
618 | + return 'namespace '.$this->getNamespace($metadata).';'; |
|
619 | 619 | } |
620 | 620 | |
621 | 621 | /** |
@@ -623,7 +623,7 @@ discard block |
||
623 | 623 | */ |
624 | 624 | protected function generateEntityUse() |
625 | 625 | { |
626 | - if (! $this->generateAnnotations) { |
|
626 | + if ( ! $this->generateAnnotations) { |
|
627 | 627 | return ''; |
628 | 628 | } |
629 | 629 | |
@@ -637,8 +637,8 @@ discard block |
||
637 | 637 | */ |
638 | 638 | protected function generateEntityClassName(ClassMetadataInfo $metadata) |
639 | 639 | { |
640 | - return 'class ' . $this->getClassName($metadata) . |
|
641 | - ($this->extendsClass() ? ' extends ' . $this->getClassToExtendName() : null); |
|
640 | + return 'class '.$this->getClassName($metadata). |
|
641 | + ($this->extendsClass() ? ' extends '.$this->getClassToExtendName() : null); |
|
642 | 642 | } |
643 | 643 | |
644 | 644 | /** |
@@ -740,13 +740,13 @@ discard block |
||
740 | 740 | $fieldMappings = array_merge($requiredFields, $optionalFields); |
741 | 741 | |
742 | 742 | foreach ($metadata->embeddedClasses as $fieldName => $embeddedClass) { |
743 | - $paramType = '\\' . ltrim($embeddedClass['class'], '\\'); |
|
744 | - $paramVariable = '$' . $fieldName; |
|
743 | + $paramType = '\\'.ltrim($embeddedClass['class'], '\\'); |
|
744 | + $paramVariable = '$'.$fieldName; |
|
745 | 745 | |
746 | 746 | $paramTypes[] = $paramType; |
747 | 747 | $paramVariables[] = $paramVariable; |
748 | - $params[] = $paramType . ' ' . $paramVariable; |
|
749 | - $fields[] = '$this->' . $fieldName . ' = ' . $paramVariable . ';'; |
|
748 | + $params[] = $paramType.' '.$paramVariable; |
|
749 | + $fields[] = '$this->'.$fieldName.' = '.$paramVariable.';'; |
|
750 | 750 | } |
751 | 751 | |
752 | 752 | foreach ($fieldMappings as $fieldMapping) { |
@@ -754,27 +754,27 @@ discard block |
||
754 | 754 | continue; |
755 | 755 | } |
756 | 756 | |
757 | - $paramTypes[] = $this->getType($fieldMapping['type']) . (!empty($fieldMapping['nullable']) ? '|null' : ''); |
|
758 | - $param = '$' . $fieldMapping['fieldName']; |
|
757 | + $paramTypes[] = $this->getType($fieldMapping['type']).( ! empty($fieldMapping['nullable']) ? '|null' : ''); |
|
758 | + $param = '$'.$fieldMapping['fieldName']; |
|
759 | 759 | $paramVariables[] = $param; |
760 | 760 | |
761 | 761 | if ($fieldMapping['type'] === 'datetime') { |
762 | - $param = $this->getType($fieldMapping['type']) . ' ' . $param; |
|
762 | + $param = $this->getType($fieldMapping['type']).' '.$param; |
|
763 | 763 | } |
764 | 764 | |
765 | - if (!empty($fieldMapping['nullable'])) { |
|
765 | + if ( ! empty($fieldMapping['nullable'])) { |
|
766 | 766 | $param .= ' = null'; |
767 | 767 | } |
768 | 768 | |
769 | 769 | $params[] = $param; |
770 | 770 | |
771 | - $fields[] = '$this->' . $fieldMapping['fieldName'] . ' = $' . $fieldMapping['fieldName'] . ';'; |
|
771 | + $fields[] = '$this->'.$fieldMapping['fieldName'].' = $'.$fieldMapping['fieldName'].';'; |
|
772 | 772 | } |
773 | 773 | |
774 | 774 | $maxParamTypeLength = max(array_map('strlen', $paramTypes)); |
775 | 775 | $paramTags = array_map( |
776 | - function ($type, $variable) use ($maxParamTypeLength) { |
|
777 | - return '@param ' . $type . str_repeat(' ', $maxParamTypeLength - strlen($type) + 1) . $variable; |
|
776 | + function($type, $variable) use ($maxParamTypeLength) { |
|
777 | + return '@param '.$type.str_repeat(' ', $maxParamTypeLength - strlen($type) + 1).$variable; |
|
778 | 778 | }, |
779 | 779 | $paramTypes, |
780 | 780 | $paramVariables |
@@ -782,8 +782,8 @@ discard block |
||
782 | 782 | |
783 | 783 | // Generate multi line constructor if the signature exceeds 120 characters. |
784 | 784 | if (array_sum(array_map('strlen', $params)) + count($params) * 2 + 29 > 120) { |
785 | - $delimiter = "\n" . $this->spaces; |
|
786 | - $params = $delimiter . implode(',' . $delimiter, $params) . "\n"; |
|
785 | + $delimiter = "\n".$this->spaces; |
|
786 | + $params = $delimiter.implode(','.$delimiter, $params)."\n"; |
|
787 | 787 | } else { |
788 | 788 | $params = implode(', ', $params); |
789 | 789 | } |
@@ -791,7 +791,7 @@ discard block |
||
791 | 791 | $replacements = [ |
792 | 792 | '<paramTags>' => implode("\n * ", $paramTags), |
793 | 793 | '<params>' => $params, |
794 | - '<fields>' => implode("\n" . $this->spaces, $fields), |
|
794 | + '<fields>' => implode("\n".$this->spaces, $fields), |
|
795 | 795 | ]; |
796 | 796 | |
797 | 797 | $constructor = str_replace( |
@@ -836,7 +836,7 @@ discard block |
||
836 | 836 | |
837 | 837 | if ($inClass) { |
838 | 838 | $inClass = false; |
839 | - $lastSeenClass = $lastSeenNamespace . ($lastSeenNamespace ? '\\' : '') . $token[1]; |
|
839 | + $lastSeenClass = $lastSeenNamespace.($lastSeenNamespace ? '\\' : '').$token[1]; |
|
840 | 840 | $this->staticReflection[$lastSeenClass]['properties'] = []; |
841 | 841 | $this->staticReflection[$lastSeenClass]['methods'] = []; |
842 | 842 | } |
@@ -844,16 +844,16 @@ discard block |
||
844 | 844 | if (T_NAMESPACE === $token[0]) { |
845 | 845 | $lastSeenNamespace = ''; |
846 | 846 | $inNamespace = true; |
847 | - } elseif (T_CLASS === $token[0] && T_DOUBLE_COLON !== $tokens[$i-1][0]) { |
|
847 | + } elseif (T_CLASS === $token[0] && T_DOUBLE_COLON !== $tokens[$i - 1][0]) { |
|
848 | 848 | $inClass = true; |
849 | 849 | } elseif (T_FUNCTION === $token[0]) { |
850 | - if (T_STRING === $tokens[$i+2][0]) { |
|
851 | - $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+2][1]); |
|
852 | - } elseif ($tokens[$i+2] == '&' && T_STRING === $tokens[$i+3][0]) { |
|
853 | - $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+3][1]); |
|
850 | + if (T_STRING === $tokens[$i + 2][0]) { |
|
851 | + $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 2][1]); |
|
852 | + } elseif ($tokens[$i + 2] == '&' && T_STRING === $tokens[$i + 3][0]) { |
|
853 | + $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 3][1]); |
|
854 | 854 | } |
855 | - } elseif (in_array($token[0], [T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED], true) && T_FUNCTION !== $tokens[$i+2][0]) { |
|
856 | - $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i+2][1], 1); |
|
855 | + } elseif (in_array($token[0], [T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED], true) && T_FUNCTION !== $tokens[$i + 2][0]) { |
|
856 | + $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i + 2][1], 1); |
|
857 | 857 | } |
858 | 858 | } |
859 | 859 | } |
@@ -866,7 +866,7 @@ discard block |
||
866 | 866 | */ |
867 | 867 | protected function hasProperty($property, ClassMetadataInfo $metadata) |
868 | 868 | { |
869 | - if ($this->extendsClass() || (!$this->isNew && class_exists($metadata->name))) { |
|
869 | + if ($this->extendsClass() || ( ! $this->isNew && class_exists($metadata->name))) { |
|
870 | 870 | // don't generate property if its already on the base class. |
871 | 871 | $reflClass = new \ReflectionClass($this->getClassToExtend() ?: $metadata->name); |
872 | 872 | if ($reflClass->hasProperty($property)) { |
@@ -895,7 +895,7 @@ discard block |
||
895 | 895 | */ |
896 | 896 | protected function hasMethod($method, ClassMetadataInfo $metadata) |
897 | 897 | { |
898 | - if ($this->extendsClass() || (!$this->isNew && class_exists($metadata->name))) { |
|
898 | + if ($this->extendsClass() || ( ! $this->isNew && class_exists($metadata->name))) { |
|
899 | 899 | // don't generate method if its already on the base class. |
900 | 900 | $reflClass = new \ReflectionClass($this->getClassToExtend() ?: $metadata->name); |
901 | 901 | |
@@ -926,7 +926,7 @@ discard block |
||
926 | 926 | */ |
927 | 927 | protected function getTraits(ClassMetadataInfo $metadata) |
928 | 928 | { |
929 | - if (! ($metadata->reflClass !== null || class_exists($metadata->name))) { |
|
929 | + if ( ! ($metadata->reflClass !== null || class_exists($metadata->name))) { |
|
930 | 930 | return []; |
931 | 931 | } |
932 | 932 | |
@@ -976,7 +976,7 @@ discard block |
||
976 | 976 | { |
977 | 977 | $refl = new \ReflectionClass($this->getClassToExtend()); |
978 | 978 | |
979 | - return '\\' . $refl->getName(); |
|
979 | + return '\\'.$refl->getName(); |
|
980 | 980 | } |
981 | 981 | |
982 | 982 | /** |
@@ -1009,7 +1009,7 @@ discard block |
||
1009 | 1009 | { |
1010 | 1010 | $lines = []; |
1011 | 1011 | $lines[] = '/**'; |
1012 | - $lines[] = ' * ' . $this->getClassName($metadata); |
|
1012 | + $lines[] = ' * '.$this->getClassName($metadata); |
|
1013 | 1013 | |
1014 | 1014 | if ($this->generateAnnotations) { |
1015 | 1015 | $lines[] = ' *'; |
@@ -1025,12 +1025,12 @@ discard block |
||
1025 | 1025 | |
1026 | 1026 | foreach ($methods as $method) { |
1027 | 1027 | if ($code = $this->$method($metadata)) { |
1028 | - $lines[] = ' * ' . $code; |
|
1028 | + $lines[] = ' * '.$code; |
|
1029 | 1029 | } |
1030 | 1030 | } |
1031 | 1031 | |
1032 | 1032 | if (isset($metadata->lifecycleCallbacks) && $metadata->lifecycleCallbacks) { |
1033 | - $lines[] = ' * @' . $this->annotationsPrefix . 'HasLifecycleCallbacks'; |
|
1033 | + $lines[] = ' * @'.$this->annotationsPrefix.'HasLifecycleCallbacks'; |
|
1034 | 1034 | } |
1035 | 1035 | } |
1036 | 1036 | |
@@ -1046,17 +1046,17 @@ discard block |
||
1046 | 1046 | */ |
1047 | 1047 | protected function generateEntityAnnotation(ClassMetadataInfo $metadata) |
1048 | 1048 | { |
1049 | - $prefix = '@' . $this->annotationsPrefix; |
|
1049 | + $prefix = '@'.$this->annotationsPrefix; |
|
1050 | 1050 | |
1051 | 1051 | if ($metadata->isEmbeddedClass) { |
1052 | - return $prefix . 'Embeddable'; |
|
1052 | + return $prefix.'Embeddable'; |
|
1053 | 1053 | } |
1054 | 1054 | |
1055 | 1055 | $customRepository = $metadata->customRepositoryClassName |
1056 | - ? '(repositoryClass="' . $metadata->customRepositoryClassName . '")' |
|
1056 | + ? '(repositoryClass="'.$metadata->customRepositoryClassName.'")' |
|
1057 | 1057 | : ''; |
1058 | 1058 | |
1059 | - return $prefix . ($metadata->isMappedSuperclass ? 'MappedSuperclass' : 'Entity') . $customRepository; |
|
1059 | + return $prefix.($metadata->isMappedSuperclass ? 'MappedSuperclass' : 'Entity').$customRepository; |
|
1060 | 1060 | } |
1061 | 1061 | |
1062 | 1062 | /** |
@@ -1073,28 +1073,28 @@ discard block |
||
1073 | 1073 | $table = []; |
1074 | 1074 | |
1075 | 1075 | if (isset($metadata->table['schema'])) { |
1076 | - $table[] = 'schema="' . $metadata->table['schema'] . '"'; |
|
1076 | + $table[] = 'schema="'.$metadata->table['schema'].'"'; |
|
1077 | 1077 | } |
1078 | 1078 | |
1079 | 1079 | if (isset($metadata->table['name'])) { |
1080 | - $table[] = 'name="' . $metadata->table['name'] . '"'; |
|
1080 | + $table[] = 'name="'.$metadata->table['name'].'"'; |
|
1081 | 1081 | } |
1082 | 1082 | |
1083 | 1083 | if (isset($metadata->table['options']) && $metadata->table['options']) { |
1084 | - $table[] = 'options={' . $this->exportTableOptions((array) $metadata->table['options']) . '}'; |
|
1084 | + $table[] = 'options={'.$this->exportTableOptions((array) $metadata->table['options']).'}'; |
|
1085 | 1085 | } |
1086 | 1086 | |
1087 | 1087 | if (isset($metadata->table['uniqueConstraints']) && $metadata->table['uniqueConstraints']) { |
1088 | 1088 | $constraints = $this->generateTableConstraints('UniqueConstraint', $metadata->table['uniqueConstraints']); |
1089 | - $table[] = 'uniqueConstraints={' . $constraints . '}'; |
|
1089 | + $table[] = 'uniqueConstraints={'.$constraints.'}'; |
|
1090 | 1090 | } |
1091 | 1091 | |
1092 | 1092 | if (isset($metadata->table['indexes']) && $metadata->table['indexes']) { |
1093 | 1093 | $constraints = $this->generateTableConstraints('Index', $metadata->table['indexes']); |
1094 | - $table[] = 'indexes={' . $constraints . '}'; |
|
1094 | + $table[] = 'indexes={'.$constraints.'}'; |
|
1095 | 1095 | } |
1096 | 1096 | |
1097 | - return '@' . $this->annotationsPrefix . 'Table(' . implode(', ', $table) . ')'; |
|
1097 | + return '@'.$this->annotationsPrefix.'Table('.implode(', ', $table).')'; |
|
1098 | 1098 | } |
1099 | 1099 | |
1100 | 1100 | /** |
@@ -1109,9 +1109,9 @@ discard block |
||
1109 | 1109 | foreach ($constraints as $name => $constraint) { |
1110 | 1110 | $columns = []; |
1111 | 1111 | foreach ($constraint['columns'] as $column) { |
1112 | - $columns[] = '"' . $column . '"'; |
|
1112 | + $columns[] = '"'.$column.'"'; |
|
1113 | 1113 | } |
1114 | - $annotations[] = '@' . $this->annotationsPrefix . $constraintName . '(name="' . $name . '", columns={' . implode(', ', $columns) . '})'; |
|
1114 | + $annotations[] = '@'.$this->annotationsPrefix.$constraintName.'(name="'.$name.'", columns={'.implode(', ', $columns).'})'; |
|
1115 | 1115 | } |
1116 | 1116 | |
1117 | 1117 | return implode(', ', $annotations); |
@@ -1128,7 +1128,7 @@ discard block |
||
1128 | 1128 | return ''; |
1129 | 1129 | } |
1130 | 1130 | |
1131 | - return '@' . $this->annotationsPrefix . 'InheritanceType("'.$this->getInheritanceTypeString($metadata->inheritanceType).'")'; |
|
1131 | + return '@'.$this->annotationsPrefix.'InheritanceType("'.$this->getInheritanceTypeString($metadata->inheritanceType).'")'; |
|
1132 | 1132 | } |
1133 | 1133 | |
1134 | 1134 | /** |
@@ -1143,11 +1143,11 @@ discard block |
||
1143 | 1143 | } |
1144 | 1144 | |
1145 | 1145 | $discrColumn = $metadata->discriminatorColumn; |
1146 | - $columnDefinition = 'name="' . $discrColumn['name'] |
|
1147 | - . '", type="' . $discrColumn['type'] |
|
1148 | - . '", length=' . $discrColumn['length']; |
|
1146 | + $columnDefinition = 'name="'.$discrColumn['name'] |
|
1147 | + . '", type="'.$discrColumn['type'] |
|
1148 | + . '", length='.$discrColumn['length']; |
|
1149 | 1149 | |
1150 | - return '@' . $this->annotationsPrefix . 'DiscriminatorColumn(' . $columnDefinition . ')'; |
|
1150 | + return '@'.$this->annotationsPrefix.'DiscriminatorColumn('.$columnDefinition.')'; |
|
1151 | 1151 | } |
1152 | 1152 | |
1153 | 1153 | /** |
@@ -1164,10 +1164,10 @@ discard block |
||
1164 | 1164 | $inheritanceClassMap = []; |
1165 | 1165 | |
1166 | 1166 | foreach ($metadata->discriminatorMap as $type => $class) { |
1167 | - $inheritanceClassMap[] .= '"' . $type . '" = "' . $class . '"'; |
|
1167 | + $inheritanceClassMap[] .= '"'.$type.'" = "'.$class.'"'; |
|
1168 | 1168 | } |
1169 | 1169 | |
1170 | - return '@' . $this->annotationsPrefix . 'DiscriminatorMap({' . implode(', ', $inheritanceClassMap) . '})'; |
|
1170 | + return '@'.$this->annotationsPrefix.'DiscriminatorMap({'.implode(', ', $inheritanceClassMap).'})'; |
|
1171 | 1171 | } |
1172 | 1172 | |
1173 | 1173 | /** |
@@ -1186,8 +1186,8 @@ discard block |
||
1186 | 1186 | |
1187 | 1187 | $nullableField = $this->nullableFieldExpression($fieldMapping); |
1188 | 1188 | |
1189 | - if ((!$metadata->isEmbeddedClass || !$this->embeddablesImmutable) |
|
1190 | - && (!isset($fieldMapping['id']) || ! $fieldMapping['id'] || $metadata->generatorType === ClassMetadataInfo::GENERATOR_TYPE_NONE) |
|
1189 | + if (( ! $metadata->isEmbeddedClass || ! $this->embeddablesImmutable) |
|
1190 | + && ( ! isset($fieldMapping['id']) || ! $fieldMapping['id'] || $metadata->generatorType === ClassMetadataInfo::GENERATOR_TYPE_NONE) |
|
1191 | 1191 | && $code = $this->generateEntityStubMethod($metadata, 'set', $fieldMapping['fieldName'], $fieldMapping['type'], $nullableField) |
1192 | 1192 | ) { |
1193 | 1193 | $methods[] = $code; |
@@ -1258,7 +1258,7 @@ discard block |
||
1258 | 1258 | } |
1259 | 1259 | |
1260 | 1260 | foreach ($joinColumns as $joinColumn) { |
1261 | - if (isset($joinColumn['nullable']) && !$joinColumn['nullable']) { |
|
1261 | + if (isset($joinColumn['nullable']) && ! $joinColumn['nullable']) { |
|
1262 | 1262 | return false; |
1263 | 1263 | } |
1264 | 1264 | } |
@@ -1303,8 +1303,8 @@ discard block |
||
1303 | 1303 | } |
1304 | 1304 | |
1305 | 1305 | $lines[] = $this->generateAssociationMappingPropertyDocBlock($associationMapping, $metadata); |
1306 | - $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $associationMapping['fieldName'] |
|
1307 | - . ($associationMapping['type'] == 'manyToMany' ? ' = array()' : null) . ";\n"; |
|
1306 | + $lines[] = $this->spaces.$this->fieldVisibility.' $'.$associationMapping['fieldName'] |
|
1307 | + . ($associationMapping['type'] == 'manyToMany' ? ' = array()' : null).";\n"; |
|
1308 | 1308 | } |
1309 | 1309 | |
1310 | 1310 | return implode("\n", $lines); |
@@ -1328,8 +1328,8 @@ discard block |
||
1328 | 1328 | } |
1329 | 1329 | |
1330 | 1330 | $lines[] = $this->generateFieldMappingPropertyDocBlock($fieldMapping, $metadata); |
1331 | - $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $fieldMapping['fieldName'] |
|
1332 | - . (isset($fieldMapping['options']['default']) ? ' = ' . var_export($fieldMapping['options']['default'], true) : null) . ";\n"; |
|
1331 | + $lines[] = $this->spaces.$this->fieldVisibility.' $'.$fieldMapping['fieldName'] |
|
1332 | + . (isset($fieldMapping['options']['default']) ? ' = '.var_export($fieldMapping['options']['default'], true) : null).";\n"; |
|
1333 | 1333 | } |
1334 | 1334 | |
1335 | 1335 | return implode("\n", $lines); |
@@ -1350,7 +1350,7 @@ discard block |
||
1350 | 1350 | } |
1351 | 1351 | |
1352 | 1352 | $lines[] = $this->generateEmbeddedPropertyDocBlock($embeddedClass); |
1353 | - $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $fieldName . ";\n"; |
|
1353 | + $lines[] = $this->spaces.$this->fieldVisibility.' $'.$fieldName.";\n"; |
|
1354 | 1354 | } |
1355 | 1355 | |
1356 | 1356 | return implode("\n", $lines); |
@@ -1367,7 +1367,7 @@ discard block |
||
1367 | 1367 | */ |
1368 | 1368 | protected function generateEntityStubMethod(ClassMetadataInfo $metadata, $type, $fieldName, $typeHint = null, $defaultValue = null) |
1369 | 1369 | { |
1370 | - $methodName = $type . Inflector::classify($fieldName); |
|
1370 | + $methodName = $type.Inflector::classify($fieldName); |
|
1371 | 1371 | $variableName = Inflector::camelize($fieldName); |
1372 | 1372 | if (in_array($type, ["add", "remove"])) { |
1373 | 1373 | $methodName = Inflector::singularize($methodName); |
@@ -1387,18 +1387,18 @@ discard block |
||
1387 | 1387 | $variableType = $typeHint ? $this->getType($typeHint) : null; |
1388 | 1388 | |
1389 | 1389 | if ($typeHint && ! isset($types[$typeHint])) { |
1390 | - $variableType = '\\' . ltrim($variableType, '\\'); |
|
1391 | - $methodTypeHint = '\\' . $typeHint . ' '; |
|
1390 | + $variableType = '\\'.ltrim($variableType, '\\'); |
|
1391 | + $methodTypeHint = '\\'.$typeHint.' '; |
|
1392 | 1392 | } |
1393 | 1393 | |
1394 | 1394 | $replacements = [ |
1395 | - '<description>' => ucfirst($type) . ' ' . $variableName . '.', |
|
1395 | + '<description>' => ucfirst($type).' '.$variableName.'.', |
|
1396 | 1396 | '<methodTypeHint>' => $methodTypeHint, |
1397 | - '<variableType>' => $variableType . (null !== $defaultValue ? ('|' . $defaultValue) : ''), |
|
1397 | + '<variableType>' => $variableType.(null !== $defaultValue ? ('|'.$defaultValue) : ''), |
|
1398 | 1398 | '<variableName>' => $variableName, |
1399 | 1399 | '<methodName>' => $methodName, |
1400 | 1400 | '<fieldName>' => $fieldName, |
1401 | - '<variableDefault>' => ($defaultValue !== null ) ? (' = ' . $defaultValue) : '', |
|
1401 | + '<variableDefault>' => ($defaultValue !== null) ? (' = '.$defaultValue) : '', |
|
1402 | 1402 | '<entity>' => $this->getClassName($metadata) |
1403 | 1403 | ]; |
1404 | 1404 | |
@@ -1427,7 +1427,7 @@ discard block |
||
1427 | 1427 | $this->staticReflection[$metadata->name]['methods'][] = $methodName; |
1428 | 1428 | |
1429 | 1429 | $replacements = [ |
1430 | - '<name>' => $this->annotationsPrefix . ucfirst($name), |
|
1430 | + '<name>' => $this->annotationsPrefix.ucfirst($name), |
|
1431 | 1431 | '<methodName>' => $methodName, |
1432 | 1432 | ]; |
1433 | 1433 | |
@@ -1450,30 +1450,30 @@ discard block |
||
1450 | 1450 | $joinColumnAnnot = []; |
1451 | 1451 | |
1452 | 1452 | if (isset($joinColumn['name'])) { |
1453 | - $joinColumnAnnot[] = 'name="' . $joinColumn['name'] . '"'; |
|
1453 | + $joinColumnAnnot[] = 'name="'.$joinColumn['name'].'"'; |
|
1454 | 1454 | } |
1455 | 1455 | |
1456 | 1456 | if (isset($joinColumn['referencedColumnName'])) { |
1457 | - $joinColumnAnnot[] = 'referencedColumnName="' . $joinColumn['referencedColumnName'] . '"'; |
|
1457 | + $joinColumnAnnot[] = 'referencedColumnName="'.$joinColumn['referencedColumnName'].'"'; |
|
1458 | 1458 | } |
1459 | 1459 | |
1460 | 1460 | if (isset($joinColumn['unique']) && $joinColumn['unique']) { |
1461 | - $joinColumnAnnot[] = 'unique=' . ($joinColumn['unique'] ? 'true' : 'false'); |
|
1461 | + $joinColumnAnnot[] = 'unique='.($joinColumn['unique'] ? 'true' : 'false'); |
|
1462 | 1462 | } |
1463 | 1463 | |
1464 | 1464 | if (isset($joinColumn['nullable'])) { |
1465 | - $joinColumnAnnot[] = 'nullable=' . ($joinColumn['nullable'] ? 'true' : 'false'); |
|
1465 | + $joinColumnAnnot[] = 'nullable='.($joinColumn['nullable'] ? 'true' : 'false'); |
|
1466 | 1466 | } |
1467 | 1467 | |
1468 | 1468 | if (isset($joinColumn['onDelete'])) { |
1469 | - $joinColumnAnnot[] = 'onDelete="' . ($joinColumn['onDelete'] . '"'); |
|
1469 | + $joinColumnAnnot[] = 'onDelete="'.($joinColumn['onDelete'].'"'); |
|
1470 | 1470 | } |
1471 | 1471 | |
1472 | 1472 | if (isset($joinColumn['columnDefinition'])) { |
1473 | - $joinColumnAnnot[] = 'columnDefinition="' . $joinColumn['columnDefinition'] . '"'; |
|
1473 | + $joinColumnAnnot[] = 'columnDefinition="'.$joinColumn['columnDefinition'].'"'; |
|
1474 | 1474 | } |
1475 | 1475 | |
1476 | - return '@' . $this->annotationsPrefix . 'JoinColumn(' . implode(', ', $joinColumnAnnot) . ')'; |
|
1476 | + return '@'.$this->annotationsPrefix.'JoinColumn('.implode(', ', $joinColumnAnnot).')'; |
|
1477 | 1477 | } |
1478 | 1478 | |
1479 | 1479 | /** |
@@ -1485,22 +1485,22 @@ discard block |
||
1485 | 1485 | protected function generateAssociationMappingPropertyDocBlock(array $associationMapping, ClassMetadataInfo $metadata) |
1486 | 1486 | { |
1487 | 1487 | $lines = []; |
1488 | - $lines[] = $this->spaces . '/**'; |
|
1488 | + $lines[] = $this->spaces.'/**'; |
|
1489 | 1489 | |
1490 | 1490 | if ($associationMapping['type'] & ClassMetadataInfo::TO_MANY) { |
1491 | - $lines[] = $this->spaces . ' * @var \Doctrine\Common\Collections\Collection'; |
|
1491 | + $lines[] = $this->spaces.' * @var \Doctrine\Common\Collections\Collection'; |
|
1492 | 1492 | } else { |
1493 | - $lines[] = $this->spaces . ' * @var \\' . ltrim($associationMapping['targetEntity'], '\\'); |
|
1493 | + $lines[] = $this->spaces.' * @var \\'.ltrim($associationMapping['targetEntity'], '\\'); |
|
1494 | 1494 | } |
1495 | 1495 | |
1496 | 1496 | if ($this->generateAnnotations) { |
1497 | - $lines[] = $this->spaces . ' *'; |
|
1497 | + $lines[] = $this->spaces.' *'; |
|
1498 | 1498 | |
1499 | 1499 | if (isset($associationMapping['id']) && $associationMapping['id']) { |
1500 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Id'; |
|
1500 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Id'; |
|
1501 | 1501 | |
1502 | 1502 | if ($generatorType = $this->getIdGeneratorTypeString($metadata->generatorType)) { |
1503 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'GeneratedValue(strategy="' . $generatorType . '")'; |
|
1503 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'GeneratedValue(strategy="'.$generatorType.'")'; |
|
1504 | 1504 | } |
1505 | 1505 | } |
1506 | 1506 | |
@@ -1522,15 +1522,15 @@ discard block |
||
1522 | 1522 | $typeOptions = []; |
1523 | 1523 | |
1524 | 1524 | if (isset($associationMapping['targetEntity'])) { |
1525 | - $typeOptions[] = 'targetEntity="' . $associationMapping['targetEntity'] . '"'; |
|
1525 | + $typeOptions[] = 'targetEntity="'.$associationMapping['targetEntity'].'"'; |
|
1526 | 1526 | } |
1527 | 1527 | |
1528 | 1528 | if (isset($associationMapping['inversedBy'])) { |
1529 | - $typeOptions[] = 'inversedBy="' . $associationMapping['inversedBy'] . '"'; |
|
1529 | + $typeOptions[] = 'inversedBy="'.$associationMapping['inversedBy'].'"'; |
|
1530 | 1530 | } |
1531 | 1531 | |
1532 | 1532 | if (isset($associationMapping['mappedBy'])) { |
1533 | - $typeOptions[] = 'mappedBy="' . $associationMapping['mappedBy'] . '"'; |
|
1533 | + $typeOptions[] = 'mappedBy="'.$associationMapping['mappedBy'].'"'; |
|
1534 | 1534 | } |
1535 | 1535 | |
1536 | 1536 | if ($associationMapping['cascade']) { |
@@ -1546,11 +1546,11 @@ discard block |
||
1546 | 1546 | $cascades = ['"all"']; |
1547 | 1547 | } |
1548 | 1548 | |
1549 | - $typeOptions[] = 'cascade={' . implode(',', $cascades) . '}'; |
|
1549 | + $typeOptions[] = 'cascade={'.implode(',', $cascades).'}'; |
|
1550 | 1550 | } |
1551 | 1551 | |
1552 | 1552 | if (isset($associationMapping['orphanRemoval']) && $associationMapping['orphanRemoval']) { |
1553 | - $typeOptions[] = 'orphanRemoval=' . ($associationMapping['orphanRemoval'] ? 'true' : 'false'); |
|
1553 | + $typeOptions[] = 'orphanRemoval='.($associationMapping['orphanRemoval'] ? 'true' : 'false'); |
|
1554 | 1554 | } |
1555 | 1555 | |
1556 | 1556 | if (isset($associationMapping['fetch']) && $associationMapping['fetch'] !== ClassMetadataInfo::FETCH_LAZY) { |
@@ -1559,71 +1559,71 @@ discard block |
||
1559 | 1559 | ClassMetadataInfo::FETCH_EAGER => 'EAGER', |
1560 | 1560 | ]; |
1561 | 1561 | |
1562 | - $typeOptions[] = 'fetch="' . $fetchMap[$associationMapping['fetch']] . '"'; |
|
1562 | + $typeOptions[] = 'fetch="'.$fetchMap[$associationMapping['fetch']].'"'; |
|
1563 | 1563 | } |
1564 | 1564 | |
1565 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . '' . $type . '(' . implode(', ', $typeOptions) . ')'; |
|
1565 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.''.$type.'('.implode(', ', $typeOptions).')'; |
|
1566 | 1566 | |
1567 | 1567 | if (isset($associationMapping['joinColumns']) && $associationMapping['joinColumns']) { |
1568 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'JoinColumns({'; |
|
1568 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'JoinColumns({'; |
|
1569 | 1569 | |
1570 | 1570 | $joinColumnsLines = []; |
1571 | 1571 | |
1572 | 1572 | foreach ($associationMapping['joinColumns'] as $joinColumn) { |
1573 | 1573 | if ($joinColumnAnnot = $this->generateJoinColumnAnnotation($joinColumn)) { |
1574 | - $joinColumnsLines[] = $this->spaces . ' * ' . $joinColumnAnnot; |
|
1574 | + $joinColumnsLines[] = $this->spaces.' * '.$joinColumnAnnot; |
|
1575 | 1575 | } |
1576 | 1576 | } |
1577 | 1577 | |
1578 | 1578 | $lines[] = implode(",\n", $joinColumnsLines); |
1579 | - $lines[] = $this->spaces . ' * })'; |
|
1579 | + $lines[] = $this->spaces.' * })'; |
|
1580 | 1580 | } |
1581 | 1581 | |
1582 | 1582 | if (isset($associationMapping['joinTable']) && $associationMapping['joinTable']) { |
1583 | 1583 | $joinTable = []; |
1584 | - $joinTable[] = 'name="' . $associationMapping['joinTable']['name'] . '"'; |
|
1584 | + $joinTable[] = 'name="'.$associationMapping['joinTable']['name'].'"'; |
|
1585 | 1585 | |
1586 | 1586 | if (isset($associationMapping['joinTable']['schema'])) { |
1587 | - $joinTable[] = 'schema="' . $associationMapping['joinTable']['schema'] . '"'; |
|
1587 | + $joinTable[] = 'schema="'.$associationMapping['joinTable']['schema'].'"'; |
|
1588 | 1588 | } |
1589 | 1589 | |
1590 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'JoinTable(' . implode(', ', $joinTable) . ','; |
|
1591 | - $lines[] = $this->spaces . ' * joinColumns={'; |
|
1590 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'JoinTable('.implode(', ', $joinTable).','; |
|
1591 | + $lines[] = $this->spaces.' * joinColumns={'; |
|
1592 | 1592 | |
1593 | 1593 | $joinColumnsLines = []; |
1594 | 1594 | |
1595 | 1595 | foreach ($associationMapping['joinTable']['joinColumns'] as $joinColumn) { |
1596 | - $joinColumnsLines[] = $this->spaces . ' * ' . $this->generateJoinColumnAnnotation($joinColumn); |
|
1596 | + $joinColumnsLines[] = $this->spaces.' * '.$this->generateJoinColumnAnnotation($joinColumn); |
|
1597 | 1597 | } |
1598 | 1598 | |
1599 | - $lines[] = implode(",". PHP_EOL, $joinColumnsLines); |
|
1600 | - $lines[] = $this->spaces . ' * },'; |
|
1601 | - $lines[] = $this->spaces . ' * inverseJoinColumns={'; |
|
1599 | + $lines[] = implode(",".PHP_EOL, $joinColumnsLines); |
|
1600 | + $lines[] = $this->spaces.' * },'; |
|
1601 | + $lines[] = $this->spaces.' * inverseJoinColumns={'; |
|
1602 | 1602 | |
1603 | 1603 | $inverseJoinColumnsLines = []; |
1604 | 1604 | |
1605 | 1605 | foreach ($associationMapping['joinTable']['inverseJoinColumns'] as $joinColumn) { |
1606 | - $inverseJoinColumnsLines[] = $this->spaces . ' * ' . $this->generateJoinColumnAnnotation($joinColumn); |
|
1606 | + $inverseJoinColumnsLines[] = $this->spaces.' * '.$this->generateJoinColumnAnnotation($joinColumn); |
|
1607 | 1607 | } |
1608 | 1608 | |
1609 | - $lines[] = implode(",". PHP_EOL, $inverseJoinColumnsLines); |
|
1610 | - $lines[] = $this->spaces . ' * }'; |
|
1611 | - $lines[] = $this->spaces . ' * )'; |
|
1609 | + $lines[] = implode(",".PHP_EOL, $inverseJoinColumnsLines); |
|
1610 | + $lines[] = $this->spaces.' * }'; |
|
1611 | + $lines[] = $this->spaces.' * )'; |
|
1612 | 1612 | } |
1613 | 1613 | |
1614 | 1614 | if (isset($associationMapping['orderBy'])) { |
1615 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'OrderBy({'; |
|
1615 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'OrderBy({'; |
|
1616 | 1616 | |
1617 | 1617 | foreach ($associationMapping['orderBy'] as $name => $direction) { |
1618 | - $lines[] = $this->spaces . ' * "' . $name . '"="' . $direction . '",'; |
|
1618 | + $lines[] = $this->spaces.' * "'.$name.'"="'.$direction.'",'; |
|
1619 | 1619 | } |
1620 | 1620 | |
1621 | 1621 | $lines[count($lines) - 1] = substr($lines[count($lines) - 1], 0, strlen($lines[count($lines) - 1]) - 1); |
1622 | - $lines[] = $this->spaces . ' * })'; |
|
1622 | + $lines[] = $this->spaces.' * })'; |
|
1623 | 1623 | } |
1624 | 1624 | } |
1625 | 1625 | |
1626 | - $lines[] = $this->spaces . ' */'; |
|
1626 | + $lines[] = $this->spaces.' */'; |
|
1627 | 1627 | |
1628 | 1628 | return implode("\n", $lines); |
1629 | 1629 | } |
@@ -1637,43 +1637,43 @@ discard block |
||
1637 | 1637 | protected function generateFieldMappingPropertyDocBlock(array $fieldMapping, ClassMetadataInfo $metadata) |
1638 | 1638 | { |
1639 | 1639 | $lines = []; |
1640 | - $lines[] = $this->spaces . '/**'; |
|
1641 | - $lines[] = $this->spaces . ' * @var ' |
|
1640 | + $lines[] = $this->spaces.'/**'; |
|
1641 | + $lines[] = $this->spaces.' * @var ' |
|
1642 | 1642 | . $this->getType($fieldMapping['type']) |
1643 | 1643 | . ($this->nullableFieldExpression($fieldMapping) ? '|null' : ''); |
1644 | 1644 | |
1645 | 1645 | if ($this->generateAnnotations) { |
1646 | - $lines[] = $this->spaces . ' *'; |
|
1646 | + $lines[] = $this->spaces.' *'; |
|
1647 | 1647 | |
1648 | 1648 | $column = []; |
1649 | 1649 | if (isset($fieldMapping['columnName'])) { |
1650 | - $column[] = 'name="' . $fieldMapping['columnName'] . '"'; |
|
1650 | + $column[] = 'name="'.$fieldMapping['columnName'].'"'; |
|
1651 | 1651 | } |
1652 | 1652 | |
1653 | 1653 | if (isset($fieldMapping['type'])) { |
1654 | - $column[] = 'type="' . $fieldMapping['type'] . '"'; |
|
1654 | + $column[] = 'type="'.$fieldMapping['type'].'"'; |
|
1655 | 1655 | } |
1656 | 1656 | |
1657 | 1657 | if (isset($fieldMapping['length'])) { |
1658 | - $column[] = 'length=' . $fieldMapping['length']; |
|
1658 | + $column[] = 'length='.$fieldMapping['length']; |
|
1659 | 1659 | } |
1660 | 1660 | |
1661 | 1661 | if (isset($fieldMapping['precision'])) { |
1662 | - $column[] = 'precision=' . $fieldMapping['precision']; |
|
1662 | + $column[] = 'precision='.$fieldMapping['precision']; |
|
1663 | 1663 | } |
1664 | 1664 | |
1665 | 1665 | if (isset($fieldMapping['scale'])) { |
1666 | - $column[] = 'scale=' . $fieldMapping['scale']; |
|
1666 | + $column[] = 'scale='.$fieldMapping['scale']; |
|
1667 | 1667 | } |
1668 | 1668 | |
1669 | 1669 | if (isset($fieldMapping['nullable'])) { |
1670 | - $column[] = 'nullable=' . var_export($fieldMapping['nullable'], true); |
|
1670 | + $column[] = 'nullable='.var_export($fieldMapping['nullable'], true); |
|
1671 | 1671 | } |
1672 | 1672 | |
1673 | 1673 | $options = []; |
1674 | 1674 | |
1675 | 1675 | if (isset($fieldMapping['options']['default']) && $fieldMapping['options']['default']) { |
1676 | - $options[] = '"default"="' . $fieldMapping['options']['default'] .'"'; |
|
1676 | + $options[] = '"default"="'.$fieldMapping['options']['default'].'"'; |
|
1677 | 1677 | } |
1678 | 1678 | |
1679 | 1679 | if (isset($fieldMapping['options']['unsigned']) && $fieldMapping['options']['unsigned']) { |
@@ -1685,15 +1685,15 @@ discard block |
||
1685 | 1685 | } |
1686 | 1686 | |
1687 | 1687 | if (isset($fieldMapping['options']['comment']) && $fieldMapping['options']['comment']) { |
1688 | - $options[] = '"comment"="' . str_replace('"', '""', $fieldMapping['options']['comment']) . '"'; |
|
1688 | + $options[] = '"comment"="'.str_replace('"', '""', $fieldMapping['options']['comment']).'"'; |
|
1689 | 1689 | } |
1690 | 1690 | |
1691 | 1691 | if (isset($fieldMapping['options']['collation']) && $fieldMapping['options']['collation']) { |
1692 | - $options[] = '"collation"="' . $fieldMapping['options']['collation'] .'"'; |
|
1692 | + $options[] = '"collation"="'.$fieldMapping['options']['collation'].'"'; |
|
1693 | 1693 | } |
1694 | 1694 | |
1695 | 1695 | if (isset($fieldMapping['options']['check']) && $fieldMapping['options']['check']) { |
1696 | - $options[] = '"check"="' . $fieldMapping['options']['check'] .'"'; |
|
1696 | + $options[] = '"check"="'.$fieldMapping['options']['check'].'"'; |
|
1697 | 1697 | } |
1698 | 1698 | |
1699 | 1699 | if ($options) { |
@@ -1701,47 +1701,47 @@ discard block |
||
1701 | 1701 | } |
1702 | 1702 | |
1703 | 1703 | if (isset($fieldMapping['columnDefinition'])) { |
1704 | - $column[] = 'columnDefinition="' . $fieldMapping['columnDefinition'] . '"'; |
|
1704 | + $column[] = 'columnDefinition="'.$fieldMapping['columnDefinition'].'"'; |
|
1705 | 1705 | } |
1706 | 1706 | |
1707 | 1707 | if (isset($fieldMapping['unique'])) { |
1708 | - $column[] = 'unique=' . var_export($fieldMapping['unique'], true); |
|
1708 | + $column[] = 'unique='.var_export($fieldMapping['unique'], true); |
|
1709 | 1709 | } |
1710 | 1710 | |
1711 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Column(' . implode(', ', $column) . ')'; |
|
1711 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Column('.implode(', ', $column).')'; |
|
1712 | 1712 | |
1713 | 1713 | if (isset($fieldMapping['id']) && $fieldMapping['id']) { |
1714 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Id'; |
|
1714 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Id'; |
|
1715 | 1715 | |
1716 | 1716 | if ($generatorType = $this->getIdGeneratorTypeString($metadata->generatorType)) { |
1717 | - $lines[] = $this->spaces.' * @' . $this->annotationsPrefix . 'GeneratedValue(strategy="' . $generatorType . '")'; |
|
1717 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'GeneratedValue(strategy="'.$generatorType.'")'; |
|
1718 | 1718 | } |
1719 | 1719 | |
1720 | 1720 | if ($metadata->sequenceGeneratorDefinition) { |
1721 | 1721 | $sequenceGenerator = []; |
1722 | 1722 | |
1723 | 1723 | if (isset($metadata->sequenceGeneratorDefinition['sequenceName'])) { |
1724 | - $sequenceGenerator[] = 'sequenceName="' . $metadata->sequenceGeneratorDefinition['sequenceName'] . '"'; |
|
1724 | + $sequenceGenerator[] = 'sequenceName="'.$metadata->sequenceGeneratorDefinition['sequenceName'].'"'; |
|
1725 | 1725 | } |
1726 | 1726 | |
1727 | 1727 | if (isset($metadata->sequenceGeneratorDefinition['allocationSize'])) { |
1728 | - $sequenceGenerator[] = 'allocationSize=' . $metadata->sequenceGeneratorDefinition['allocationSize']; |
|
1728 | + $sequenceGenerator[] = 'allocationSize='.$metadata->sequenceGeneratorDefinition['allocationSize']; |
|
1729 | 1729 | } |
1730 | 1730 | |
1731 | 1731 | if (isset($metadata->sequenceGeneratorDefinition['initialValue'])) { |
1732 | - $sequenceGenerator[] = 'initialValue=' . $metadata->sequenceGeneratorDefinition['initialValue']; |
|
1732 | + $sequenceGenerator[] = 'initialValue='.$metadata->sequenceGeneratorDefinition['initialValue']; |
|
1733 | 1733 | } |
1734 | 1734 | |
1735 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'SequenceGenerator(' . implode(', ', $sequenceGenerator) . ')'; |
|
1735 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'SequenceGenerator('.implode(', ', $sequenceGenerator).')'; |
|
1736 | 1736 | } |
1737 | 1737 | } |
1738 | 1738 | |
1739 | 1739 | if (isset($fieldMapping['version']) && $fieldMapping['version']) { |
1740 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Version'; |
|
1740 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Version'; |
|
1741 | 1741 | } |
1742 | 1742 | } |
1743 | 1743 | |
1744 | - $lines[] = $this->spaces . ' */'; |
|
1744 | + $lines[] = $this->spaces.' */'; |
|
1745 | 1745 | |
1746 | 1746 | return implode("\n", $lines); |
1747 | 1747 | } |
@@ -1754,27 +1754,27 @@ discard block |
||
1754 | 1754 | protected function generateEmbeddedPropertyDocBlock(array $embeddedClass) |
1755 | 1755 | { |
1756 | 1756 | $lines = []; |
1757 | - $lines[] = $this->spaces . '/**'; |
|
1758 | - $lines[] = $this->spaces . ' * @var \\' . ltrim($embeddedClass['class'], '\\'); |
|
1757 | + $lines[] = $this->spaces.'/**'; |
|
1758 | + $lines[] = $this->spaces.' * @var \\'.ltrim($embeddedClass['class'], '\\'); |
|
1759 | 1759 | |
1760 | 1760 | if ($this->generateAnnotations) { |
1761 | - $lines[] = $this->spaces . ' *'; |
|
1761 | + $lines[] = $this->spaces.' *'; |
|
1762 | 1762 | |
1763 | - $embedded = ['class="' . $embeddedClass['class'] . '"']; |
|
1763 | + $embedded = ['class="'.$embeddedClass['class'].'"']; |
|
1764 | 1764 | |
1765 | 1765 | if (isset($embeddedClass['columnPrefix'])) { |
1766 | 1766 | if (is_string($embeddedClass['columnPrefix'])) { |
1767 | - $embedded[] = 'columnPrefix="' . $embeddedClass['columnPrefix'] . '"'; |
|
1767 | + $embedded[] = 'columnPrefix="'.$embeddedClass['columnPrefix'].'"'; |
|
1768 | 1768 | } else { |
1769 | - $embedded[] = 'columnPrefix=' . var_export($embeddedClass['columnPrefix'], true); |
|
1769 | + $embedded[] = 'columnPrefix='.var_export($embeddedClass['columnPrefix'], true); |
|
1770 | 1770 | } |
1771 | 1771 | } |
1772 | 1772 | |
1773 | - $lines[] = $this->spaces . ' * @' . |
|
1774 | - $this->annotationsPrefix . 'Embedded(' . implode(', ', $embedded) . ')'; |
|
1773 | + $lines[] = $this->spaces.' * @'. |
|
1774 | + $this->annotationsPrefix.'Embedded('.implode(', ', $embedded).')'; |
|
1775 | 1775 | } |
1776 | 1776 | |
1777 | - $lines[] = $this->spaces . ' */'; |
|
1777 | + $lines[] = $this->spaces.' */'; |
|
1778 | 1778 | |
1779 | 1779 | return implode("\n", $lines); |
1780 | 1780 | } |
@@ -1788,13 +1788,13 @@ discard block |
||
1788 | 1788 | $processedClasses = []; |
1789 | 1789 | foreach ($metadata->entityListeners as $event => $eventListeners) { |
1790 | 1790 | foreach ($eventListeners as $eventListener) { |
1791 | - $processedClasses[] = '"' . $eventListener['class'] . '"'; |
|
1791 | + $processedClasses[] = '"'.$eventListener['class'].'"'; |
|
1792 | 1792 | } |
1793 | 1793 | } |
1794 | 1794 | |
1795 | 1795 | return \sprintf( |
1796 | 1796 | '%s%s({%s})', |
1797 | - '@' . $this->annotationsPrefix, |
|
1797 | + '@'.$this->annotationsPrefix, |
|
1798 | 1798 | 'EntityListeners', |
1799 | 1799 | \implode(',', \array_unique($processedClasses)) |
1800 | 1800 | ); |
@@ -1812,7 +1812,7 @@ discard block |
||
1812 | 1812 | |
1813 | 1813 | foreach ($lines as $key => $value) { |
1814 | 1814 | if ( ! empty($value)) { |
1815 | - $lines[$key] = str_repeat($this->spaces, $num) . $lines[$key]; |
|
1815 | + $lines[$key] = str_repeat($this->spaces, $num).$lines[$key]; |
|
1816 | 1816 | } |
1817 | 1817 | } |
1818 | 1818 | |
@@ -1894,9 +1894,9 @@ discard block |
||
1894 | 1894 | |
1895 | 1895 | foreach ($options as $name => $option) { |
1896 | 1896 | if (is_array($option)) { |
1897 | - $optionsStr[] = '"' . $name . '"={' . $this->exportTableOptions($option) . '}'; |
|
1897 | + $optionsStr[] = '"'.$name.'"={'.$this->exportTableOptions($option).'}'; |
|
1898 | 1898 | } else { |
1899 | - $optionsStr[] = '"' . $name . '"="' . (string) $option . '"'; |
|
1899 | + $optionsStr[] = '"'.$name.'"="'.(string) $option.'"'; |
|
1900 | 1900 | } |
1901 | 1901 | } |
1902 | 1902 |