@@ -57,6 +57,9 @@ discard block |
||
| 57 | 57 | return EntityManagerMock::create($connection, $config, $eventManager); |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | + /** |
|
| 61 | + * @param string $path |
|
| 62 | + */ |
|
| 60 | 63 | protected function createMetadataDriver($type, $path) |
| 61 | 64 | { |
| 62 | 65 | $mappingDriver = [ |
@@ -75,6 +78,9 @@ discard block |
||
| 75 | 78 | return $driver; |
| 76 | 79 | } |
| 77 | 80 | |
| 81 | + /** |
|
| 82 | + * @param EntityManagerMock $em |
|
| 83 | + */ |
|
| 78 | 84 | protected function createClassMetadataFactory($em, $type) |
| 79 | 85 | { |
| 80 | 86 | $factory = ($type === 'annotation') |
@@ -294,7 +300,6 @@ discard block |
||
| 294 | 300 | |
| 295 | 301 | /** |
| 296 | 302 | * @depends testOneToManyAssociationsAreExported |
| 297 | - * @param ClassMetadata $metadata |
|
| 298 | 303 | */ |
| 299 | 304 | public function testManyToManyAssociationsAreExported($class) |
| 300 | 305 | { |
@@ -406,6 +411,9 @@ discard block |
||
| 406 | 411 | # $this->deleteDirectory(__DIR__ . '/export/'.$this->getType()); |
| 407 | 412 | } |
| 408 | 413 | |
| 414 | + /** |
|
| 415 | + * @param string $path |
|
| 416 | + */ |
|
| 409 | 417 | protected function deleteDirectory($path) |
| 410 | 418 | { |
| 411 | 419 | if (is_file($path)) { |
@@ -381,7 +381,7 @@ |
||
| 381 | 381 | |
| 382 | 382 | self::assertEquals('user', $property->getInversedBy()); |
| 383 | 383 | } |
| 384 | - /** |
|
| 384 | + /** |
|
| 385 | 385 | * @depends testExportDirectoryAndFilesAreCreated |
| 386 | 386 | */ |
| 387 | 387 | public function testCascadeAllCollapsed() |
@@ -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\Tools\DisconnectedClassMetadataFactory; |
@@ -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 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | $driverMock = new DriverMock(); |
| 45 | 45 | $config = new Configuration(); |
| 46 | 46 | |
| 47 | - $config->setProxyDir(__DIR__ . '/../../Proxies'); |
|
| 47 | + $config->setProxyDir(__DIR__.'/../../Proxies'); |
|
| 48 | 48 | $config->setProxyNamespace('Doctrine\Tests\Proxies'); |
| 49 | 49 | $eventManager = new EventManager(); |
| 50 | 50 | $conn = new ConnectionMock([], $driverMock, $config, $eventManager); |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | 'xml' => XmlDriver::class, |
| 65 | 65 | ]; |
| 66 | 66 | |
| 67 | - self::assertArrayHasKey($type, $mappingDriver, "There is no metadata driver for the type '" . $type . "'."); |
|
| 67 | + self::assertArrayHasKey($type, $mappingDriver, "There is no metadata driver for the type '".$type."'."); |
|
| 68 | 68 | |
| 69 | 69 | $class = $mappingDriver[$type]; |
| 70 | 70 | $driver = ($type === 'annotation') |
@@ -87,10 +87,10 @@ discard block |
||
| 87 | 87 | |
| 88 | 88 | public function testExportDirectoryAndFilesAreCreated() |
| 89 | 89 | { |
| 90 | - $this->deleteDirectory(__DIR__ . '/export/'.$this->getType()); |
|
| 90 | + $this->deleteDirectory(__DIR__.'/export/'.$this->getType()); |
|
| 91 | 91 | |
| 92 | 92 | $type = $this->getType(); |
| 93 | - $metadataDriver = $this->createMetadataDriver($type, __DIR__ . '/' . $type); |
|
| 93 | + $metadataDriver = $this->createMetadataDriver($type, __DIR__.'/'.$type); |
|
| 94 | 94 | $em = $this->createEntityManager($metadataDriver); |
| 95 | 95 | $cmf = $this->createClassMetadataFactory($em, $type); |
| 96 | 96 | $metadata = $cmf->getAllMetadata(); |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | |
| 103 | 103 | $type = $this->getType(); |
| 104 | 104 | $cme = new ClassMetadataExporter(); |
| 105 | - $exporter = $cme->getExporter($type, __DIR__ . '/export/' . $type); |
|
| 105 | + $exporter = $cme->getExporter($type, __DIR__.'/export/'.$type); |
|
| 106 | 106 | |
| 107 | 107 | if ($type === 'annotation') { |
| 108 | 108 | $exporter->setEntityGenerator(new EntityGenerator()); |
@@ -114,9 +114,9 @@ discard block |
||
| 114 | 114 | $exporter->export(); |
| 115 | 115 | |
| 116 | 116 | if ($type == 'annotation') { |
| 117 | - self::assertTrue(file_exists(__DIR__ . '/export/' . $type . '/'.str_replace('\\', '/', ExportedUser::class).$this->extension)); |
|
| 117 | + self::assertTrue(file_exists(__DIR__.'/export/'.$type.'/'.str_replace('\\', '/', ExportedUser::class).$this->extension)); |
|
| 118 | 118 | } else { |
| 119 | - self::assertTrue(file_exists(__DIR__ . '/export/' . $type . '/Doctrine.Tests.ORM.Tools.Export.ExportedUser'.$this->extension)); |
|
| 119 | + self::assertTrue(file_exists(__DIR__.'/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser'.$this->extension)); |
|
| 120 | 120 | } |
| 121 | 121 | } |
| 122 | 122 | |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | { |
| 128 | 128 | $type = $this->getType(); |
| 129 | 129 | |
| 130 | - $metadataDriver = $this->createMetadataDriver($type, __DIR__ . '/export/' . $type); |
|
| 130 | + $metadataDriver = $this->createMetadataDriver($type, __DIR__.'/export/'.$type); |
|
| 131 | 131 | $em = $this->createEntityManager($metadataDriver); |
| 132 | 132 | $cmf = $this->createClassMetadataFactory($em, $type); |
| 133 | 133 | $metadata = $cmf->getAllMetadata(); |
@@ -380,7 +380,7 @@ discard block |
||
| 380 | 380 | $type = $this->getType(); |
| 381 | 381 | |
| 382 | 382 | if ($type === 'xml') { |
| 383 | - $xml = simplexml_load_file(__DIR__ . '/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.xml'); |
|
| 383 | + $xml = simplexml_load_file(__DIR__.'/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.xml'); |
|
| 384 | 384 | |
| 385 | 385 | $xml->registerXPathNamespace("d", "http://doctrine-project.org/schemas/orm/doctrine-mapping"); |
| 386 | 386 | $nodes = $xml->xpath("/d:doctrine-mapping/d:entity/d:one-to-many[@field='interests']/d:cascade/d:*"); |
@@ -404,10 +404,10 @@ discard block |
||
| 404 | 404 | if (is_file($path)) { |
| 405 | 405 | return unlink($path); |
| 406 | 406 | } else if (is_dir($path)) { |
| 407 | - $files = glob(rtrim($path,'/').'/*'); |
|
| 407 | + $files = glob(rtrim($path, '/').'/*'); |
|
| 408 | 408 | |
| 409 | 409 | if (is_array($files)) { |
| 410 | - foreach ($files as $file){ |
|
| 410 | + foreach ($files as $file) { |
|
| 411 | 411 | $this->deleteDirectory($file); |
| 412 | 412 | } |
| 413 | 413 | } |
@@ -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 | } |
@@ -7,10 +7,8 @@ discard block |
||
| 7 | 7 | use Doctrine\Common\Collections\ArrayCollection; |
| 8 | 8 | use Doctrine\Common\EventManager; |
| 9 | 9 | use Doctrine\Common\NotifyPropertyChanged; |
| 10 | -use Doctrine\Common\Persistence\Event\LifecycleEventArgs; |
|
| 11 | 10 | use Doctrine\Common\PropertyChangedListener; |
| 12 | 11 | use Doctrine\ORM\Annotation as ORM; |
| 13 | -use Doctrine\ORM\Events; |
|
| 14 | 12 | use Doctrine\ORM\Mapping\ClassMetadata; |
| 15 | 13 | use Doctrine\ORM\Mapping\ClassMetadataBuildingContext; |
| 16 | 14 | use Doctrine\ORM\Mapping\ClassMetadataFactory; |
@@ -24,7 +22,6 @@ discard block |
||
| 24 | 22 | use Doctrine\Tests\Mocks\EntityPersisterMock; |
| 25 | 23 | use Doctrine\Tests\Mocks\UnitOfWorkMock; |
| 26 | 24 | use Doctrine\Tests\Models\CMS\CmsPhonenumber; |
| 27 | -use Doctrine\Tests\Models\CMS\CmsUser; |
|
| 28 | 25 | use Doctrine\Tests\Models\Forum\ForumAvatar; |
| 29 | 26 | use Doctrine\Tests\Models\Forum\ForumUser; |
| 30 | 27 | use Doctrine\Tests\Models\GeoNames\City; |
@@ -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 | |
@@ -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 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | { |
| 67 | 67 | $reader = new Annotations\CachedReader(new Annotations\AnnotationReader(), new ArrayCache()); |
| 68 | 68 | |
| 69 | - Annotations\AnnotationRegistry::registerFile(__DIR__ . "/../../../lib/Doctrine/ORM/Annotation/DoctrineAnnotations.php"); |
|
| 69 | + Annotations\AnnotationRegistry::registerFile(__DIR__."/../../../lib/Doctrine/ORM/Annotation/DoctrineAnnotations.php"); |
|
| 70 | 70 | |
| 71 | 71 | return new AnnotationDriver($reader, (array) $paths); |
| 72 | 72 | } |
@@ -97,11 +97,11 @@ discard block |
||
| 97 | 97 | $config->setMetadataCacheImpl($metadataCache); |
| 98 | 98 | $config->setMetadataDriverImpl($config->newDefaultAnnotationDriver([])); |
| 99 | 99 | $config->setQueryCacheImpl(self::getSharedQueryCacheImpl()); |
| 100 | - $config->setProxyDir(__DIR__ . '/Proxies'); |
|
| 100 | + $config->setProxyDir(__DIR__.'/Proxies'); |
|
| 101 | 101 | $config->setProxyNamespace('Doctrine\Tests\Proxies'); |
| 102 | 102 | $config->setMetadataDriverImpl( |
| 103 | 103 | $config->newDefaultAnnotationDriver([ |
| 104 | - realpath(__DIR__ . '/Models/Cache') |
|
| 104 | + realpath(__DIR__.'/Models/Cache') |
|
| 105 | 105 | ]) |
| 106 | 106 | ); |
| 107 | 107 | |
@@ -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 | |
@@ -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\Proxy; |
| 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 | |