@@ -1,11 +1,11 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM; |
6 | 6 | |
7 | 7 | use Doctrine\Common\Collections\Collection; |
8 | -use Doctrine\Common\Collections\ArrayCollection;; |
|
8 | +use Doctrine\Common\Collections\ArrayCollection; ; |
|
9 | 9 | use Doctrine\ORM\Query\Parameter; |
10 | 10 | use Doctrine\ORM\Cache\QueryCacheKey; |
11 | 11 | use Doctrine\DBAL\Cache\QueryCacheProfile; |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | public function getParameter($key) |
306 | 306 | { |
307 | 307 | $filteredParameters = $this->parameters->filter( |
308 | - function ($parameter) use ($key) |
|
308 | + function($parameter) use ($key) |
|
309 | 309 | { |
310 | 310 | // Must not be identical because of string to integer conversion |
311 | 311 | return ($key == $parameter->getName()); |
@@ -354,14 +354,14 @@ discard block |
||
354 | 354 | public function setParameter($key, $value, $type = null) |
355 | 355 | { |
356 | 356 | $filteredParameters = $this->parameters->filter( |
357 | - function ($parameter) use ($key) |
|
357 | + function($parameter) use ($key) |
|
358 | 358 | { |
359 | 359 | // Must not be identical because of string to integer conversion |
360 | 360 | return ($key == $parameter->getName()); |
361 | 361 | } |
362 | 362 | ); |
363 | 363 | |
364 | - if (! $filteredParameters->isEmpty()) { |
|
364 | + if ( ! $filteredParameters->isEmpty()) { |
|
365 | 365 | $parameter = $filteredParameters->first(); |
366 | 366 | $parameter->setValue($value, $type); |
367 | 367 | |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | */ |
451 | 451 | private function translateNamespaces(Query\ResultSetMapping $rsm) |
452 | 452 | { |
453 | - $translate = function ($alias) { |
|
453 | + $translate = function($alias) { |
|
454 | 454 | return $this->em->getClassMetadata($alias)->getClassName(); |
455 | 455 | }; |
456 | 456 | |
@@ -512,7 +512,7 @@ discard block |
||
512 | 512 | */ |
513 | 513 | public function setResultCacheProfile(QueryCacheProfile $profile = null) |
514 | 514 | { |
515 | - if (! $profile->getResultCacheDriver()) { |
|
515 | + if ( ! $profile->getResultCacheDriver()) { |
|
516 | 516 | $resultCacheDriver = $this->em->getConfiguration()->getResultCacheImpl(); |
517 | 517 | $profile = $profile->setResultCacheDriver($resultCacheDriver); |
518 | 518 | } |
@@ -980,7 +980,7 @@ discard block |
||
980 | 980 | $this->getTimestampKey() |
981 | 981 | ); |
982 | 982 | |
983 | - $result = $queryCache->get($queryKey, $rsm, $this->hints); |
|
983 | + $result = $queryCache->get($queryKey, $rsm, $this->hints); |
|
984 | 984 | |
985 | 985 | if ($result !== null) { |
986 | 986 | if ($this->cacheLogger) { |
@@ -1114,6 +1114,6 @@ discard block |
||
1114 | 1114 | |
1115 | 1115 | ksort($hints); |
1116 | 1116 | |
1117 | - return sha1($query . '-' . serialize($params) . '-' . serialize($hints)); |
|
1117 | + return sha1($query.'-'.serialize($params).'-'.serialize($hints)); |
|
1118 | 1118 | } |
1119 | 1119 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM\Utility; |
6 | 6 | |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | $normalizedAssociatedId = []; |
26 | 26 | |
27 | 27 | foreach ($targetClass->getDeclaredPropertiesIterator() as $name => $declaredProperty) { |
28 | - if (! \array_key_exists($name, $flatIdentifier)) { |
|
28 | + if ( ! \array_key_exists($name, $flatIdentifier)) { |
|
29 | 29 | continue; |
30 | 30 | } |
31 | 31 |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | |
4 | -declare(strict_types=1); |
|
4 | +declare(strict_types = 1); |
|
5 | 5 | |
6 | 6 | namespace Doctrine\ORM\Proxy\Factory; |
7 | 7 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | */ |
72 | 72 | public function generateProxyClasses(array $classMetadataList) : int |
73 | 73 | { |
74 | - $concreteClasses = \array_filter($classMetadataList, function (ClassMetadata $metadata) : bool { |
|
74 | + $concreteClasses = \array_filter($classMetadataList, function(ClassMetadata $metadata) : bool { |
|
75 | 75 | return ! ($metadata->isMappedSuperclass || $metadata->getReflectionClass()->isAbstract()); |
76 | 76 | }); |
77 | 77 | |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | ->proxyFactory |
83 | 83 | ->createProxy( |
84 | 84 | $className, |
85 | - function () { |
|
85 | + function() { |
|
86 | 86 | // empty closure, serves its purpose, for now |
87 | 87 | }, |
88 | 88 | $this->cachedSkippedProperties[$className] |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | |
129 | 129 | private function makeInitializer(ClassMetadata $metadata, EntityPersister $persister) : \Closure |
130 | 130 | { |
131 | - return function ( |
|
131 | + return function( |
|
132 | 132 | GhostObjectInterface $ghostObject, |
133 | 133 | string $method, // we don't care |
134 | 134 | array $parameters, // we don't care |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | $identifier = $persister->getIdentifier($ghostObject); |
142 | 142 | |
143 | 143 | // @TODO how do we use `$properties` in the persister? That would be a massive optimisation |
144 | - if (! $persister->loadById($identifier, $ghostObject)) { |
|
144 | + if ( ! $persister->loadById($identifier, $ghostObject)) { |
|
145 | 145 | $initializer = $originalInitializer; |
146 | 146 | |
147 | 147 | throw EntityNotFoundException::fromClassNameAndIdentifier( |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | $transientFieldsFqns = []; |
168 | 168 | |
169 | 169 | foreach ($metadata->getDeclaredPropertiesIterator() as $name => $property) { |
170 | - if (! $property instanceof TransientMetadata) { |
|
170 | + if ( ! $property instanceof TransientMetadata) { |
|
171 | 171 | continue; |
172 | 172 | } |
173 | 173 | |
@@ -202,11 +202,11 @@ discard block |
||
202 | 202 | private function propertyFqcn(\ReflectionProperty $property) : string |
203 | 203 | { |
204 | 204 | if ($property->isPrivate()) { |
205 | - return "\0" . $property->getDeclaringClass()->getName() . "\0" . $property->getName(); |
|
205 | + return "\0".$property->getDeclaringClass()->getName()."\0".$property->getName(); |
|
206 | 206 | } |
207 | 207 | |
208 | 208 | if ($property->isProtected()) { |
209 | - return "\0*\0" . $property->getName(); |
|
209 | + return "\0*\0".$property->getName(); |
|
210 | 210 | } |
211 | 211 | |
212 | 212 | return $property->getName(); |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\Tests\ORM\Utility; |
6 | 6 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | self::assertSame(\array_keys($expectedId), \array_keys($id)); |
55 | 55 | |
56 | 56 | foreach ($expectedId as $field => $value) { |
57 | - if (! \is_object($value)) { |
|
57 | + if ( ! \is_object($value)) { |
|
58 | 58 | self::assertSame($id[$field], $value); |
59 | 59 | |
60 | 60 | continue; |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\Tests\ORM\Proxy; |
6 | 6 | |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | self::isInstanceOf(CompanyEmployee::class) |
206 | 206 | ) |
207 | 207 | ) |
208 | - ->willReturnCallback(function (array $id, CompanyEmployee $companyEmployee) { |
|
208 | + ->willReturnCallback(function(array $id, CompanyEmployee $companyEmployee) { |
|
209 | 209 | $companyEmployee->setSalary(1000); // A property on the CompanyEmployee |
210 | 210 | $companyEmployee->setName('Bob'); // A property on the parent class, CompanyPerson |
211 | 211 | |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | self::isInstanceOf(ComparableObject::class) |
265 | 265 | ) |
266 | 266 | ) |
267 | - ->willReturnCallback(function (array $id, ComparableObject $comparableObject) { |
|
267 | + ->willReturnCallback(function(array $id, ComparableObject $comparableObject) { |
|
268 | 268 | $comparableObject->setComparedFieldValue(\json_encode($id)); |
269 | 269 | |
270 | 270 | return $comparableObject; |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\Tests\Models\IdentityIsAssociation; |
6 | 6 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\Tests\Models\FriendObject; |
6 | 6 |
@@ -12,7 +12,6 @@ |
||
12 | 12 | use Doctrine\ORM\Mapping\ClassMetadata; |
13 | 13 | use Doctrine\ORM\Mapping\Driver\AnnotationDriver; |
14 | 14 | use Doctrine\ORM\Mapping\Driver\XmlDriver; |
15 | -use Doctrine\ORM\Mapping\Driver\PHPDriver; |
|
16 | 15 | use Doctrine\ORM\Mapping\ManyToManyAssociationMetadata; |
17 | 16 | use Doctrine\ORM\Mapping\OneToManyAssociationMetadata; |
18 | 17 | use Doctrine\ORM\Proxy\Factory\ProxyFactory; |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\Tests\ORM\Tools\Export; |
6 | 6 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | 'xml' => XmlDriver::class, |
66 | 66 | ]; |
67 | 67 | |
68 | - self::assertArrayHasKey($type, $mappingDriver, "There is no metadata driver for the type '" . $type . "'."); |
|
68 | + self::assertArrayHasKey($type, $mappingDriver, "There is no metadata driver for the type '".$type."'."); |
|
69 | 69 | |
70 | 70 | $class = $mappingDriver[$type]; |
71 | 71 | $driver = ($type === 'annotation') |
@@ -88,10 +88,10 @@ discard block |
||
88 | 88 | |
89 | 89 | public function testExportDirectoryAndFilesAreCreated() |
90 | 90 | { |
91 | - $this->deleteDirectory(__DIR__ . '/export/'.$this->getType()); |
|
91 | + $this->deleteDirectory(__DIR__.'/export/'.$this->getType()); |
|
92 | 92 | |
93 | 93 | $type = $this->getType(); |
94 | - $metadataDriver = $this->createMetadataDriver($type, __DIR__ . '/' . $type); |
|
94 | + $metadataDriver = $this->createMetadataDriver($type, __DIR__.'/'.$type); |
|
95 | 95 | $em = $this->createEntityManager($metadataDriver); |
96 | 96 | $cmf = $this->createClassMetadataFactory($em, $type); |
97 | 97 | $metadata = $cmf->getAllMetadata(); |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | |
104 | 104 | $type = $this->getType(); |
105 | 105 | $cme = new ClassMetadataExporter(); |
106 | - $exporter = $cme->getExporter($type, __DIR__ . '/export/' . $type); |
|
106 | + $exporter = $cme->getExporter($type, __DIR__.'/export/'.$type); |
|
107 | 107 | |
108 | 108 | if ($type === 'annotation') { |
109 | 109 | $exporter->setEntityGenerator(new EntityGenerator()); |
@@ -115,9 +115,9 @@ discard block |
||
115 | 115 | $exporter->export(); |
116 | 116 | |
117 | 117 | if ($type == 'annotation') { |
118 | - self::assertTrue(file_exists(__DIR__ . '/export/' . $type . '/'.str_replace('\\', '/', ExportedUser::class).$this->extension)); |
|
118 | + self::assertTrue(file_exists(__DIR__.'/export/'.$type.'/'.str_replace('\\', '/', ExportedUser::class).$this->extension)); |
|
119 | 119 | } else { |
120 | - self::assertTrue(file_exists(__DIR__ . '/export/' . $type . '/Doctrine.Tests.ORM.Tools.Export.ExportedUser'.$this->extension)); |
|
120 | + self::assertTrue(file_exists(__DIR__.'/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser'.$this->extension)); |
|
121 | 121 | } |
122 | 122 | } |
123 | 123 | |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | { |
129 | 129 | $type = $this->getType(); |
130 | 130 | |
131 | - $metadataDriver = $this->createMetadataDriver($type, __DIR__ . '/export/' . $type); |
|
131 | + $metadataDriver = $this->createMetadataDriver($type, __DIR__.'/export/'.$type); |
|
132 | 132 | $em = $this->createEntityManager($metadataDriver); |
133 | 133 | $cmf = $this->createClassMetadataFactory($em, $type); |
134 | 134 | $metadata = $cmf->getAllMetadata(); |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | $type = $this->getType(); |
382 | 382 | |
383 | 383 | if ($type === 'xml') { |
384 | - $xml = simplexml_load_file(__DIR__ . '/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.xml'); |
|
384 | + $xml = simplexml_load_file(__DIR__.'/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.xml'); |
|
385 | 385 | |
386 | 386 | $xml->registerXPathNamespace("d", "http://doctrine-project.org/schemas/orm/doctrine-mapping"); |
387 | 387 | $nodes = $xml->xpath("/d:doctrine-mapping/d:entity/d:one-to-many[@field='interests']/d:cascade/d:*"); |
@@ -405,10 +405,10 @@ discard block |
||
405 | 405 | if (is_file($path)) { |
406 | 406 | return unlink($path); |
407 | 407 | } else if (is_dir($path)) { |
408 | - $files = glob(rtrim($path,'/').'/*'); |
|
408 | + $files = glob(rtrim($path, '/').'/*'); |
|
409 | 409 | |
410 | 410 | if (is_array($files)) { |
411 | - foreach ($files as $file){ |
|
411 | + foreach ($files as $file) { |
|
412 | 412 | $this->deleteDirectory($file); |
413 | 413 | } |
414 | 414 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\Tests; |
6 | 6 | |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | $conn->executeUpdate('DELETE FROM RoutingLocation'); |
403 | 403 | } |
404 | 404 | |
405 | - if(isset($this->usedModelSets['navigation'])) { |
|
405 | + if (isset($this->usedModelSets['navigation'])) { |
|
406 | 406 | $conn->executeUpdate('DELETE FROM navigation_tour_pois'); |
407 | 407 | $conn->executeUpdate('DELETE FROM navigation_photos'); |
408 | 408 | $conn->executeUpdate('DELETE FROM navigation_pois'); |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | $conn->executeUpdate('DELETE FROM navigation_countries'); |
411 | 411 | } |
412 | 412 | if (isset($this->usedModelSets['directorytree'])) { |
413 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier("file")); |
|
413 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier("file")); |
|
414 | 414 | // MySQL doesn't know deferred deletions therefore only executing the second query gives errors. |
415 | 415 | $conn->executeUpdate('DELETE FROM Directory WHERE parentDirectory_id IS NOT NULL'); |
416 | 416 | $conn->executeUpdate('DELETE FROM Directory'); |
@@ -500,12 +500,12 @@ discard block |
||
500 | 500 | ) |
501 | 501 | ); |
502 | 502 | |
503 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-users-groups')); |
|
504 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier("quote-group")); |
|
505 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier("quote-phone")); |
|
506 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier("quote-user")); |
|
507 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier("quote-address")); |
|
508 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-city')); |
|
503 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-users-groups')); |
|
504 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier("quote-group")); |
|
505 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier("quote-phone")); |
|
506 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier("quote-user")); |
|
507 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier("quote-address")); |
|
508 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-city')); |
|
509 | 509 | } |
510 | 510 | |
511 | 511 | if (isset($this->usedModelSets['vct_onetoone'])) { |
@@ -640,15 +640,15 @@ discard block |
||
640 | 640 | { |
641 | 641 | $this->setUpDBALTypes(); |
642 | 642 | |
643 | - if (! isset(static::$sharedConn)) { |
|
643 | + if ( ! isset(static::$sharedConn)) { |
|
644 | 644 | static::$sharedConn = TestUtil::getConnection(); |
645 | 645 | } |
646 | 646 | |
647 | 647 | if (isset($GLOBALS['DOCTRINE_MARK_SQL_LOGS'])) { |
648 | 648 | if (in_array(static::$sharedConn->getDatabasePlatform()->getName(), ["mysql", "postgresql"])) { |
649 | - static::$sharedConn->executeQuery('SELECT 1 /*' . get_class($this) . '*/'); |
|
649 | + static::$sharedConn->executeQuery('SELECT 1 /*'.get_class($this).'*/'); |
|
650 | 650 | } else if (static::$sharedConn->getDatabasePlatform()->getName() === "oracle") { |
651 | - static::$sharedConn->executeQuery('SELECT 1 /*' . get_class($this) . '*/ FROM dual'); |
|
651 | + static::$sharedConn->executeQuery('SELECT 1 /*'.get_class($this).'*/ FROM dual'); |
|
652 | 652 | } |
653 | 653 | } |
654 | 654 | |
@@ -658,7 +658,7 @@ discard block |
||
658 | 658 | } |
659 | 659 | |
660 | 660 | foreach ($this->usedModelSets as $setName => $bool) { |
661 | - if (! isset(static::$tablesCreated[$setName])) { |
|
661 | + if ( ! isset(static::$tablesCreated[$setName])) { |
|
662 | 662 | $this->setUpEntitySchema(static::$modelSets[$setName]); |
663 | 663 | |
664 | 664 | static::$tablesCreated[$setName] = true; |
@@ -733,8 +733,8 @@ discard block |
||
733 | 733 | |
734 | 734 | $config->setMetadataDriverImpl( |
735 | 735 | $config->newDefaultAnnotationDriver([ |
736 | - realpath(__DIR__ . '/Models/Cache'), |
|
737 | - realpath(__DIR__ . '/Models/GeoNames') |
|
736 | + realpath(__DIR__.'/Models/Cache'), |
|
737 | + realpath(__DIR__.'/Models/GeoNames') |
|
738 | 738 | ]) |
739 | 739 | ); |
740 | 740 | |
@@ -798,9 +798,9 @@ discard block |
||
798 | 798 | $trace = $e->getTrace(); |
799 | 799 | $traceMsg = ""; |
800 | 800 | |
801 | - foreach($trace AS $part) { |
|
802 | - if(isset($part['file'])) { |
|
803 | - if(strpos($part['file'], "PHPUnit/") !== false) { |
|
801 | + foreach ($trace AS $part) { |
|
802 | + if (isset($part['file'])) { |
|
803 | + if (strpos($part['file'], "PHPUnit/") !== false) { |
|
804 | 804 | // Beginning with PHPUnit files we don't print the trace anymore. |
805 | 805 | break; |
806 | 806 | } |
@@ -811,7 +811,7 @@ discard block |
||
811 | 811 | |
812 | 812 | $message = "[".get_class($e)."] ".$e->getMessage().PHP_EOL.PHP_EOL."With queries:".PHP_EOL.$queries.PHP_EOL."Trace:".PHP_EOL.$traceMsg; |
813 | 813 | |
814 | - throw new \Exception($message, (int)$e->getCode(), $e); |
|
814 | + throw new \Exception($message, (int) $e->getCode(), $e); |
|
815 | 815 | } |
816 | 816 | |
817 | 817 | throw $e; |