@@ -24,7 +24,7 @@ |
||
| 24 | 24 | $this->expectedDeprecations = []; |
| 25 | 25 | |
| 26 | 26 | $this->originalHandler = set_error_handler( |
| 27 | - function (int $errorNumber, string $errorMessage) : void { |
|
| 27 | + function(int $errorNumber, string $errorMessage) : void { |
|
| 28 | 28 | $this->actualDeprecations[] = $errorMessage; |
| 29 | 29 | }, |
| 30 | 30 | E_USER_DEPRECATED |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | { |
| 45 | 45 | $driverMock = new DriverMock(); |
| 46 | 46 | $config = new Configuration(); |
| 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); |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | 'yaml' => YamlDriver::class, |
| 63 | 63 | ]; |
| 64 | 64 | |
| 65 | - $this->assertArrayHasKey($type, $mappingDriver, "There is no metadata driver for the type '" . $type . "'."); |
|
| 65 | + $this->assertArrayHasKey($type, $mappingDriver, "There is no metadata driver for the type '".$type."'."); |
|
| 66 | 66 | |
| 67 | 67 | $class = $mappingDriver[$type]; |
| 68 | 68 | $driver = ($type === 'annotation') |
@@ -85,10 +85,10 @@ discard block |
||
| 85 | 85 | |
| 86 | 86 | public function testExportDirectoryAndFilesAreCreated() |
| 87 | 87 | { |
| 88 | - $this->_deleteDirectory(__DIR__ . '/export/'.$this->_getType()); |
|
| 88 | + $this->_deleteDirectory(__DIR__.'/export/'.$this->_getType()); |
|
| 89 | 89 | |
| 90 | 90 | $type = $this->_getType(); |
| 91 | - $metadataDriver = $this->_createMetadataDriver($type, __DIR__ . '/' . $type); |
|
| 91 | + $metadataDriver = $this->_createMetadataDriver($type, __DIR__.'/'.$type); |
|
| 92 | 92 | $em = $this->_createEntityManager($metadataDriver); |
| 93 | 93 | $cmf = $this->_createClassMetadataFactory($em, $type); |
| 94 | 94 | $metadata = $cmf->getAllMetadata(); |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | |
| 100 | 100 | $type = $this->_getType(); |
| 101 | 101 | $cme = new ClassMetadataExporter(); |
| 102 | - $exporter = $cme->getExporter($type, __DIR__ . '/export/' . $type); |
|
| 102 | + $exporter = $cme->getExporter($type, __DIR__.'/export/'.$type); |
|
| 103 | 103 | |
| 104 | 104 | if ($type === 'annotation') { |
| 105 | 105 | $entityGenerator = new EntityGenerator(); |
@@ -114,9 +114,9 @@ discard block |
||
| 114 | 114 | $exporter->export(); |
| 115 | 115 | |
| 116 | 116 | if ($type == 'annotation') { |
| 117 | - $this->assertTrue(file_exists(__DIR__ . '/export/' . $type . '/'.str_replace('\\', '/', ExportedUser::class).$this->_extension)); |
|
| 117 | + $this->assertTrue(file_exists(__DIR__.'/export/'.$type.'/'.str_replace('\\', '/', ExportedUser::class).$this->_extension)); |
|
| 118 | 118 | } else { |
| 119 | - $this->assertTrue(file_exists(__DIR__ . '/export/' . $type . '/Doctrine.Tests.ORM.Tools.Export.ExportedUser'.$this->_extension)); |
|
| 119 | + $this->assertTrue(file_exists(__DIR__.'/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser'.$this->_extension)); |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | $this->assertHasDeprecationMessages(); |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | { |
| 130 | 130 | $type = $this->_getType(); |
| 131 | 131 | |
| 132 | - $metadataDriver = $this->_createMetadataDriver($type, __DIR__ . '/export/' . $type); |
|
| 132 | + $metadataDriver = $this->_createMetadataDriver($type, __DIR__.'/export/'.$type); |
|
| 133 | 133 | $em = $this->_createEntityManager($metadataDriver); |
| 134 | 134 | $cmf = $this->_createClassMetadataFactory($em, $type); |
| 135 | 135 | $metadata = $cmf->getAllMetadata(); |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | $type = $this->_getType(); |
| 216 | 216 | |
| 217 | 217 | if ($type == 'xml') { |
| 218 | - $xml = simplexml_load_file(__DIR__ . '/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.xml'); |
|
| 218 | + $xml = simplexml_load_file(__DIR__.'/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.xml'); |
|
| 219 | 219 | |
| 220 | 220 | $xml->registerXPathNamespace("d", "http://doctrine-project.org/schemas/orm/doctrine-mapping"); |
| 221 | 221 | $nodes = $xml->xpath("/d:doctrine-mapping/d:entity/d:field[@name='name' and @type='string' and @nullable='true']"); |
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | $type = $this->_getType(); |
| 360 | 360 | |
| 361 | 361 | if ($type == 'xml') { |
| 362 | - $xml = simplexml_load_file(__DIR__ . '/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.xml'); |
|
| 362 | + $xml = simplexml_load_file(__DIR__.'/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.xml'); |
|
| 363 | 363 | |
| 364 | 364 | $xml->registerXPathNamespace("d", "http://doctrine-project.org/schemas/orm/doctrine-mapping"); |
| 365 | 365 | $nodes = $xml->xpath("/d:doctrine-mapping/d:entity/d:one-to-many[@field='interests']/d:cascade/d:*"); |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | $this->assertEquals('cascade-all', $nodes[0]->getName()); |
| 369 | 369 | } else if ($type == 'yaml') { |
| 370 | 370 | $yaml = new Parser(); |
| 371 | - $value = $yaml->parse(file_get_contents(__DIR__ . '/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.yml')); |
|
| 371 | + $value = $yaml->parse(file_get_contents(__DIR__.'/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.yml')); |
|
| 372 | 372 | |
| 373 | 373 | $this->assertTrue(isset($value[ExportedUser::class]['oneToMany']['interests']['cascade'])); |
| 374 | 374 | $this->assertEquals(1, count($value[ExportedUser::class]['oneToMany']['interests']['cascade'])); |
@@ -408,10 +408,10 @@ discard block |
||
| 408 | 408 | if (is_file($path)) { |
| 409 | 409 | return unlink($path); |
| 410 | 410 | } else if (is_dir($path)) { |
| 411 | - $files = glob(rtrim($path,'/').'/*'); |
|
| 411 | + $files = glob(rtrim($path, '/').'/*'); |
|
| 412 | 412 | |
| 413 | 413 | if (is_array($files)) { |
| 414 | - foreach ($files as $file){ |
|
| 414 | + foreach ($files as $file) { |
|
| 415 | 415 | $this->_deleteDirectory($file); |
| 416 | 416 | } |
| 417 | 417 | } |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | { |
| 30 | 30 | $this->_namespace = uniqid("doctrine_"); |
| 31 | 31 | $this->_tmpDir = \sys_get_temp_dir(); |
| 32 | - \mkdir($this->_tmpDir . \DIRECTORY_SEPARATOR . $this->_namespace); |
|
| 32 | + \mkdir($this->_tmpDir.\DIRECTORY_SEPARATOR.$this->_namespace); |
|
| 33 | 33 | $this->_generator = new EntityGenerator(); |
| 34 | 34 | $this->_generator->setAnnotationPrefix(""); |
| 35 | 35 | $this->_generator->setGenerateAnnotations(true); |
@@ -41,14 +41,14 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | public function tearDown() |
| 43 | 43 | { |
| 44 | - $ri = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->_tmpDir . '/' . $this->_namespace)); |
|
| 44 | + $ri = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->_tmpDir.'/'.$this->_namespace)); |
|
| 45 | 45 | foreach ($ri AS $file) { |
| 46 | 46 | /* @var $file \SplFileInfo */ |
| 47 | 47 | if ($file->isFile()) { |
| 48 | 48 | \unlink($file->getPathname()); |
| 49 | 49 | } |
| 50 | 50 | } |
| 51 | - rmdir($this->_tmpDir . '/' . $this->_namespace); |
|
| 51 | + rmdir($this->_tmpDir.'/'.$this->_namespace); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | /** @after */ |
@@ -64,9 +64,9 @@ discard block |
||
| 64 | 64 | */ |
| 65 | 65 | public function generateBookEntityFixture(array $embeddedClasses = []) |
| 66 | 66 | { |
| 67 | - $metadata = new ClassMetadataInfo($this->_namespace . '\EntityGeneratorBook'); |
|
| 67 | + $metadata = new ClassMetadataInfo($this->_namespace.'\EntityGeneratorBook'); |
|
| 68 | 68 | $metadata->namespace = $this->_namespace; |
| 69 | - $metadata->customRepositoryClassName = $this->_namespace . '\EntityGeneratorBookRepository'; |
|
| 69 | + $metadata->customRepositoryClassName = $this->_namespace.'\EntityGeneratorBookRepository'; |
|
| 70 | 70 | |
| 71 | 71 | $metadata->table['name'] = 'book'; |
| 72 | 72 | $metadata->table['uniqueConstraints']['name_uniq'] = ['columns' => ['name']]; |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | private function generateEntityTypeFixture(array $field) |
| 110 | 110 | { |
| 111 | - $metadata = new ClassMetadataInfo($this->_namespace . '\EntityType'); |
|
| 111 | + $metadata = new ClassMetadataInfo($this->_namespace.'\EntityType'); |
|
| 112 | 112 | $metadata->namespace = $this->_namespace; |
| 113 | 113 | |
| 114 | 114 | $metadata->table['name'] = 'entity_type'; |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | */ |
| 130 | 130 | private function generateIsbnEmbeddableFixture(array $embeddedClasses = [], $columnPrefix = null) |
| 131 | 131 | { |
| 132 | - $metadata = new ClassMetadataInfo($this->_namespace . '\EntityGeneratorIsbn'); |
|
| 132 | + $metadata = new ClassMetadataInfo($this->_namespace.'\EntityGeneratorIsbn'); |
|
| 133 | 133 | $metadata->namespace = $this->_namespace; |
| 134 | 134 | $metadata->isEmbeddedClass = true; |
| 135 | 135 | $metadata->mapField(['fieldName' => 'prefix', 'type' => 'integer']); |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | */ |
| 153 | 153 | private function generateTestEmbeddableFixture() |
| 154 | 154 | { |
| 155 | - $metadata = new ClassMetadataInfo($this->_namespace . '\EntityGeneratorTestEmbeddable'); |
|
| 155 | + $metadata = new ClassMetadataInfo($this->_namespace.'\EntityGeneratorTestEmbeddable'); |
|
| 156 | 156 | $metadata->namespace = $this->_namespace; |
| 157 | 157 | $metadata->isEmbeddedClass = true; |
| 158 | 158 | $metadata->mapField(['fieldName' => 'field1', 'type' => 'integer']); |
@@ -195,11 +195,11 @@ discard block |
||
| 195 | 195 | foreach ($embeddableMetadata->embeddedClasses as $property => $embeddableClass) { |
| 196 | 196 | $classMetadata->mapEmbedded( |
| 197 | 197 | [ |
| 198 | - 'fieldName' => $fieldName . '.' . $property, |
|
| 198 | + 'fieldName' => $fieldName.'.'.$property, |
|
| 199 | 199 | 'class' => $embeddableClass['class'], |
| 200 | 200 | 'columnPrefix' => $embeddableClass['columnPrefix'], |
| 201 | 201 | 'declaredField' => $embeddableClass['declaredField'] |
| 202 | - ? $fieldName . '.' . $embeddableClass['declaredField'] |
|
| 202 | + ? $fieldName.'.'.$embeddableClass['declaredField'] |
|
| 203 | 203 | : $fieldName, |
| 204 | 204 | 'originalField' => $embeddableClass['originalField'] ?: $property, |
| 205 | 205 | ] |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | private function loadEntityClass(ClassMetadataInfo $metadata) |
| 214 | 214 | { |
| 215 | 215 | $className = basename(str_replace('\\', '/', $metadata->name)); |
| 216 | - $path = $this->_tmpDir . '/' . $this->_namespace . '/' . $className . '.php'; |
|
| 216 | + $path = $this->_tmpDir.'/'.$this->_namespace.'/'.$className.'.php'; |
|
| 217 | 217 | |
| 218 | 218 | $this->assertFileExists($path); |
| 219 | 219 | |
@@ -273,19 +273,19 @@ discard block |
||
| 273 | 273 | |
| 274 | 274 | $book = $this->newInstance($metadata); |
| 275 | 275 | $this->assertTrue(class_exists($metadata->name), "Class does not exist."); |
| 276 | - $this->assertTrue(method_exists($metadata->namespace . '\EntityGeneratorBook', '__construct'), "EntityGeneratorBook::__construct() missing."); |
|
| 277 | - $this->assertTrue(method_exists($metadata->namespace . '\EntityGeneratorBook', 'getId'), "EntityGeneratorBook::getId() missing."); |
|
| 278 | - $this->assertTrue(method_exists($metadata->namespace . '\EntityGeneratorBook', 'setName'), "EntityGeneratorBook::setName() missing."); |
|
| 279 | - $this->assertTrue(method_exists($metadata->namespace . '\EntityGeneratorBook', 'getName'), "EntityGeneratorBook::getName() missing."); |
|
| 280 | - $this->assertTrue(method_exists($metadata->namespace . '\EntityGeneratorBook', 'setStatus'), "EntityGeneratorBook::setStatus() missing."); |
|
| 281 | - $this->assertTrue(method_exists($metadata->namespace . '\EntityGeneratorBook', 'getStatus'), "EntityGeneratorBook::getStatus() missing."); |
|
| 282 | - $this->assertTrue(method_exists($metadata->namespace . '\EntityGeneratorBook', 'setAuthor'), "EntityGeneratorBook::setAuthor() missing."); |
|
| 283 | - $this->assertTrue(method_exists($metadata->namespace . '\EntityGeneratorBook', 'getAuthor'), "EntityGeneratorBook::getAuthor() missing."); |
|
| 284 | - $this->assertTrue(method_exists($metadata->namespace . '\EntityGeneratorBook', 'getComments'), "EntityGeneratorBook::getComments() missing."); |
|
| 285 | - $this->assertTrue(method_exists($metadata->namespace . '\EntityGeneratorBook', 'addComment'), "EntityGeneratorBook::addComment() missing."); |
|
| 286 | - $this->assertTrue(method_exists($metadata->namespace . '\EntityGeneratorBook', 'removeComment'), "EntityGeneratorBook::removeComment() missing."); |
|
| 287 | - $this->assertTrue(method_exists($metadata->namespace . '\EntityGeneratorBook', 'setIsbn'), "EntityGeneratorBook::setIsbn() missing."); |
|
| 288 | - $this->assertTrue(method_exists($metadata->namespace . '\EntityGeneratorBook', 'getIsbn'), "EntityGeneratorBook::getIsbn() missing."); |
|
| 276 | + $this->assertTrue(method_exists($metadata->namespace.'\EntityGeneratorBook', '__construct'), "EntityGeneratorBook::__construct() missing."); |
|
| 277 | + $this->assertTrue(method_exists($metadata->namespace.'\EntityGeneratorBook', 'getId'), "EntityGeneratorBook::getId() missing."); |
|
| 278 | + $this->assertTrue(method_exists($metadata->namespace.'\EntityGeneratorBook', 'setName'), "EntityGeneratorBook::setName() missing."); |
|
| 279 | + $this->assertTrue(method_exists($metadata->namespace.'\EntityGeneratorBook', 'getName'), "EntityGeneratorBook::getName() missing."); |
|
| 280 | + $this->assertTrue(method_exists($metadata->namespace.'\EntityGeneratorBook', 'setStatus'), "EntityGeneratorBook::setStatus() missing."); |
|
| 281 | + $this->assertTrue(method_exists($metadata->namespace.'\EntityGeneratorBook', 'getStatus'), "EntityGeneratorBook::getStatus() missing."); |
|
| 282 | + $this->assertTrue(method_exists($metadata->namespace.'\EntityGeneratorBook', 'setAuthor'), "EntityGeneratorBook::setAuthor() missing."); |
|
| 283 | + $this->assertTrue(method_exists($metadata->namespace.'\EntityGeneratorBook', 'getAuthor'), "EntityGeneratorBook::getAuthor() missing."); |
|
| 284 | + $this->assertTrue(method_exists($metadata->namespace.'\EntityGeneratorBook', 'getComments'), "EntityGeneratorBook::getComments() missing."); |
|
| 285 | + $this->assertTrue(method_exists($metadata->namespace.'\EntityGeneratorBook', 'addComment'), "EntityGeneratorBook::addComment() missing."); |
|
| 286 | + $this->assertTrue(method_exists($metadata->namespace.'\EntityGeneratorBook', 'removeComment'), "EntityGeneratorBook::removeComment() missing."); |
|
| 287 | + $this->assertTrue(method_exists($metadata->namespace.'\EntityGeneratorBook', 'setIsbn'), "EntityGeneratorBook::setIsbn() missing."); |
|
| 288 | + $this->assertTrue(method_exists($metadata->namespace.'\EntityGeneratorBook', 'getIsbn'), "EntityGeneratorBook::getIsbn() missing."); |
|
| 289 | 289 | |
| 290 | 290 | $reflClass = new \ReflectionClass($metadata->name); |
| 291 | 291 | |
@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | |
| 339 | 339 | $this->_generator->writeEntityClass($metadata, $this->_tmpDir); |
| 340 | 340 | |
| 341 | - $this->assertFileExists($this->_tmpDir . "/" . $this->_namespace . "/EntityGeneratorBook.php~"); |
|
| 341 | + $this->assertFileExists($this->_tmpDir."/".$this->_namespace."/EntityGeneratorBook.php~"); |
|
| 342 | 342 | |
| 343 | 343 | $book = $this->newInstance($metadata); |
| 344 | 344 | $reflClass = new \ReflectionClass($metadata->name); |
@@ -383,7 +383,7 @@ discard block |
||
| 383 | 383 | // Should not throw a PHP fatal error |
| 384 | 384 | $this->_generator->writeEntityClass($metadata, $this->_tmpDir); |
| 385 | 385 | |
| 386 | - $this->assertFileExists($this->_tmpDir . "/" . $this->_namespace . "/EntityGeneratorBook.php~"); |
|
| 386 | + $this->assertFileExists($this->_tmpDir."/".$this->_namespace."/EntityGeneratorBook.php~"); |
|
| 387 | 387 | |
| 388 | 388 | $this->newInstance($metadata); |
| 389 | 389 | $reflClass = new \ReflectionClass($metadata->name); |
@@ -418,7 +418,7 @@ discard block |
||
| 418 | 418 | $this->assertPhpDocReturnType('\Doctrine\Tests\ORM\Tools\EntityGeneratorAuthor|null', new \ReflectionMethod($book, 'getAuthor')); |
| 419 | 419 | $this->assertPhpDocParamType('\Doctrine\Tests\ORM\Tools\EntityGeneratorAuthor|null', new \ReflectionMethod($book, 'setAuthor')); |
| 420 | 420 | |
| 421 | - $expectedClassName = '\\' . $embeddedMetadata->name; |
|
| 421 | + $expectedClassName = '\\'.$embeddedMetadata->name; |
|
| 422 | 422 | $this->assertPhpDocVarType($expectedClassName, new \ReflectionProperty($book, 'isbn')); |
| 423 | 423 | $this->assertPhpDocReturnType($expectedClassName, new \ReflectionMethod($book, 'getIsbn')); |
| 424 | 424 | $this->assertPhpDocParamType($expectedClassName, new \ReflectionMethod($book, 'setIsbn')); |
@@ -528,7 +528,7 @@ discard block |
||
| 528 | 528 | */ |
| 529 | 529 | public function testMappedSuperclassAnnotationGeneration() |
| 530 | 530 | { |
| 531 | - $metadata = new ClassMetadataInfo($this->_namespace . '\EntityGeneratorBook'); |
|
| 531 | + $metadata = new ClassMetadataInfo($this->_namespace.'\EntityGeneratorBook'); |
|
| 532 | 532 | $metadata->namespace = $this->_namespace; |
| 533 | 533 | $metadata->isMappedSuperclass = true; |
| 534 | 534 | |
@@ -566,7 +566,7 @@ discard block |
||
| 566 | 566 | */ |
| 567 | 567 | public function testGenerateEntityWithSequenceGenerator() |
| 568 | 568 | { |
| 569 | - $metadata = new ClassMetadataInfo($this->_namespace . '\DDC1784Entity'); |
|
| 569 | + $metadata = new ClassMetadataInfo($this->_namespace.'\DDC1784Entity'); |
|
| 570 | 570 | $metadata->namespace = $this->_namespace; |
| 571 | 571 | $metadata->mapField(['fieldName' => 'id', 'type' => 'integer', 'id' => true]); |
| 572 | 572 | $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_SEQUENCE); |
@@ -579,8 +579,8 @@ discard block |
||
| 579 | 579 | ); |
| 580 | 580 | $this->_generator->writeEntityClass($metadata, $this->_tmpDir); |
| 581 | 581 | |
| 582 | - $filename = $this->_tmpDir . DIRECTORY_SEPARATOR |
|
| 583 | - . $this->_namespace . DIRECTORY_SEPARATOR . 'DDC1784Entity.php'; |
|
| 582 | + $filename = $this->_tmpDir.DIRECTORY_SEPARATOR |
|
| 583 | + . $this->_namespace.DIRECTORY_SEPARATOR.'DDC1784Entity.php'; |
|
| 584 | 584 | |
| 585 | 585 | $this->assertFileExists($filename); |
| 586 | 586 | require_once $filename; |
@@ -600,7 +600,7 @@ discard block |
||
| 600 | 600 | */ |
| 601 | 601 | public function testGenerateEntityWithMultipleInverseJoinColumns() |
| 602 | 602 | { |
| 603 | - $metadata = new ClassMetadataInfo($this->_namespace . '\DDC2079Entity'); |
|
| 603 | + $metadata = new ClassMetadataInfo($this->_namespace.'\DDC2079Entity'); |
|
| 604 | 604 | $metadata->namespace = $this->_namespace; |
| 605 | 605 | $metadata->mapField(['fieldName' => 'id', 'type' => 'integer', 'id' => true]); |
| 606 | 606 | $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_SEQUENCE); |
@@ -611,20 +611,20 @@ discard block |
||
| 611 | 611 | 'joinTable' => [ |
| 612 | 612 | 'name' => 'unidade_centro_custo', |
| 613 | 613 | 'joinColumns' => [ |
| 614 | - ['name' => 'idorcamento', 'referencedColumnName' => 'idorcamento'], |
|
| 615 | - ['name' => 'idunidade', 'referencedColumnName' => 'idunidade'] |
|
| 614 | + ['name' => 'idorcamento', 'referencedColumnName' => 'idorcamento'], |
|
| 615 | + ['name' => 'idunidade', 'referencedColumnName' => 'idunidade'] |
|
| 616 | 616 | ], |
| 617 | 617 | 'inverseJoinColumns' => [ |
| 618 | - ['name' => 'idcentrocusto', 'referencedColumnName' => 'idcentrocusto'], |
|
| 619 | - ['name' => 'idpais', 'referencedColumnName' => 'idpais'], |
|
| 618 | + ['name' => 'idcentrocusto', 'referencedColumnName' => 'idcentrocusto'], |
|
| 619 | + ['name' => 'idpais', 'referencedColumnName' => 'idpais'], |
|
| 620 | 620 | ], |
| 621 | 621 | ], |
| 622 | 622 | ] |
| 623 | 623 | ); |
| 624 | 624 | $this->_generator->writeEntityClass($metadata, $this->_tmpDir); |
| 625 | 625 | |
| 626 | - $filename = $this->_tmpDir . DIRECTORY_SEPARATOR |
|
| 627 | - . $this->_namespace . DIRECTORY_SEPARATOR . 'DDC2079Entity.php'; |
|
| 626 | + $filename = $this->_tmpDir.DIRECTORY_SEPARATOR |
|
| 627 | + . $this->_namespace.DIRECTORY_SEPARATOR.'DDC2079Entity.php'; |
|
| 628 | 628 | |
| 629 | 629 | $this->assertFileExists($filename); |
| 630 | 630 | require_once $filename; |
@@ -654,7 +654,7 @@ discard block |
||
| 654 | 654 | $method->setAccessible(true); |
| 655 | 655 | |
| 656 | 656 | foreach ($constants as $name => $value) { |
| 657 | - if( ! preg_match($pattern, $name)) { |
|
| 657 | + if ( ! preg_match($pattern, $name)) { |
|
| 658 | 658 | continue; |
| 659 | 659 | } |
| 660 | 660 | |
@@ -683,7 +683,7 @@ discard block |
||
| 683 | 683 | $method->setAccessible(true); |
| 684 | 684 | |
| 685 | 685 | foreach ($constants as $name => $value) { |
| 686 | - if( ! preg_match($pattern, $name)) { |
|
| 686 | + if ( ! preg_match($pattern, $name)) { |
|
| 687 | 687 | continue; |
| 688 | 688 | } |
| 689 | 689 | |
@@ -712,7 +712,7 @@ discard block |
||
| 712 | 712 | $method->setAccessible(true); |
| 713 | 713 | |
| 714 | 714 | foreach ($constants as $name => $value) { |
| 715 | - if( ! preg_match($pattern, $name)) { |
|
| 715 | + if ( ! preg_match($pattern, $name)) { |
|
| 716 | 716 | continue; |
| 717 | 717 | } |
| 718 | 718 | |
@@ -736,7 +736,7 @@ discard block |
||
| 736 | 736 | public function testEntityTypeAlias(array $field) |
| 737 | 737 | { |
| 738 | 738 | $metadata = $this->generateEntityTypeFixture($field); |
| 739 | - $path = $this->_tmpDir . '/'. $this->_namespace . '/EntityType.php'; |
|
| 739 | + $path = $this->_tmpDir.'/'.$this->_namespace.'/EntityType.php'; |
|
| 740 | 740 | |
| 741 | 741 | $this->assertFileExists($path); |
| 742 | 742 | require_once $path; |
@@ -747,8 +747,8 @@ discard block |
||
| 747 | 747 | $type = $field['phpType']; |
| 748 | 748 | $name = $field['fieldName']; |
| 749 | 749 | $value = $field['value']; |
| 750 | - $getter = "get" . ucfirst($name); |
|
| 751 | - $setter = "set" . ucfirst($name); |
|
| 750 | + $getter = "get".ucfirst($name); |
|
| 751 | + $setter = "set".ucfirst($name); |
|
| 752 | 752 | |
| 753 | 753 | $this->assertPhpDocVarType($type, $reflClass->getProperty($name)); |
| 754 | 754 | $this->assertPhpDocParamType($type, $reflClass->getMethod($setter)); |
@@ -769,13 +769,13 @@ discard block |
||
| 769 | 769 | |
| 770 | 770 | $user = new DDC2372User(); |
| 771 | 771 | $metadata = $cmf->getMetadataFor(get_class($user)); |
| 772 | - $metadata->name = $this->_namespace . "\DDC2372User"; |
|
| 772 | + $metadata->name = $this->_namespace."\DDC2372User"; |
|
| 773 | 773 | $metadata->namespace = $this->_namespace; |
| 774 | 774 | |
| 775 | 775 | $this->_generator->writeEntityClass($metadata, $this->_tmpDir); |
| 776 | 776 | |
| 777 | - $this->assertFileExists($this->_tmpDir . "/" . $this->_namespace . "/DDC2372User.php"); |
|
| 778 | - require $this->_tmpDir . "/" . $this->_namespace . "/DDC2372User.php"; |
|
| 777 | + $this->assertFileExists($this->_tmpDir."/".$this->_namespace."/DDC2372User.php"); |
|
| 778 | + require $this->_tmpDir."/".$this->_namespace."/DDC2372User.php"; |
|
| 779 | 779 | |
| 780 | 780 | $reflClass = new \ReflectionClass($metadata->name); |
| 781 | 781 | |
@@ -795,13 +795,13 @@ discard block |
||
| 795 | 795 | |
| 796 | 796 | $user = new DDC2372Admin(); |
| 797 | 797 | $metadata = $cmf->getMetadataFor(get_class($user)); |
| 798 | - $metadata->name = $this->_namespace . "\DDC2372Admin"; |
|
| 798 | + $metadata->name = $this->_namespace."\DDC2372Admin"; |
|
| 799 | 799 | $metadata->namespace = $this->_namespace; |
| 800 | 800 | |
| 801 | 801 | $this->_generator->writeEntityClass($metadata, $this->_tmpDir); |
| 802 | 802 | |
| 803 | - $this->assertFileExists($this->_tmpDir . "/" . $this->_namespace . "/DDC2372Admin.php"); |
|
| 804 | - require $this->_tmpDir . "/" . $this->_namespace . "/DDC2372Admin.php"; |
|
| 803 | + $this->assertFileExists($this->_tmpDir."/".$this->_namespace."/DDC2372Admin.php"); |
|
| 804 | + require $this->_tmpDir."/".$this->_namespace."/DDC2372Admin.php"; |
|
| 805 | 805 | |
| 806 | 806 | $reflClass = new \ReflectionClass($metadata->name); |
| 807 | 807 | |
@@ -821,20 +821,20 @@ discard block |
||
| 821 | 821 | $cmf->setEntityManager($em); |
| 822 | 822 | |
| 823 | 823 | $ns = $this->_namespace; |
| 824 | - $nsdir = $this->_tmpDir . '/' . $ns; |
|
| 824 | + $nsdir = $this->_tmpDir.'/'.$ns; |
|
| 825 | 825 | |
| 826 | 826 | $content = str_replace( |
| 827 | 827 | 'namespace Doctrine\Tests\Models\DDC1590', |
| 828 | - 'namespace ' . $ns, |
|
| 829 | - file_get_contents(__DIR__ . '/../../Models/DDC1590/DDC1590User.php') |
|
| 828 | + 'namespace '.$ns, |
|
| 829 | + file_get_contents(__DIR__.'/../../Models/DDC1590/DDC1590User.php') |
|
| 830 | 830 | ); |
| 831 | 831 | |
| 832 | - $fname = $nsdir . "/DDC1590User.php"; |
|
| 832 | + $fname = $nsdir."/DDC1590User.php"; |
|
| 833 | 833 | file_put_contents($fname, $content); |
| 834 | 834 | require $fname; |
| 835 | 835 | |
| 836 | 836 | |
| 837 | - $metadata = $cmf->getMetadataFor($ns . '\DDC1590User'); |
|
| 837 | + $metadata = $cmf->getMetadataFor($ns.'\DDC1590User'); |
|
| 838 | 838 | $this->_generator->writeEntityClass($metadata, $this->_tmpDir); |
| 839 | 839 | |
| 840 | 840 | // class DDC1590User extends DDC1590Entity { ... } |
@@ -842,13 +842,13 @@ discard block |
||
| 842 | 842 | |
| 843 | 843 | // class _DDC1590User extends DDC1590Entity { ... } |
| 844 | 844 | $source2 = str_replace('class DDC1590User', 'class _DDC1590User', $source); |
| 845 | - $fname2 = $nsdir . "/_DDC1590User.php"; |
|
| 845 | + $fname2 = $nsdir."/_DDC1590User.php"; |
|
| 846 | 846 | file_put_contents($fname2, $source2); |
| 847 | 847 | require $fname2; |
| 848 | 848 | |
| 849 | 849 | // class __DDC1590User { ... } |
| 850 | 850 | $source3 = str_replace('class DDC1590User extends DDC1590Entity', 'class __DDC1590User', $source); |
| 851 | - $fname3 = $nsdir . "/__DDC1590User.php"; |
|
| 851 | + $fname3 = $nsdir."/__DDC1590User.php"; |
|
| 852 | 852 | file_put_contents($fname3, $source3); |
| 853 | 853 | require $fname3; |
| 854 | 854 | |
@@ -1002,7 +1002,7 @@ discard block |
||
| 1002 | 1002 | $this->loadEntityClass($metadata); |
| 1003 | 1003 | |
| 1004 | 1004 | $className = basename(str_replace('\\', '/', $metadata->name)); |
| 1005 | - $path = $this->_tmpDir . '/' . $this->_namespace . '/' . $className . '.php'; |
|
| 1005 | + $path = $this->_tmpDir.'/'.$this->_namespace.'/'.$className.'.php'; |
|
| 1006 | 1006 | $classTest = file_get_contents($path); |
| 1007 | 1007 | |
| 1008 | 1008 | $this->_generator->setRegenerateEntityIfExists(true); |
@@ -1011,7 +1011,7 @@ discard block |
||
| 1011 | 1011 | $this->_generator->writeEntityClass($metadata, $this->_tmpDir); |
| 1012 | 1012 | $classNew = file_get_contents($path); |
| 1013 | 1013 | |
| 1014 | - $this->assertSame($classTest,$classNew); |
|
| 1014 | + $this->assertSame($classTest, $classNew); |
|
| 1015 | 1015 | } |
| 1016 | 1016 | |
| 1017 | 1017 | /** |
@@ -1198,14 +1198,14 @@ discard block |
||
| 1198 | 1198 | */ |
| 1199 | 1199 | public function testOptionsAreGeneratedProperly(string $expectedAnnotation, array $fieldConfiguration) : void |
| 1200 | 1200 | { |
| 1201 | - $metadata = new ClassMetadataInfo($this->_namespace . '\GH6703Options'); |
|
| 1201 | + $metadata = new ClassMetadataInfo($this->_namespace.'\GH6703Options'); |
|
| 1202 | 1202 | $metadata->namespace = $this->_namespace; |
| 1203 | 1203 | $metadata->mapField(['fieldName' => 'id', 'type' => 'integer', 'id' => true]); |
| 1204 | 1204 | $metadata->mapField(['fieldName' => 'test'] + $fieldConfiguration); |
| 1205 | 1205 | $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_SEQUENCE); |
| 1206 | 1206 | $this->_generator->writeEntityClass($metadata, $this->_tmpDir); |
| 1207 | 1207 | |
| 1208 | - $filename = $this->_tmpDir . DIRECTORY_SEPARATOR . $this->_namespace . DIRECTORY_SEPARATOR . 'GH6703Options.php'; |
|
| 1208 | + $filename = $this->_tmpDir.DIRECTORY_SEPARATOR.$this->_namespace.DIRECTORY_SEPARATOR.'GH6703Options.php'; |
|
| 1209 | 1209 | |
| 1210 | 1210 | self::assertFileExists($filename); |
| 1211 | 1211 | require_once $filename; |
@@ -27,30 +27,30 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | public function testFailingCase() |
| 29 | 29 | { |
| 30 | - $parent = new DDC1383Entity(); |
|
| 31 | - $child = new DDC1383Entity(); |
|
| 30 | + $parent = new DDC1383Entity(); |
|
| 31 | + $child = new DDC1383Entity(); |
|
| 32 | 32 | |
| 33 | - $child->setReference($parent); |
|
| 33 | + $child->setReference($parent); |
|
| 34 | 34 | |
| 35 | - $this->_em->persist($parent); |
|
| 36 | - $this->_em->persist($child); |
|
| 35 | + $this->_em->persist($parent); |
|
| 36 | + $this->_em->persist($child); |
|
| 37 | 37 | |
| 38 | - $id = $child->getId(); |
|
| 38 | + $id = $child->getId(); |
|
| 39 | 39 | |
| 40 | - $this->_em->flush(); |
|
| 41 | - $this->_em->clear(); |
|
| 40 | + $this->_em->flush(); |
|
| 41 | + $this->_em->clear(); |
|
| 42 | 42 | |
| 43 | - // Try merging the parent entity |
|
| 44 | - $child = $this->_em->merge($child); |
|
| 45 | - $parent = $child->getReference(); |
|
| 43 | + // Try merging the parent entity |
|
| 44 | + $child = $this->_em->merge($child); |
|
| 45 | + $parent = $child->getReference(); |
|
| 46 | 46 | |
| 47 | - // Parent is not instance of the abstract class |
|
| 48 | - self::assertTrue($parent instanceof DDC1383AbstractEntity, |
|
| 49 | - "Entity class is " . get_class($parent) . ', "DDC1383AbstractEntity" was expected'); |
|
| 47 | + // Parent is not instance of the abstract class |
|
| 48 | + self::assertTrue($parent instanceof DDC1383AbstractEntity, |
|
| 49 | + "Entity class is " . get_class($parent) . ', "DDC1383AbstractEntity" was expected'); |
|
| 50 | 50 | |
| 51 | - // Parent is NOT instance of entity |
|
| 52 | - self::assertTrue($parent instanceof DDC1383Entity, |
|
| 53 | - "Entity class is " . get_class($parent) . ', "DDC1383Entity" was expected'); |
|
| 51 | + // Parent is NOT instance of entity |
|
| 52 | + self::assertTrue($parent instanceof DDC1383Entity, |
|
| 53 | + "Entity class is " . get_class($parent) . ', "DDC1383Entity" was expected'); |
|
| 54 | 54 | $this->assertHasDeprecationMessages(); |
| 55 | 55 | } |
| 56 | 56 | } |
@@ -63,22 +63,22 @@ discard block |
||
| 63 | 63 | */ |
| 64 | 64 | abstract class DDC1383AbstractEntity |
| 65 | 65 | { |
| 66 | - /** |
|
| 67 | - * @Id |
|
| 68 | - * @Column(type="integer") |
|
| 69 | - * @GeneratedValue |
|
| 70 | - */ |
|
| 71 | - protected $id; |
|
| 72 | - |
|
| 73 | - public function getId() |
|
| 74 | - { |
|
| 75 | - return $this->id; |
|
| 76 | - } |
|
| 77 | - |
|
| 78 | - public function setId($id) |
|
| 79 | - { |
|
| 80 | - $this->id = $id; |
|
| 81 | - } |
|
| 66 | + /** |
|
| 67 | + * @Id |
|
| 68 | + * @Column(type="integer") |
|
| 69 | + * @GeneratedValue |
|
| 70 | + */ |
|
| 71 | + protected $id; |
|
| 72 | + |
|
| 73 | + public function getId() |
|
| 74 | + { |
|
| 75 | + return $this->id; |
|
| 76 | + } |
|
| 77 | + |
|
| 78 | + public function setId($id) |
|
| 79 | + { |
|
| 80 | + $this->id = $id; |
|
| 81 | + } |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | /** |
@@ -86,18 +86,18 @@ discard block |
||
| 86 | 86 | */ |
| 87 | 87 | class DDC1383Entity extends DDC1383AbstractEntity |
| 88 | 88 | { |
| 89 | - /** |
|
| 90 | - * @ManyToOne(targetEntity="DDC1383AbstractEntity") |
|
| 91 | - */ |
|
| 92 | - protected $reference; |
|
| 93 | - |
|
| 94 | - public function getReference() |
|
| 95 | - { |
|
| 96 | - return $this->reference; |
|
| 97 | - } |
|
| 98 | - |
|
| 99 | - public function setReference(DDC1383AbstractEntity $reference) |
|
| 100 | - { |
|
| 101 | - $this->reference = $reference; |
|
| 102 | - } |
|
| 89 | + /** |
|
| 90 | + * @ManyToOne(targetEntity="DDC1383AbstractEntity") |
|
| 91 | + */ |
|
| 92 | + protected $reference; |
|
| 93 | + |
|
| 94 | + public function getReference() |
|
| 95 | + { |
|
| 96 | + return $this->reference; |
|
| 97 | + } |
|
| 98 | + |
|
| 99 | + public function setReference(DDC1383AbstractEntity $reference) |
|
| 100 | + { |
|
| 101 | + $this->reference = $reference; |
|
| 102 | + } |
|
| 103 | 103 | } |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | $this->_em->getClassMetadata(DDC1383Entity::class), |
| 23 | 23 | ] |
| 24 | 24 | ); |
| 25 | - } catch(\Exception $ignored) {} |
|
| 25 | + } catch (\Exception $ignored) {} |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | public function testFailingCase() |
@@ -46,11 +46,11 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | // Parent is not instance of the abstract class |
| 48 | 48 | self::assertTrue($parent instanceof DDC1383AbstractEntity, |
| 49 | - "Entity class is " . get_class($parent) . ', "DDC1383AbstractEntity" was expected'); |
|
| 49 | + "Entity class is ".get_class($parent).', "DDC1383AbstractEntity" was expected'); |
|
| 50 | 50 | |
| 51 | 51 | // Parent is NOT instance of entity |
| 52 | 52 | self::assertTrue($parent instanceof DDC1383Entity, |
| 53 | - "Entity class is " . get_class($parent) . ', "DDC1383Entity" was expected'); |
|
| 53 | + "Entity class is ".get_class($parent).', "DDC1383Entity" was expected'); |
|
| 54 | 54 | $this->assertHasDeprecationMessages(); |
| 55 | 55 | } |
| 56 | 56 | } |
@@ -17,11 +17,11 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | protected function _loadDriver() |
| 19 | 19 | { |
| 20 | - if (!class_exists(Yaml::class, true)) { |
|
| 20 | + if ( ! class_exists(Yaml::class, true)) { |
|
| 21 | 21 | $this->markTestSkipped('Please install Symfony YAML Component into the include path of your PHP installation.'); |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | - return new YamlDriver(__DIR__ . DIRECTORY_SEPARATOR . 'yaml'); |
|
| 24 | + return new YamlDriver(__DIR__.DIRECTORY_SEPARATOR.'yaml'); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | /** |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | public function testJoinTablesWithMappedSuperclassForYamlDriver() |
| 33 | 33 | { |
| 34 | 34 | $yamlDriver = $this->_loadDriver(); |
| 35 | - $yamlDriver->getLocator()->addPaths([__DIR__ . DIRECTORY_SEPARATOR . 'yaml']); |
|
| 35 | + $yamlDriver->getLocator()->addPaths([__DIR__.DIRECTORY_SEPARATOR.'yaml']); |
|
| 36 | 36 | |
| 37 | 37 | $em = $this->_getTestEntityManager(); |
| 38 | 38 | $em->getConfiguration()->setMetadataDriverImpl($yamlDriver); |