@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | ] |
29 | 29 | ); |
30 | 30 | |
31 | - \touch($filename = $this->dir . '/Foo' . $this->getFileExtension()); |
|
31 | + \touch($filename = $this->dir.'/Foo'.$this->getFileExtension()); |
|
32 | 32 | self::assertEquals($filename, $driver->getLocator()->findMappingFile('MyNamespace\MySubnamespace\Entity\Foo')); |
33 | 33 | } |
34 | 34 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | ] |
41 | 41 | ); |
42 | 42 | |
43 | - \touch($filename = $this->dir . '/Foo.Bar' . $this->getFileExtension()); |
|
43 | + \touch($filename = $this->dir.'/Foo.Bar'.$this->getFileExtension()); |
|
44 | 44 | self::assertEquals($filename, $driver->getLocator()->findMappingFile('MyNamespace\MySubnamespace\Entity\Foo\Bar')); |
45 | 45 | } |
46 | 46 | |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | public function testFindMappingNamespaceNotFound() : void |
62 | 62 | { |
63 | 63 | $this->expectException(MappingException::class); |
64 | - $this->expectExceptionMessage("No mapping file found named 'Foo" . $this->getFileExtension() . "' for class 'MyOtherNamespace\MySubnamespace\Entity\Foo'."); |
|
64 | + $this->expectExceptionMessage("No mapping file found named 'Foo".$this->getFileExtension()."' for class 'MyOtherNamespace\MySubnamespace\Entity\Foo'."); |
|
65 | 65 | |
66 | 66 | $driver = $this->getDriver( |
67 | 67 | [ |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | |
75 | 75 | protected function setUp() : void |
76 | 76 | { |
77 | - $this->dir = \sys_get_temp_dir() . '/abstract_driver_test'; |
|
77 | + $this->dir = \sys_get_temp_dir().'/abstract_driver_test'; |
|
78 | 78 | @\mkdir($this->dir, 0777, true); |
79 | 79 | } |
80 | 80 |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | use function strtoupper; |
37 | 37 | use function unserialize; |
38 | 38 | |
39 | -require_once __DIR__ . '/../../Models/Global/GlobalNamespaceModel.php'; |
|
39 | +require_once __DIR__.'/../../Models/Global/GlobalNamespaceModel.php'; |
|
40 | 40 | |
41 | 41 | class ClassMetadataTest extends OrmTestCase |
42 | 42 | { |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | */ |
166 | 166 | public function testMapAssociationInGlobalNamespace() : void |
167 | 167 | { |
168 | - require_once __DIR__ . '/../../Models/Global/GlobalNamespaceModel.php'; |
|
168 | + require_once __DIR__.'/../../Models/Global/GlobalNamespaceModel.php'; |
|
169 | 169 | |
170 | 170 | $cm = new ClassMetadata(DoctrineGlobalArticle::class, null); |
171 | 171 | $cm->setTable(new Mapping\TableMetadata('doctrine_global_article')); |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | */ |
266 | 266 | public function testSetDiscriminatorMapInGlobalNamespace() : void |
267 | 267 | { |
268 | - require_once __DIR__ . '/../../Models/Global/GlobalNamespaceModel.php'; |
|
268 | + require_once __DIR__.'/../../Models/Global/GlobalNamespaceModel.php'; |
|
269 | 269 | |
270 | 270 | $cm = new ClassMetadata('DoctrineGlobalUser', null); |
271 | 271 | $cm->setTable(new Mapping\TableMetadata('doctrine_global_user')); |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | */ |
282 | 282 | public function testSetSubClassesInGlobalNamespace() : void |
283 | 283 | { |
284 | - require_once __DIR__ . '/../../Models/Global/GlobalNamespaceModel.php'; |
|
284 | + require_once __DIR__.'/../../Models/Global/GlobalNamespaceModel.php'; |
|
285 | 285 | |
286 | 286 | $cm = new ClassMetadata('DoctrineGlobalUser', null); |
287 | 287 | $cm->setTable(new Mapping\TableMetadata('doctrine_global_user')); |
@@ -767,7 +767,7 @@ discard block |
||
767 | 767 | public function testEmptyFieldNameThrowsException() : void |
768 | 768 | { |
769 | 769 | $this->expectException(MappingException::class); |
770 | - $this->expectExceptionMessage("The field or association mapping misses the 'fieldName' attribute in entity '" . CMS\CmsUser::class . "'."); |
|
770 | + $this->expectExceptionMessage("The field or association mapping misses the 'fieldName' attribute in entity '".CMS\CmsUser::class."'."); |
|
771 | 771 | |
772 | 772 | $cm = new ClassMetadata(CMS\CmsUser::class, null); |
773 | 773 | $cm->setTable(new Mapping\TableMetadata('cms_users')); |
@@ -819,7 +819,7 @@ discard block |
||
819 | 819 | $cm->addLifecycleCallback('postLoad', 'notfound'); |
820 | 820 | |
821 | 821 | $this->expectException(MappingException::class); |
822 | - $this->expectExceptionMessage("Entity '" . CMS\CmsUser::class . "' has no public method 'notfound' to be registered as lifecycle callback."); |
|
822 | + $this->expectExceptionMessage("Entity '".CMS\CmsUser::class."' has no public method 'notfound' to be registered as lifecycle callback."); |
|
823 | 823 | |
824 | 824 | $cm->validateLifecycleCallbacks(new RuntimeReflectionService()); |
825 | 825 | } |
@@ -841,7 +841,7 @@ discard block |
||
841 | 841 | $cm->addProperty($association); |
842 | 842 | |
843 | 843 | $this->expectException(MappingException::class); |
844 | - $this->expectExceptionMessage("The target-entity 'UnknownClass' cannot be found in '" . CMS\CmsUser::class . "#address'."); |
|
844 | + $this->expectExceptionMessage("The target-entity 'UnknownClass' cannot be found in '".CMS\CmsUser::class."#address'."); |
|
845 | 845 | |
846 | 846 | $cm->validateAssociations(); |
847 | 847 | } |
@@ -1089,6 +1089,6 @@ discard block |
||
1089 | 1089 | */ |
1090 | 1090 | public function propertyToColumnName(string $propertyName, ?string $className = null) : string |
1091 | 1091 | { |
1092 | - return \strtolower($this->classToTableName($className)) . '_' . $propertyName; |
|
1092 | + return \strtolower($this->classToTableName($className)).'_'.$propertyName; |
|
1093 | 1093 | } |
1094 | 1094 | } |
@@ -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 | } |
@@ -62,7 +62,7 @@ |
||
62 | 62 | self::assertSame(\array_keys($expectedId), \array_keys($id)); |
63 | 63 | |
64 | 64 | foreach ($expectedId as $field => $value) { |
65 | - if (! \is_object($value)) { |
|
65 | + if ( ! \is_object($value)) { |
|
66 | 66 | self::assertSame($id[$field], $value); |
67 | 67 | |
68 | 68 | continue; |
@@ -44,7 +44,7 @@ |
||
44 | 44 | $className = \array_pop($namespaceParts); |
45 | 45 | $namespace = \implode('\\', $namespaceParts); |
46 | 46 | |
47 | - eval('namespace ' . $namespace . ' { class ' . $className . ' {} }'); |
|
47 | + eval('namespace '.$namespace.' { class '.$className.' {} }'); |
|
48 | 48 | |
49 | 49 | self::assertSame($expectedClassName, StaticClassNameConverter::getClass(new $givenClassName())); |
50 | 50 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | protected function createRegion() |
61 | 61 | { |
62 | - $this->directory = \sys_get_temp_dir() . '/doctrine_lock_' . \uniqid(); |
|
62 | + $this->directory = \sys_get_temp_dir().'/doctrine_lock_'.\uniqid(); |
|
63 | 63 | |
64 | 64 | $region = new DefaultRegion('concurren_region_test', $this->cache); |
65 | 65 | |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | $reflectionDirectory->setAccessible(true); |
263 | 263 | $reflectionDirectory->setValue($region, \str_repeat('a', 10000)); |
264 | 264 | |
265 | - \set_error_handler(static function () { |
|
265 | + \set_error_handler(static function() { |
|
266 | 266 | }, E_WARNING); |
267 | 267 | self::assertTrue($region->evictAll()); |
268 | 268 | \restore_error_handler(); |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | { |
276 | 276 | $path = $path ?: $this->directory; |
277 | 277 | |
278 | - if (! \is_dir($path)) { |
|
278 | + if ( ! \is_dir($path)) { |
|
279 | 279 | return; |
280 | 280 | } |
281 | 281 |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | $size = 500; |
140 | 140 | $startPersist = \microtime(true); |
141 | 141 | |
142 | - echo PHP_EOL . $label; |
|
142 | + echo PHP_EOL.$label; |
|
143 | 143 | |
144 | 144 | for ($i = 0; $i < $size; $i++) { |
145 | 145 | $em->persist(new Country(\sprintf('Country %d', $i))); |
@@ -173,13 +173,13 @@ discard block |
||
173 | 173 | $startPersist = \microtime(true); |
174 | 174 | $country = new Country('Country'); |
175 | 175 | |
176 | - echo PHP_EOL . $label; |
|
176 | + echo PHP_EOL.$label; |
|
177 | 177 | |
178 | 178 | $em->persist($country); |
179 | 179 | $em->flush(); |
180 | 180 | |
181 | 181 | for ($i = 0; $i < $size / 2; $i++) { |
182 | - $state = new State('State ' . $i, $country); |
|
182 | + $state = new State('State '.$i, $country); |
|
183 | 183 | |
184 | 184 | $em->persist($state); |
185 | 185 | |
@@ -228,10 +228,10 @@ discard block |
||
228 | 228 | $countries = []; |
229 | 229 | $startPersist = \microtime(true); |
230 | 230 | |
231 | - echo PHP_EOL . $label; |
|
231 | + echo PHP_EOL.$label; |
|
232 | 232 | |
233 | 233 | for ($i = 0; $i < $size; $i++) { |
234 | - $country = new Country('Country ' . $i); |
|
234 | + $country = new Country('Country '.$i); |
|
235 | 235 | |
236 | 236 | $em->persist($country); |
237 | 237 | |
@@ -263,10 +263,10 @@ discard block |
||
263 | 263 | $startPersist = \microtime(true); |
264 | 264 | $rep = $em->getRepository(Country::class); |
265 | 265 | |
266 | - echo PHP_EOL . $label; |
|
266 | + echo PHP_EOL.$label; |
|
267 | 267 | |
268 | 268 | for ($i = 0; $i < $size; $i++) { |
269 | - $em->persist(new Country('Country ' . $i)); |
|
269 | + $em->persist(new Country('Country '.$i)); |
|
270 | 270 | } |
271 | 271 | |
272 | 272 | $em->flush(); |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | { |
64 | 64 | $reader = new Annotations\CachedReader(new Annotations\AnnotationReader(), new ArrayCache()); |
65 | 65 | |
66 | - Annotations\AnnotationRegistry::registerFile(__DIR__ . '/../../../lib/Doctrine/ORM/Annotation/DoctrineAnnotations.php'); |
|
66 | + Annotations\AnnotationRegistry::registerFile(__DIR__.'/../../../lib/Doctrine/ORM/Annotation/DoctrineAnnotations.php'); |
|
67 | 67 | |
68 | 68 | return new AnnotationDriver($reader, (array) $paths); |
69 | 69 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $config->setProxyNamespace('Doctrine\Tests\Proxies'); |
100 | 100 | $config->setAutoGenerateProxyClasses(ProxyFactory::AUTOGENERATE_EVAL); |
101 | 101 | $config->setMetadataDriverImpl( |
102 | - $config->newDefaultAnnotationDriver([\realpath(__DIR__ . '/Models/Cache')]) |
|
102 | + $config->newDefaultAnnotationDriver([\realpath(__DIR__.'/Models/Cache')]) |
|
103 | 103 | ); |
104 | 104 | |
105 | 105 | if ($this->isSecondLevelCacheEnabled) { |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | $conn = static::$sharedConn; |
347 | 347 | |
348 | 348 | // In case test is skipped, tearDown is called, but no setup may have run |
349 | - if (! $conn) { |
|
349 | + if ( ! $conn) { |
|
350 | 350 | return; |
351 | 351 | } |
352 | 352 | |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | } |
421 | 421 | |
422 | 422 | if (isset($this->usedModelSets['directorytree'])) { |
423 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('file')); |
|
423 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('file')); |
|
424 | 424 | // MySQL doesn't know deferred deletions therefore only executing the second query gives errors. |
425 | 425 | $conn->executeUpdate('DELETE FROM Directory WHERE parentDirectory_id IS NOT NULL'); |
426 | 426 | $conn->executeUpdate('DELETE FROM Directory'); |
@@ -513,12 +513,12 @@ discard block |
||
513 | 513 | ) |
514 | 514 | ); |
515 | 515 | |
516 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-users-groups')); |
|
517 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-group')); |
|
518 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-phone')); |
|
519 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-user')); |
|
520 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-address')); |
|
521 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-city')); |
|
516 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-users-groups')); |
|
517 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-group')); |
|
518 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-phone')); |
|
519 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-user')); |
|
520 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-address')); |
|
521 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-city')); |
|
522 | 522 | } |
523 | 523 | |
524 | 524 | if (isset($this->usedModelSets['vct_onetoone'])) { |
@@ -630,7 +630,7 @@ discard block |
||
630 | 630 | $classes = []; |
631 | 631 | |
632 | 632 | foreach ($classNames as $className) { |
633 | - if (! isset(static::$entityTablesCreated[$className])) { |
|
633 | + if ( ! isset(static::$entityTablesCreated[$className])) { |
|
634 | 634 | static::$entityTablesCreated[$className] = true; |
635 | 635 | $classes[] = $this->em->getClassMetadata($className); |
636 | 636 | } |
@@ -649,25 +649,25 @@ discard block |
||
649 | 649 | { |
650 | 650 | $this->setUpDBALTypes(); |
651 | 651 | |
652 | - if (! isset(static::$sharedConn)) { |
|
652 | + if ( ! isset(static::$sharedConn)) { |
|
653 | 653 | static::$sharedConn = TestUtil::getConnection(); |
654 | 654 | } |
655 | 655 | |
656 | 656 | if (isset($GLOBALS['DOCTRINE_MARK_SQL_LOGS'])) { |
657 | 657 | if (\in_array(static::$sharedConn->getDatabasePlatform()->getName(), ['mysql', 'postgresql'], true)) { |
658 | - static::$sharedConn->executeQuery('SELECT 1 /*' . static::class . '*/'); |
|
658 | + static::$sharedConn->executeQuery('SELECT 1 /*'.static::class.'*/'); |
|
659 | 659 | } elseif (static::$sharedConn->getDatabasePlatform()->getName() === 'oracle') { |
660 | - static::$sharedConn->executeQuery('SELECT 1 /*' . static::class . '*/ FROM dual'); |
|
660 | + static::$sharedConn->executeQuery('SELECT 1 /*'.static::class.'*/ FROM dual'); |
|
661 | 661 | } |
662 | 662 | } |
663 | 663 | |
664 | - if (! $this->em) { |
|
664 | + if ( ! $this->em) { |
|
665 | 665 | $this->em = $this->getEntityManager(); |
666 | 666 | $this->schemaTool = new SchemaTool($this->em); |
667 | 667 | } |
668 | 668 | |
669 | 669 | foreach ($this->usedModelSets as $setName => $bool) { |
670 | - if (! isset(static::$tablesCreated[$setName])) { |
|
670 | + if ( ! isset(static::$tablesCreated[$setName])) { |
|
671 | 671 | $this->setUpEntitySchema(static::$modelSets[$setName]); |
672 | 672 | |
673 | 673 | static::$tablesCreated[$setName] = true; |
@@ -742,8 +742,8 @@ discard block |
||
742 | 742 | |
743 | 743 | $config->setMetadataDriverImpl( |
744 | 744 | $mappingDriver ?? $config->newDefaultAnnotationDriver([ |
745 | - \realpath(__DIR__ . '/Models/Cache'), |
|
746 | - \realpath(__DIR__ . '/Models/GeoNames'), |
|
745 | + \realpath(__DIR__.'/Models/Cache'), |
|
746 | + \realpath(__DIR__.'/Models/GeoNames'), |
|
747 | 747 | ]) |
748 | 748 | ); |
749 | 749 | |
@@ -791,13 +791,13 @@ discard block |
||
791 | 791 | |
792 | 792 | foreach ($last25queries as $i => $query) { |
793 | 793 | $params = \array_map( |
794 | - static function ($p) { |
|
794 | + static function($p) { |
|
795 | 795 | return \is_object($p) ? \get_class($p) : \var_export($p, true); |
796 | 796 | }, |
797 | 797 | $query['params'] ?: [] |
798 | 798 | ); |
799 | 799 | |
800 | - $queries .= $i . ". SQL: '" . $query['sql'] . "' Params: " . \implode(', ', $params) . PHP_EOL; |
|
800 | + $queries .= $i.". SQL: '".$query['sql']."' Params: ".\implode(', ', $params).PHP_EOL; |
|
801 | 801 | } |
802 | 802 | |
803 | 803 | $trace = $e->getTrace(); |
@@ -810,11 +810,11 @@ discard block |
||
810 | 810 | break; |
811 | 811 | } |
812 | 812 | |
813 | - $traceMsg .= $part['file'] . ':' . $part['line'] . PHP_EOL; |
|
813 | + $traceMsg .= $part['file'].':'.$part['line'].PHP_EOL; |
|
814 | 814 | } |
815 | 815 | } |
816 | 816 | |
817 | - $message = '[' . \get_class($e) . '] ' . $e->getMessage() . PHP_EOL . PHP_EOL . 'With queries:' . PHP_EOL . $queries . PHP_EOL . 'Trace:' . PHP_EOL . $traceMsg; |
|
817 | + $message = '['.\get_class($e).'] '.$e->getMessage().PHP_EOL.PHP_EOL.'With queries:'.PHP_EOL.$queries.PHP_EOL.'Trace:'.PHP_EOL.$traceMsg; |
|
818 | 818 | |
819 | 819 | throw new Exception($message, (int) $e->getCode(), $e); |
820 | 820 | } |