@@ -25,12 +25,12 @@ |
||
25 | 25 | |
26 | 26 | if ($this->maxRunningTime != 0 && $time > $this->maxRunningTime) { |
27 | 27 | $this->fail( |
28 | - sprintf( |
|
28 | + sprintf( |
|
29 | 29 | 'expected running time: <= %s but was: %s', |
30 | 30 | |
31 | 31 | $this->maxRunningTime, |
32 | 32 | $time |
33 | - ) |
|
33 | + ) |
|
34 | 34 | ); |
35 | 35 | } |
36 | 36 | } |
@@ -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 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public function setMaxRunningTime($maxRunningTime) |
50 | 50 | { |
51 | - if (! (is_int($maxRunningTime) && $maxRunningTime >= 0)) { |
|
51 | + if ( ! (is_int($maxRunningTime) && $maxRunningTime >= 0)) { |
|
52 | 52 | throw new \InvalidArgumentException; |
53 | 53 | } |
54 | 54 |
@@ -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 | } |
@@ -1241,7 +1241,7 @@ |
||
1241 | 1241 | $association->setCascade(['invalid']); |
1242 | 1242 | |
1243 | 1243 | $cm->addProperty($association); |
1244 | - } |
|
1244 | + } |
|
1245 | 1245 | |
1246 | 1246 | /** |
1247 | 1247 | * @group DDC-964 |
@@ -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 | |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | use DoctrineGlobal_Article; |
32 | 32 | use SebastianBergmann\Environment\Runtime; |
33 | 33 | |
34 | -require_once __DIR__ . '/../../Models/Global/GlobalNamespaceModel.php'; |
|
34 | +require_once __DIR__.'/../../Models/Global/GlobalNamespaceModel.php'; |
|
35 | 35 | |
36 | 36 | class ClassMetadataTest extends OrmTestCase |
37 | 37 | { |
@@ -804,7 +804,7 @@ discard block |
||
804 | 804 | public function testEmptyFieldNameThrowsException() |
805 | 805 | { |
806 | 806 | $this->expectException(MappingException::class); |
807 | - $this->expectExceptionMessage("The field or association mapping misses the 'fieldName' attribute in entity '" . CMS\CmsUser::class . "'."); |
|
807 | + $this->expectExceptionMessage("The field or association mapping misses the 'fieldName' attribute in entity '".CMS\CmsUser::class."'."); |
|
808 | 808 | |
809 | 809 | $cm = new ClassMetadata(CMS\CmsUser::class, $this->metadataBuildingContext); |
810 | 810 | $cm->setTable(new Mapping\TableMetadata('cms_users')); |
@@ -947,12 +947,12 @@ discard block |
||
947 | 947 | $mapping = $cm->getSqlResultSetMapping('find-all'); |
948 | 948 | |
949 | 949 | self::assertEquals('__CLASS__', $mapping['entities'][0]['entityClass']); |
950 | - self::assertEquals(['name'=>'id','column'=>'id'], $mapping['entities'][0]['fields'][0]); |
|
951 | - self::assertEquals(['name'=>'name','column'=>'name'], $mapping['entities'][0]['fields'][1]); |
|
950 | + self::assertEquals(['name'=>'id', 'column'=>'id'], $mapping['entities'][0]['fields'][0]); |
|
951 | + self::assertEquals(['name'=>'name', 'column'=>'name'], $mapping['entities'][0]['fields'][1]); |
|
952 | 952 | |
953 | 953 | self::assertEquals(CMS\CmsEmail::class, $mapping['entities'][1]['entityClass']); |
954 | - self::assertEquals(['name'=>'id','column'=>'id'], $mapping['entities'][1]['fields'][0]); |
|
955 | - self::assertEquals(['name'=>'email','column'=>'email'], $mapping['entities'][1]['fields'][1]); |
|
954 | + self::assertEquals(['name'=>'id', 'column'=>'id'], $mapping['entities'][1]['fields'][0]); |
|
955 | + self::assertEquals(['name'=>'email', 'column'=>'email'], $mapping['entities'][1]['fields'][1]); |
|
956 | 956 | |
957 | 957 | self::assertEquals('scalarColumn', $mapping['columns'][0]['name']); |
958 | 958 | } |
@@ -1149,7 +1149,7 @@ discard block |
||
1149 | 1149 | $cm->addLifecycleCallback('notfound', 'postLoad'); |
1150 | 1150 | |
1151 | 1151 | $this->expectException(MappingException::class); |
1152 | - $this->expectExceptionMessage("Entity '" . CMS\CmsUser::class . "' has no method 'notfound' to be registered as lifecycle callback."); |
|
1152 | + $this->expectExceptionMessage("Entity '".CMS\CmsUser::class."' has no method 'notfound' to be registered as lifecycle callback."); |
|
1153 | 1153 | |
1154 | 1154 | $cm->validateLifecycleCallbacks(new RuntimeReflectionService()); |
1155 | 1155 | } |
@@ -1169,7 +1169,7 @@ discard block |
||
1169 | 1169 | $cm->addProperty($association); |
1170 | 1170 | |
1171 | 1171 | $this->expectException(MappingException::class); |
1172 | - $this->expectExceptionMessage("The target-entity 'UnknownClass' cannot be found in '" . CMS\CmsUser::class . "#address'."); |
|
1172 | + $this->expectExceptionMessage("The target-entity 'UnknownClass' cannot be found in '".CMS\CmsUser::class."#address'."); |
|
1173 | 1173 | |
1174 | 1174 | $cm->validateAssociations(); |
1175 | 1175 | } |
@@ -1510,6 +1510,6 @@ discard block |
||
1510 | 1510 | */ |
1511 | 1511 | public function propertyToColumnName($propertyName, $className = null) |
1512 | 1512 | { |
1513 | - return strtolower($this->classToTableName($className)) . '_' . $propertyName; |
|
1513 | + return strtolower($this->classToTableName($className)).'_'.$propertyName; |
|
1514 | 1514 | } |
1515 | 1515 | } |