@@ -654,6 +654,9 @@ discard block |
||
654 | 654 | return $this->items; |
655 | 655 | } |
656 | 656 | |
657 | + /** |
|
658 | + * @param string $value |
|
659 | + */ |
|
657 | 660 | public function setTransient($value) { |
658 | 661 | if ($value != $this->transient) { |
659 | 662 | $this->onPropertyChanged('transient', $this->transient, $value); |
@@ -665,6 +668,9 @@ discard block |
||
665 | 668 | return $this->data; |
666 | 669 | } |
667 | 670 | |
671 | + /** |
|
672 | + * @param string $data |
|
673 | + */ |
|
668 | 674 | public function setData($data) { |
669 | 675 | if ($data != $this->data) { |
670 | 676 | $this->onPropertyChanged('data', $this->data, $data); |
@@ -677,6 +683,9 @@ discard block |
||
677 | 683 | $this->listeners[] = $listener; |
678 | 684 | } |
679 | 685 | |
686 | + /** |
|
687 | + * @param string $propName |
|
688 | + */ |
|
680 | 689 | protected function onPropertyChanged($propName, $oldValue, $newValue) { |
681 | 690 | if ($this->listeners) { |
682 | 691 | foreach ($this->listeners as $listener) { |
@@ -707,6 +716,9 @@ discard block |
||
707 | 716 | return $this->owner; |
708 | 717 | } |
709 | 718 | |
719 | + /** |
|
720 | + * @param NotifyChangedEntity|null $owner |
|
721 | + */ |
|
710 | 722 | public function setOwner($owner) { |
711 | 723 | $this->owner = $owner; |
712 | 724 | } |
@@ -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; |
6 | 6 | |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | 'empty string, single field' => [$emptyString, ''], |
451 | 451 | 'non-empty string, single field' => [$nonEmptyString, $nonEmptyString->id], |
452 | 452 | 'empty strings, two fields' => [$emptyStrings, ' '], |
453 | - 'non-empty strings, two fields' => [$nonEmptyStrings, $nonEmptyStrings->id1 . ' ' . $nonEmptyStrings->id2], |
|
453 | + 'non-empty strings, two fields' => [$nonEmptyStrings, $nonEmptyStrings->id1.' '.$nonEmptyStrings->id2], |
|
454 | 454 | 'boolean true' => [$booleanTrue, '1'], |
455 | 455 | 'boolean false' => [$booleanFalse, ''], |
456 | 456 | ]; |
@@ -481,7 +481,7 @@ discard block |
||
481 | 481 | |
482 | 482 | public function entitiesWithInvalidIdentifiersProvider() |
483 | 483 | { |
484 | - $firstNullString = new EntityWithCompositeStringIdentifier(); |
|
484 | + $firstNullString = new EntityWithCompositeStringIdentifier(); |
|
485 | 485 | |
486 | 486 | $firstNullString->id2 = uniqid('id2', true); |
487 | 487 |
@@ -9,7 +9,6 @@ |
||
9 | 9 | use Doctrine\Common\NotifyPropertyChanged; |
10 | 10 | use Doctrine\Common\PropertyChangedListener; |
11 | 11 | use Doctrine\ORM\Annotation as ORM; |
12 | -use Doctrine\ORM\Events; |
|
13 | 12 | use Doctrine\ORM\Mapping\ClassMetadata; |
14 | 13 | use Doctrine\ORM\Mapping\ClassMetadataBuildingContext; |
15 | 14 | use Doctrine\ORM\Mapping\ClassMetadataFactory; |
@@ -58,7 +58,7 @@ |
||
58 | 58 | protected $secondLevelCacheDriverImpl = null; |
59 | 59 | |
60 | 60 | /** |
61 | - * @param array $paths |
|
61 | + * @param string[] $paths |
|
62 | 62 | * |
63 | 63 | * @return \Doctrine\ORM\Mapping\Driver\AnnotationDriver |
64 | 64 | */ |
@@ -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 | |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | { |
68 | 68 | $reader = new Annotations\CachedReader(new Annotations\AnnotationReader(), new ArrayCache()); |
69 | 69 | |
70 | - Annotations\AnnotationRegistry::registerFile(__DIR__ . "/../../../lib/Doctrine/ORM/Annotation/DoctrineAnnotations.php"); |
|
70 | + Annotations\AnnotationRegistry::registerFile(__DIR__."/../../../lib/Doctrine/ORM/Annotation/DoctrineAnnotations.php"); |
|
71 | 71 | |
72 | 72 | return new AnnotationDriver($reader, (array) $paths); |
73 | 73 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | $config->setAutoGenerateProxyClasses(ProxyFactory::AUTOGENERATE_EVAL); |
107 | 107 | $config->setMetadataDriverImpl( |
108 | 108 | $config->newDefaultAnnotationDriver([ |
109 | - realpath(__DIR__ . '/Models/Cache') |
|
109 | + realpath(__DIR__.'/Models/Cache') |
|
110 | 110 | ]) |
111 | 111 | ); |
112 | 112 |
@@ -2,28 +2,28 @@ |
||
2 | 2 | /* |
3 | 3 | * This file bootstraps the test environment. |
4 | 4 | */ |
5 | -declare(strict_types=1); |
|
5 | +declare(strict_types = 1); |
|
6 | 6 | |
7 | 7 | namespace Doctrine\Tests; |
8 | 8 | |
9 | 9 | error_reporting(E_ALL | E_STRICT); |
10 | 10 | date_default_timezone_set('UTC'); |
11 | 11 | |
12 | -if (file_exists(__DIR__ . '/../../../vendor/autoload.php')) { |
|
12 | +if (file_exists(__DIR__.'/../../../vendor/autoload.php')) { |
|
13 | 13 | // dependencies were installed via composer - this is the main project |
14 | - require __DIR__ . '/../../../vendor/autoload.php'; |
|
15 | -} elseif (file_exists(__DIR__ . '/../../../../../autoload.php')) { |
|
14 | + require __DIR__.'/../../../vendor/autoload.php'; |
|
15 | +} elseif (file_exists(__DIR__.'/../../../../../autoload.php')) { |
|
16 | 16 | // installed as a dependency in `vendor` |
17 | - require __DIR__ . '/../../../../../autoload.php'; |
|
17 | + require __DIR__.'/../../../../../autoload.php'; |
|
18 | 18 | } else { |
19 | 19 | throw new \Exception('Can\'t find autoload.php. Did you install dependencies via composer?'); |
20 | 20 | } |
21 | 21 | |
22 | -if ( ! file_exists(__DIR__ . '/Proxies') && ! mkdir(__DIR__ . '/Proxies')) { |
|
23 | - throw new \Exception("Could not create " . __DIR__."/Proxies Folder."); |
|
22 | +if ( ! file_exists(__DIR__.'/Proxies') && ! mkdir(__DIR__.'/Proxies')) { |
|
23 | + throw new \Exception("Could not create ".__DIR__."/Proxies Folder."); |
|
24 | 24 | } |
25 | 25 | |
26 | -if ( ! file_exists(__DIR__ . '/ORM/Proxy/generated') && ! mkdir(__DIR__ . '/ORM/Proxy/generated')) { |
|
27 | - throw new \Exception('Could not create ' . __DIR__ . '/ORM/Proxy/generated Folder.'); |
|
26 | +if ( ! file_exists(__DIR__.'/ORM/Proxy/generated') && ! mkdir(__DIR__.'/ORM/Proxy/generated')) { |
|
27 | + throw new \Exception('Could not create '.__DIR__.'/ORM/Proxy/generated Folder.'); |
|
28 | 28 | } |
29 | 29 |
@@ -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; |
6 | 6 |
@@ -786,7 +786,11 @@ |
||
786 | 786 | foreach ($last25queries as $i => $query) { |
787 | 787 | $params = array_map( |
788 | 788 | function($p) { |
789 | - if (is_object($p)) return get_class($p); else return var_export($p, true); |
|
789 | + if (is_object($p)) { |
|
790 | + return get_class($p); |
|
791 | + } else { |
|
792 | + return var_export($p, true); |
|
793 | + } |
|
790 | 794 | }, |
791 | 795 | $query['params'] ?: [] |
792 | 796 | ); |
@@ -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 | |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | $conn->executeUpdate('DELETE FROM RoutingLocation'); |
404 | 404 | } |
405 | 405 | |
406 | - if(isset($this->usedModelSets['navigation'])) { |
|
406 | + if (isset($this->usedModelSets['navigation'])) { |
|
407 | 407 | $conn->executeUpdate('DELETE FROM navigation_tour_pois'); |
408 | 408 | $conn->executeUpdate('DELETE FROM navigation_photos'); |
409 | 409 | $conn->executeUpdate('DELETE FROM navigation_pois'); |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | } |
413 | 413 | |
414 | 414 | if (isset($this->usedModelSets['directorytree'])) { |
415 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier("file")); |
|
415 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier("file")); |
|
416 | 416 | // MySQL doesn't know deferred deletions therefore only executing the second query gives errors. |
417 | 417 | $conn->executeUpdate('DELETE FROM Directory WHERE parentDirectory_id IS NOT NULL'); |
418 | 418 | $conn->executeUpdate('DELETE FROM Directory'); |
@@ -505,12 +505,12 @@ discard block |
||
505 | 505 | ) |
506 | 506 | ); |
507 | 507 | |
508 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-users-groups')); |
|
509 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier("quote-group")); |
|
510 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier("quote-phone")); |
|
511 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier("quote-user")); |
|
512 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier("quote-address")); |
|
513 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-city')); |
|
508 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-users-groups')); |
|
509 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier("quote-group")); |
|
510 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier("quote-phone")); |
|
511 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier("quote-user")); |
|
512 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier("quote-address")); |
|
513 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-city')); |
|
514 | 514 | } |
515 | 515 | |
516 | 516 | if (isset($this->usedModelSets['vct_onetoone'])) { |
@@ -645,15 +645,15 @@ discard block |
||
645 | 645 | { |
646 | 646 | $this->setUpDBALTypes(); |
647 | 647 | |
648 | - if (! isset(static::$sharedConn)) { |
|
648 | + if ( ! isset(static::$sharedConn)) { |
|
649 | 649 | static::$sharedConn = TestUtil::getConnection(); |
650 | 650 | } |
651 | 651 | |
652 | 652 | if (isset($GLOBALS['DOCTRINE_MARK_SQL_LOGS'])) { |
653 | 653 | if (in_array(static::$sharedConn->getDatabasePlatform()->getName(), ["mysql", "postgresql"])) { |
654 | - static::$sharedConn->executeQuery('SELECT 1 /*' . get_class($this) . '*/'); |
|
654 | + static::$sharedConn->executeQuery('SELECT 1 /*'.get_class($this).'*/'); |
|
655 | 655 | } else if (static::$sharedConn->getDatabasePlatform()->getName() === "oracle") { |
656 | - static::$sharedConn->executeQuery('SELECT 1 /*' . get_class($this) . '*/ FROM dual'); |
|
656 | + static::$sharedConn->executeQuery('SELECT 1 /*'.get_class($this).'*/ FROM dual'); |
|
657 | 657 | } |
658 | 658 | } |
659 | 659 | |
@@ -663,7 +663,7 @@ discard block |
||
663 | 663 | } |
664 | 664 | |
665 | 665 | foreach ($this->usedModelSets as $setName => $bool) { |
666 | - if (! isset(static::$tablesCreated[$setName])) { |
|
666 | + if ( ! isset(static::$tablesCreated[$setName])) { |
|
667 | 667 | $this->setUpEntitySchema(static::$modelSets[$setName]); |
668 | 668 | |
669 | 669 | static::$tablesCreated[$setName] = true; |
@@ -738,8 +738,8 @@ discard block |
||
738 | 738 | |
739 | 739 | $config->setMetadataDriverImpl( |
740 | 740 | $mappingDriver ?? $config->newDefaultAnnotationDriver([ |
741 | - realpath(__DIR__ . '/Models/Cache'), |
|
742 | - realpath(__DIR__ . '/Models/GeoNames') |
|
741 | + realpath(__DIR__.'/Models/Cache'), |
|
742 | + realpath(__DIR__.'/Models/GeoNames') |
|
743 | 743 | ]) |
744 | 744 | ); |
745 | 745 | |
@@ -803,9 +803,9 @@ discard block |
||
803 | 803 | $trace = $e->getTrace(); |
804 | 804 | $traceMsg = ""; |
805 | 805 | |
806 | - foreach($trace AS $part) { |
|
807 | - if(isset($part['file'])) { |
|
808 | - if(strpos($part['file'], "PHPUnit/") !== false) { |
|
806 | + foreach ($trace AS $part) { |
|
807 | + if (isset($part['file'])) { |
|
808 | + if (strpos($part['file'], "PHPUnit/") !== false) { |
|
809 | 809 | // Beginning with PHPUnit files we don't print the trace anymore. |
810 | 810 | break; |
811 | 811 | } |
@@ -816,7 +816,7 @@ discard block |
||
816 | 816 | |
817 | 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 | - throw new \Exception($message, (int)$e->getCode(), $e); |
|
819 | + throw new \Exception($message, (int) $e->getCode(), $e); |
|
820 | 820 | } |
821 | 821 | |
822 | 822 | throw $e; |
@@ -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\ORM; |
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\ORM\Utility; |
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\ORM\Mapping; |
6 | 6 |
@@ -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\Mapping; |
6 | 6 | |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | { |
21 | 21 | protected function loadDriver() |
22 | 22 | { |
23 | - return new XmlDriver(__DIR__ . DIRECTORY_SEPARATOR . 'xml'); |
|
23 | + return new XmlDriver(__DIR__.DIRECTORY_SEPARATOR.'xml'); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | public function testClassTableInheritanceDiscriminatorMap() |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | */ |
163 | 163 | public function testValidateXmlSchema($xmlMappingFile) |
164 | 164 | { |
165 | - $xsdSchemaFile = __DIR__ . '/../../../../../doctrine-mapping.xsd'; |
|
165 | + $xsdSchemaFile = __DIR__.'/../../../../../doctrine-mapping.xsd'; |
|
166 | 166 | $dom = new \DOMDocument('UTF-8'); |
167 | 167 | |
168 | 168 | $dom->load($xmlMappingFile); |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | |
173 | 173 | static public function dataValidSchema() |
174 | 174 | { |
175 | - $list = glob(__DIR__ . '/xml/*.xml'); |
|
175 | + $list = glob(__DIR__.'/xml/*.xml'); |
|
176 | 176 | $invalid = [ |
177 | 177 | 'Doctrine.Tests.Models.DDC889.DDC889Class.dcm' |
178 | 178 | ]; |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | return ! in_array(pathinfo($item, PATHINFO_FILENAME), $invalid); |
182 | 182 | }); |
183 | 183 | |
184 | - return array_map(function($item){ |
|
184 | + return array_map(function($item) { |
|
185 | 185 | return [$item]; |
186 | 186 | }, $list); |
187 | 187 | } |
@@ -7,7 +7,6 @@ |
||
7 | 7 | use Doctrine\ORM\Mapping\ClassMetadata; |
8 | 8 | use Doctrine\ORM\Mapping\ClassMetadataFactory; |
9 | 9 | use Doctrine\ORM\Mapping\Driver\XmlDriver; |
10 | -use Doctrine\ORM\Reflection\RuntimeReflectionService; |
|
11 | 10 | use Doctrine\Tests\Models\DDC117\DDC117Translation; |
12 | 11 | use Doctrine\Tests\Models\DDC3293\DDC3293User; |
13 | 12 | use Doctrine\Tests\Models\DDC3293\DDC3293UserPrefixed; |