@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | try { |
| 45 | 45 | $sqlGenerated = $this->generateSql($dqlToBeTested, $treeWalkers, $outputWalker); |
| 46 | 46 | } catch (\Exception $e) { |
| 47 | - $this->fail($e->getMessage() . ' at "' . $e->getFile() . '" on line ' . $e->getLine()); |
|
| 47 | + $this->fail($e->getMessage().' at "'.$e->getFile().'" on line '.$e->getLine()); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | self::assertEquals($sqlToBeConfirmed, $sqlGenerated); |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | $condExpr = $whereClause->conditionalExpression; |
| 145 | 145 | |
| 146 | 146 | // Since Phase 1 AST optimizations were included, we need to re-add the ConditionalExpression |
| 147 | - if (! ($condExpr instanceof Query\AST\ConditionalExpression)) { |
|
| 147 | + if ( ! ($condExpr instanceof Query\AST\ConditionalExpression)) { |
|
| 148 | 148 | $condExpr = new Query\AST\ConditionalExpression([$condExpr]); |
| 149 | 149 | |
| 150 | 150 | $whereClause->conditionalExpression = $condExpr; |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | $singleTerm = $selectStatement->whereClause->conditionalExpression->conditionalTerms[0]; |
| 168 | 168 | |
| 169 | 169 | // Since Phase 1 AST optimizations were included, we need to re-add the ConditionalExpression |
| 170 | - if (! ($singleTerm instanceof Query\AST\ConditionalTerm)) { |
|
| 170 | + if ( ! ($singleTerm instanceof Query\AST\ConditionalTerm)) { |
|
| 171 | 171 | $singleTerm = new Query\AST\ConditionalTerm([$singleTerm]); |
| 172 | 172 | |
| 173 | 173 | $selectStatement->whereClause->conditionalExpression->conditionalTerms[0] = $singleTerm; |
@@ -205,9 +205,9 @@ discard block |
||
| 205 | 205 | { |
| 206 | 206 | $rangeVariableDecl = $identificationVariableDecl->rangeVariableDeclaration; |
| 207 | 207 | $joinAssocPathExpression = new Query\AST\JoinAssociationPathExpression($rangeVariableDecl->aliasIdentificationVariable, 'address'); |
| 208 | - $joinAssocDeclaration = new Query\AST\JoinAssociationDeclaration($joinAssocPathExpression, $rangeVariableDecl->aliasIdentificationVariable . 'a', null); |
|
| 208 | + $joinAssocDeclaration = new Query\AST\JoinAssociationDeclaration($joinAssocPathExpression, $rangeVariableDecl->aliasIdentificationVariable.'a', null); |
|
| 209 | 209 | $join = new Query\AST\Join(Query\AST\Join::JOIN_TYPE_LEFT, $joinAssocDeclaration); |
| 210 | - $selectExpression = new Query\AST\SelectExpression($rangeVariableDecl->aliasIdentificationVariable . 'a', null, false); |
|
| 210 | + $selectExpression = new Query\AST\SelectExpression($rangeVariableDecl->aliasIdentificationVariable.'a', null, false); |
|
| 211 | 211 | |
| 212 | 212 | $identificationVariableDecl->joins[] = $join; |
| 213 | 213 | $selectStatement->selectClause->selectExpressions[] = $selectExpression; |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | $addressMetadata = $entityManager->getClassMetadata(CmsAddress::class); |
| 218 | 218 | |
| 219 | 219 | $this->setQueryComponent( |
| 220 | - $rangeVariableDecl->aliasIdentificationVariable . 'a', |
|
| 220 | + $rangeVariableDecl->aliasIdentificationVariable.'a', |
|
| 221 | 221 | [ |
| 222 | 222 | 'metadata' => $addressMetadata, |
| 223 | 223 | 'parent' => $rangeVariableDecl->aliasIdentificationVariable, |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | $this->addToAssertionCount(1); |
| 30 | 30 | } catch (QueryException $e) { |
| 31 | 31 | if ($debug) { |
| 32 | - echo $e->getTraceAsString() . PHP_EOL; |
|
| 32 | + echo $e->getTraceAsString().PHP_EOL; |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | $this->fail($e->getMessage()); |
@@ -44,8 +44,8 @@ discard block |
||
| 44 | 44 | $this->fail('No syntax errors were detected, when syntax errors were expected'); |
| 45 | 45 | } catch (QueryException $e) { |
| 46 | 46 | if ($debug) { |
| 47 | - echo $e->getMessage() . PHP_EOL; |
|
| 48 | - echo $e->getTraceAsString() . PHP_EOL; |
|
| 47 | + echo $e->getMessage().PHP_EOL; |
|
| 48 | + echo $e->getTraceAsString().PHP_EOL; |
|
| 49 | 49 | } |
| 50 | 50 | $this->addToAssertionCount(1); |
| 51 | 51 | } |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | ['SELECT foo: FROM Doctrine\Tests\Models\CMS\CmsUser foo:'], |
| 108 | 108 | |
| 109 | 109 | /* Checks for invalid AbstractSchemaName */ |
| 110 | - ['SELECT u FROM UnknownClass u'], // unknown |
|
| 110 | + ['SELECT u FROM UnknownClass u'], // unknown |
|
| 111 | 111 | ['SELECT u FROM \Unknown\Class u'], // unknown, leading backslash |
| 112 | 112 | ['SELECT u FROM Unknown\\\\Class u'], // unknown, syntactically bogus (duplicate \\) |
| 113 | 113 | ['SELECT u FROM Unknown\Class\ u'], // unknown, syntactically bogus (trailing \) |
@@ -573,7 +573,7 @@ discard block |
||
| 573 | 573 | */ |
| 574 | 574 | public function testDQLKeywordInJoinIsAllowed() : void |
| 575 | 575 | { |
| 576 | - self::assertValidDQL('SELECT u FROM ' . __NAMESPACE__ . '\DQLKeywordsModelUser u JOIN u.group g'); |
|
| 576 | + self::assertValidDQL('SELECT u FROM '.__NAMESPACE__.'\DQLKeywordsModelUser u JOIN u.group g'); |
|
| 577 | 577 | } |
| 578 | 578 | |
| 579 | 579 | /** |
@@ -581,7 +581,7 @@ discard block |
||
| 581 | 581 | */ |
| 582 | 582 | public function testDQLKeywordInConditionIsAllowed() : void |
| 583 | 583 | { |
| 584 | - self::assertValidDQL('SELECT g FROM ' . __NAMESPACE__ . '\DQLKeywordsModelGroup g WHERE g.from=0'); |
|
| 584 | + self::assertValidDQL('SELECT g FROM '.__NAMESPACE__.'\DQLKeywordsModelGroup g WHERE g.from=0'); |
|
| 585 | 585 | } |
| 586 | 586 | |
| 587 | 587 | /* The exception is currently thrown in the SQLWalker, not earlier. |
@@ -686,7 +686,7 @@ discard block |
||
| 686 | 686 | */ |
| 687 | 687 | public function testNewLiteralExpression() : void |
| 688 | 688 | { |
| 689 | - self::assertValidDQL('SELECT new ' . __NAMESPACE__ . "\\DummyStruct(u.id, 'foo', 1, true) FROM Doctrine\Tests\Models\CMS\CmsUser u"); |
|
| 689 | + self::assertValidDQL('SELECT new '.__NAMESPACE__."\\DummyStruct(u.id, 'foo', 1, true) FROM Doctrine\Tests\Models\CMS\CmsUser u"); |
|
| 690 | 690 | } |
| 691 | 691 | |
| 692 | 692 | /** |
@@ -694,7 +694,7 @@ discard block |
||
| 694 | 694 | */ |
| 695 | 695 | public function testNewLiteralWithSubselectExpression() : void |
| 696 | 696 | { |
| 697 | - self::assertValidDQL('SELECT new ' . __NAMESPACE__ . "\\DummyStruct(u.id, 'foo', (SELECT 1 FROM Doctrine\Tests\Models\CMS\CmsUser su), true) FROM Doctrine\Tests\Models\CMS\CmsUser u"); |
|
| 697 | + self::assertValidDQL('SELECT new '.__NAMESPACE__."\\DummyStruct(u.id, 'foo', (SELECT 1 FROM Doctrine\Tests\Models\CMS\CmsUser su), true) FROM Doctrine\Tests\Models\CMS\CmsUser u"); |
|
| 698 | 698 | } |
| 699 | 699 | } |
| 700 | 700 | |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | self::isInstanceOf(CompanyEmployee::class) |
| 225 | 225 | ) |
| 226 | 226 | ) |
| 227 | - ->willReturnCallback(function (array $id, CompanyEmployee $companyEmployee) { |
|
| 227 | + ->willReturnCallback(function(array $id, CompanyEmployee $companyEmployee) { |
|
| 228 | 228 | $companyEmployee->setSalary(1000); // A property on the CompanyEmployee |
| 229 | 229 | $companyEmployee->setName('Bob'); // A property on the parent class, CompanyPerson |
| 230 | 230 | |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | self::isInstanceOf(ComparableObject::class) |
| 287 | 287 | ) |
| 288 | 288 | ) |
| 289 | - ->willReturnCallback(function (array $id, ComparableObject $comparableObject) { |
|
| 289 | + ->willReturnCallback(function(array $id, ComparableObject $comparableObject) { |
|
| 290 | 290 | $comparableObject->setComparedFieldValue(json_encode($id)); |
| 291 | 291 | |
| 292 | 292 | return $comparableObject; |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | public function tearDown() : void |
| 37 | 37 | { |
| 38 | - if (! $this->originalIncludePath) { |
|
| 38 | + if ( ! $this->originalIncludePath) { |
|
| 39 | 39 | return; |
| 40 | 40 | } |
| 41 | 41 | |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | public function testDirectoryAutoload() : void |
| 52 | 52 | { |
| 53 | - Setup::registerAutoloadDirectory(__DIR__ . '/../../../../../vendor/doctrine/common/lib'); |
|
| 53 | + Setup::registerAutoloadDirectory(__DIR__.'/../../../../../vendor/doctrine/common/lib'); |
|
| 54 | 54 | |
| 55 | 55 | self::assertCount($this->originalAutoloaderCount + 2, spl_autoload_functions()); |
| 56 | 56 | } |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | $config = Setup::createConfiguration(false, __DIR__); |
| 82 | 82 | $cache = $config->getMetadataCacheImpl(); |
| 83 | 83 | |
| 84 | - self::assertSame('dc2_' . md5(__DIR__) . '_', $cache->getNamespace()); |
|
| 84 | + self::assertSame('dc2_'.md5(__DIR__).'_', $cache->getNamespace()); |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | /** |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | $config = Setup::createConfiguration(false, __DIR__, new ArrayCache()); |
| 93 | 93 | $cache = $config->getMetadataCacheImpl(); |
| 94 | 94 | |
| 95 | - self::assertSame('dc2_' . md5(__DIR__) . '_', $cache->getNamespace()); |
|
| 95 | + self::assertSame('dc2_'.md5(__DIR__).'_', $cache->getNamespace()); |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | /** |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | $cache = $config->getMetadataCacheImpl(); |
| 108 | 108 | |
| 109 | 109 | self::assertSame($originalCache, $cache); |
| 110 | - self::assertSame('foo:dc2_' . md5(__DIR__) . '_', $cache->getNamespace()); |
|
| 110 | + self::assertSame('foo:dc2_'.md5(__DIR__).'_', $cache->getNamespace()); |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | /** |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | return [ |
| 55 | 55 | $method->getName(), |
| 56 | 56 | [ |
| 57 | - function () { |
|
| 57 | + function() { |
|
| 58 | 58 | }, |
| 59 | 59 | ], |
| 60 | 60 | ]; |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | ] |
| 27 | 27 | ); |
| 28 | 28 | |
| 29 | - touch($filename = $this->dir . '/Foo' . $this->getFileExtension()); |
|
| 29 | + touch($filename = $this->dir.'/Foo'.$this->getFileExtension()); |
|
| 30 | 30 | self::assertEquals($filename, $driver->getLocator()->findMappingFile('MyNamespace\MySubnamespace\Entity\Foo')); |
| 31 | 31 | } |
| 32 | 32 | |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | ] |
| 39 | 39 | ); |
| 40 | 40 | |
| 41 | - touch($filename = $this->dir . '/Foo.Bar' . $this->getFileExtension()); |
|
| 41 | + touch($filename = $this->dir.'/Foo.Bar'.$this->getFileExtension()); |
|
| 42 | 42 | self::assertEquals($filename, $driver->getLocator()->findMappingFile('MyNamespace\MySubnamespace\Entity\Foo\Bar')); |
| 43 | 43 | } |
| 44 | 44 | |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | public function testFindMappingNamespaceNotFound() : void |
| 60 | 60 | { |
| 61 | 61 | $this->expectException(MappingException::class); |
| 62 | - $this->expectExceptionMessage("No mapping file found named 'Foo" . $this->getFileExtension() . "' for class 'MyOtherNamespace\MySubnamespace\Entity\Foo'."); |
|
| 62 | + $this->expectExceptionMessage("No mapping file found named 'Foo".$this->getFileExtension()."' for class 'MyOtherNamespace\MySubnamespace\Entity\Foo'."); |
|
| 63 | 63 | |
| 64 | 64 | $driver = $this->getDriver( |
| 65 | 65 | [ |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | protected function setUp() : void |
| 74 | 74 | { |
| 75 | - $this->dir = sys_get_temp_dir() . '/abstract_driver_test'; |
|
| 75 | + $this->dir = sys_get_temp_dir().'/abstract_driver_test'; |
|
| 76 | 76 | @mkdir($this->dir, 0777, true); |
| 77 | 77 | } |
| 78 | 78 | |
@@ -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 | { |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | */ |
| 180 | 180 | public function testMapAssociationInGlobalNamespace() : void |
| 181 | 181 | { |
| 182 | - require_once __DIR__ . '/../../Models/Global/GlobalNamespaceModel.php'; |
|
| 182 | + require_once __DIR__.'/../../Models/Global/GlobalNamespaceModel.php'; |
|
| 183 | 183 | |
| 184 | 184 | $cm = new ClassMetadata(DoctrineGlobalArticle::class, $this->metadataBuildingContext); |
| 185 | 185 | $cm->setTable(new Mapping\TableMetadata('doctrine_global_article')); |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | */ |
| 276 | 276 | public function testSetDiscriminatorMapInGlobalNamespace() : void |
| 277 | 277 | { |
| 278 | - require_once __DIR__ . '/../../Models/Global/GlobalNamespaceModel.php'; |
|
| 278 | + require_once __DIR__.'/../../Models/Global/GlobalNamespaceModel.php'; |
|
| 279 | 279 | |
| 280 | 280 | $cm = new ClassMetadata('DoctrineGlobalUser', $this->metadataBuildingContext); |
| 281 | 281 | $cm->setTable(new Mapping\TableMetadata('doctrine_global_user')); |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | */ |
| 292 | 292 | public function testSetSubClassesInGlobalNamespace() : void |
| 293 | 293 | { |
| 294 | - require_once __DIR__ . '/../../Models/Global/GlobalNamespaceModel.php'; |
|
| 294 | + require_once __DIR__.'/../../Models/Global/GlobalNamespaceModel.php'; |
|
| 295 | 295 | |
| 296 | 296 | $cm = new ClassMetadata('DoctrineGlobalUser', $this->metadataBuildingContext); |
| 297 | 297 | $cm->setTable(new Mapping\TableMetadata('doctrine_global_user')); |
@@ -806,7 +806,7 @@ discard block |
||
| 806 | 806 | public function testEmptyFieldNameThrowsException() : void |
| 807 | 807 | { |
| 808 | 808 | $this->expectException(MappingException::class); |
| 809 | - $this->expectExceptionMessage("The field or association mapping misses the 'fieldName' attribute in entity '" . CMS\CmsUser::class . "'."); |
|
| 809 | + $this->expectExceptionMessage("The field or association mapping misses the 'fieldName' attribute in entity '".CMS\CmsUser::class."'."); |
|
| 810 | 810 | |
| 811 | 811 | $cm = new ClassMetadata(CMS\CmsUser::class, $this->metadataBuildingContext); |
| 812 | 812 | $cm->setTable(new Mapping\TableMetadata('cms_users')); |
@@ -856,7 +856,7 @@ discard block |
||
| 856 | 856 | $cm->addLifecycleCallback('notfound', 'postLoad'); |
| 857 | 857 | |
| 858 | 858 | $this->expectException(MappingException::class); |
| 859 | - $this->expectExceptionMessage("Entity '" . CMS\CmsUser::class . "' has no method 'notfound' to be registered as lifecycle callback."); |
|
| 859 | + $this->expectExceptionMessage("Entity '".CMS\CmsUser::class."' has no method 'notfound' to be registered as lifecycle callback."); |
|
| 860 | 860 | |
| 861 | 861 | $cm->validateLifecycleCallbacks(new RuntimeReflectionService()); |
| 862 | 862 | } |
@@ -876,7 +876,7 @@ discard block |
||
| 876 | 876 | $cm->addProperty($association); |
| 877 | 877 | |
| 878 | 878 | $this->expectException(MappingException::class); |
| 879 | - $this->expectExceptionMessage("The target-entity 'UnknownClass' cannot be found in '" . CMS\CmsUser::class . "#address'."); |
|
| 879 | + $this->expectExceptionMessage("The target-entity 'UnknownClass' cannot be found in '".CMS\CmsUser::class."#address'."); |
|
| 880 | 880 | |
| 881 | 881 | $cm->validateAssociations(); |
| 882 | 882 | } |
@@ -1122,6 +1122,6 @@ discard block |
||
| 1122 | 1122 | */ |
| 1123 | 1123 | public function propertyToColumnName($propertyName, $className = null) |
| 1124 | 1124 | { |
| 1125 | - return strtolower($this->classToTableName($className)) . '_' . $propertyName; |
|
| 1125 | + return strtolower($this->classToTableName($className)).'_'.$propertyName; |
|
| 1126 | 1126 | } |
| 1127 | 1127 | } |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | protected function loadDriverForCMSModels() |
| 121 | 121 | { |
| 122 | 122 | $annotationDriver = $this->loadDriver(); |
| 123 | - $annotationDriver->addPaths([__DIR__ . '/../../Models/CMS/']); |
|
| 123 | + $annotationDriver->addPaths([__DIR__.'/../../Models/CMS/']); |
|
| 124 | 124 | return $annotationDriver; |
| 125 | 125 | } |
| 126 | 126 | |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | public function testJoinTablesWithMappedSuperclassForAnnotationDriver() : void |
| 143 | 143 | { |
| 144 | 144 | $annotationDriver = $this->loadDriver(); |
| 145 | - $annotationDriver->addPaths([__DIR__ . '/../../Models/DirectoryTree/']); |
|
| 145 | + $annotationDriver->addPaths([__DIR__.'/../../Models/DirectoryTree/']); |
|
| 146 | 146 | |
| 147 | 147 | $em = $this->getTestEntityManager(); |
| 148 | 148 | $em->getConfiguration()->setMetadataDriverImpl($annotationDriver); |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | |
| 173 | 173 | $this->expectException(MappingException::class); |
| 174 | 174 | $this->expectExceptionMessage( |
| 175 | - 'It is illegal to put an inverse side one-to-many or many-to-many association on ' . |
|
| 175 | + 'It is illegal to put an inverse side one-to-many or many-to-many association on '. |
|
| 176 | 176 | "mapped superclass 'Doctrine\Tests\ORM\Mapping\InvalidMappedSuperClass#users'" |
| 177 | 177 | ); |
| 178 | 178 | |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | { |
| 28 | 28 | protected function loadDriver() |
| 29 | 29 | { |
| 30 | - return new XmlDriver(__DIR__ . DIRECTORY_SEPARATOR . 'xml'); |
|
| 30 | + return new XmlDriver(__DIR__.DIRECTORY_SEPARATOR.'xml'); |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | public function testClassTableInheritanceDiscriminatorMap() : void |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | */ |
| 171 | 171 | public function testValidateXmlSchema($xmlMappingFile) : void |
| 172 | 172 | { |
| 173 | - $xsdSchemaFile = __DIR__ . '/../../../../../doctrine-mapping.xsd'; |
|
| 173 | + $xsdSchemaFile = __DIR__.'/../../../../../doctrine-mapping.xsd'; |
|
| 174 | 174 | $dom = new \DOMDocument('UTF-8'); |
| 175 | 175 | |
| 176 | 176 | $dom->load($xmlMappingFile); |
@@ -180,14 +180,14 @@ discard block |
||
| 180 | 180 | |
| 181 | 181 | public static function dataValidSchema() |
| 182 | 182 | { |
| 183 | - $list = glob(__DIR__ . '/xml/*.xml'); |
|
| 183 | + $list = glob(__DIR__.'/xml/*.xml'); |
|
| 184 | 184 | $invalid = ['Doctrine.Tests.Models.DDC889.DDC889Class.dcm']; |
| 185 | 185 | |
| 186 | - $list = array_filter($list, function ($item) use ($invalid) { |
|
| 186 | + $list = array_filter($list, function($item) use ($invalid) { |
|
| 187 | 187 | return ! in_array(pathinfo($item, PATHINFO_FILENAME), $invalid, true); |
| 188 | 188 | }); |
| 189 | 189 | |
| 190 | - return array_map(function ($item) { |
|
| 190 | + return array_map(function($item) { |
|
| 191 | 191 | return [$item]; |
| 192 | 192 | }, $list); |
| 193 | 193 | } |