@@ -39,8 +39,8 @@ discard block |
||
39 | 39 | for ($i = 1; $i <= 10000; ++$i) { |
40 | 40 | $user = new CMS\CmsUser(); |
41 | 41 | $user->status = 'user'; |
42 | - $user->username = 'user' . $i; |
|
43 | - $user->name = 'Mr.Smith-' . $i; |
|
42 | + $user->username = 'user'.$i; |
|
43 | + $user->name = 'Mr.Smith-'.$i; |
|
44 | 44 | |
45 | 45 | $this->users[$i] = $user; |
46 | 46 | } |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | // Yes, this is a lot of overhead, but I have no better solution other than |
54 | 54 | // completely mocking out the DB, which would be silly (query impact is |
55 | 55 | // necessarily part of our benchmarks) |
56 | - $this->entityManager->getConnection()->executeQuery('DELETE FROM ' . $this->tableName)->execute(); |
|
56 | + $this->entityManager->getConnection()->executeQuery('DELETE FROM '.$this->tableName)->execute(); |
|
57 | 57 | |
58 | 58 | foreach ($this->users as $key => $user) { |
59 | 59 | $this->entityManager->persist($user); |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | $conn = static::$sharedConn; |
346 | 346 | |
347 | 347 | // In case test is skipped, tearDown is called, but no setup may have run |
348 | - if (! $conn) { |
|
348 | + if ( ! $conn) { |
|
349 | 349 | return; |
350 | 350 | } |
351 | 351 | |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | } |
420 | 420 | |
421 | 421 | if (isset($this->usedModelSets['directorytree'])) { |
422 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('file')); |
|
422 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('file')); |
|
423 | 423 | // MySQL doesn't know deferred deletions therefore only executing the second query gives errors. |
424 | 424 | $conn->executeUpdate('DELETE FROM Directory WHERE parentDirectory_id IS NOT NULL'); |
425 | 425 | $conn->executeUpdate('DELETE FROM Directory'); |
@@ -512,12 +512,12 @@ discard block |
||
512 | 512 | ) |
513 | 513 | ); |
514 | 514 | |
515 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-users-groups')); |
|
516 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-group')); |
|
517 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-phone')); |
|
518 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-user')); |
|
519 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-address')); |
|
520 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-city')); |
|
515 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-users-groups')); |
|
516 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-group')); |
|
517 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-phone')); |
|
518 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-user')); |
|
519 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-address')); |
|
520 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-city')); |
|
521 | 521 | } |
522 | 522 | |
523 | 523 | if (isset($this->usedModelSets['vct_onetoone'])) { |
@@ -638,7 +638,7 @@ discard block |
||
638 | 638 | $classes[] = $this->em->getClassMetadata($className); |
639 | 639 | } |
640 | 640 | |
641 | - if (! $classes) { |
|
641 | + if ( ! $classes) { |
|
642 | 642 | return; |
643 | 643 | } |
644 | 644 | |
@@ -654,19 +654,19 @@ discard block |
||
654 | 654 | { |
655 | 655 | $this->setUpDBALTypes(); |
656 | 656 | |
657 | - if (! isset(static::$sharedConn)) { |
|
657 | + if ( ! isset(static::$sharedConn)) { |
|
658 | 658 | static::$sharedConn = TestUtil::getConnection(); |
659 | 659 | } |
660 | 660 | |
661 | 661 | if (isset($GLOBALS['DOCTRINE_MARK_SQL_LOGS'])) { |
662 | 662 | if (in_array(static::$sharedConn->getDatabasePlatform()->getName(), ['mysql', 'postgresql'], true)) { |
663 | - static::$sharedConn->executeQuery('SELECT 1 /*' . get_class($this) . '*/'); |
|
663 | + static::$sharedConn->executeQuery('SELECT 1 /*'.get_class($this).'*/'); |
|
664 | 664 | } elseif (static::$sharedConn->getDatabasePlatform()->getName() === 'oracle') { |
665 | - static::$sharedConn->executeQuery('SELECT 1 /*' . get_class($this) . '*/ FROM dual'); |
|
665 | + static::$sharedConn->executeQuery('SELECT 1 /*'.get_class($this).'*/ FROM dual'); |
|
666 | 666 | } |
667 | 667 | } |
668 | 668 | |
669 | - if (! $this->em) { |
|
669 | + if ( ! $this->em) { |
|
670 | 670 | $this->em = $this->getEntityManager(); |
671 | 671 | $this->schemaTool = new SchemaTool($this->em); |
672 | 672 | } |
@@ -749,8 +749,8 @@ discard block |
||
749 | 749 | |
750 | 750 | $config->setMetadataDriverImpl( |
751 | 751 | $mappingDriver ?? $config->newDefaultAnnotationDriver([ |
752 | - realpath(__DIR__ . '/Models/Cache'), |
|
753 | - realpath(__DIR__ . '/Models/GeoNames'), |
|
752 | + realpath(__DIR__.'/Models/Cache'), |
|
753 | + realpath(__DIR__.'/Models/GeoNames'), |
|
754 | 754 | ]) |
755 | 755 | ); |
756 | 756 | |
@@ -800,20 +800,20 @@ discard block |
||
800 | 800 | |
801 | 801 | foreach ($last25queries as $i => $query) { |
802 | 802 | $params = array_map( |
803 | - function ($p) { |
|
803 | + function($p) { |
|
804 | 804 | return is_object($p) ? get_class($p) : var_export($p, true); |
805 | 805 | }, |
806 | 806 | $query['params'] ?: [] |
807 | 807 | ); |
808 | 808 | |
809 | - $queries .= $i . ". SQL: '" . $query['sql'] . "' Params: " . implode(', ', $params) . PHP_EOL; |
|
809 | + $queries .= $i.". SQL: '".$query['sql']."' Params: ".implode(', ', $params).PHP_EOL; |
|
810 | 810 | } |
811 | 811 | |
812 | 812 | $trace = $e->getTrace(); |
813 | 813 | $traceMsg = ''; |
814 | 814 | |
815 | 815 | foreach ($trace as $part) { |
816 | - if (! isset($part['file'])) { |
|
816 | + if ( ! isset($part['file'])) { |
|
817 | 817 | continue; |
818 | 818 | } |
819 | 819 | |
@@ -822,10 +822,10 @@ discard block |
||
822 | 822 | break; |
823 | 823 | } |
824 | 824 | |
825 | - $traceMsg .= $part['file'] . ':' . $part['line'] . PHP_EOL; |
|
825 | + $traceMsg .= $part['file'].':'.$part['line'].PHP_EOL; |
|
826 | 826 | } |
827 | 827 | |
828 | - $message = '[' . get_class($e) . '] ' . $e->getMessage() . PHP_EOL . PHP_EOL . 'With queries:' . PHP_EOL . $queries . PHP_EOL . 'Trace:' . PHP_EOL . $traceMsg; |
|
828 | + $message = '['.get_class($e).'] '.$e->getMessage().PHP_EOL.PHP_EOL.'With queries:'.PHP_EOL.$queries.PHP_EOL.'Trace:'.PHP_EOL.$traceMsg; |
|
829 | 829 | |
830 | 830 | throw new \Exception($message, (int) $e->getCode(), $e); |
831 | 831 | } |
@@ -506,7 +506,7 @@ discard block |
||
506 | 506 | 'empty string, single field' => [$emptyString, ''], |
507 | 507 | 'non-empty string, single field' => [$nonEmptyString, $nonEmptyString->id], |
508 | 508 | 'empty strings, two fields' => [$emptyStrings, ' '], |
509 | - 'non-empty strings, two fields' => [$nonEmptyStrings, $nonEmptyStrings->id1 . ' ' . $nonEmptyStrings->id2], |
|
509 | + 'non-empty strings, two fields' => [$nonEmptyStrings, $nonEmptyStrings->id1.' '.$nonEmptyStrings->id2], |
|
510 | 510 | 'boolean true' => [$booleanTrue, '1'], |
511 | 511 | 'boolean false' => [$booleanFalse, ''], |
512 | 512 | ]; |
@@ -777,7 +777,7 @@ discard block |
||
777 | 777 | |
778 | 778 | protected function onPropertyChanged($propName, $oldValue, $newValue) |
779 | 779 | { |
780 | - if (! $this->listeners) { |
|
780 | + if ( ! $this->listeners) { |
|
781 | 781 | return; |
782 | 782 | } |
783 | 783 |
@@ -37,7 +37,7 @@ |
||
37 | 37 | public function testWalkComparison(CriteriaComparison $criteriaExpr, $queryExpr, ?Parameter $parameter = null) : void |
38 | 38 | { |
39 | 39 | self::assertEquals($queryExpr, $this->visitor->walkComparison($criteriaExpr)); |
40 | - if (! $parameter) { |
|
40 | + if ( ! $parameter) { |
|
41 | 41 | return; |
42 | 42 | } |
43 | 43 |
@@ -231,8 +231,8 @@ discard block |
||
231 | 231 | $eventManager->addEventListener([Events::postLoad], $listener); |
232 | 232 | |
233 | 233 | $this->em->find(CmsUser::class, $this->userId); |
234 | - self::assertSame(1, $listener->countHandledEvents(CmsUser::class), CmsUser::class . ' should be handled once!'); |
|
235 | - self::assertSame(1, $listener->countHandledEvents(CmsEmail::class), CmsEmail::class . ' should be handled once!'); |
|
234 | + self::assertSame(1, $listener->countHandledEvents(CmsUser::class), CmsUser::class.' should be handled once!'); |
|
235 | + self::assertSame(1, $listener->countHandledEvents(CmsEmail::class), CmsEmail::class.' should be handled once!'); |
|
236 | 236 | } |
237 | 237 | |
238 | 238 | private function loadFixture() |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | public function postLoad(LifecycleEventArgs $event) |
291 | 291 | { |
292 | 292 | $object = $event->getObject(); |
293 | - if (! ($object instanceof CmsUser)) { |
|
293 | + if ( ! ($object instanceof CmsUser)) { |
|
294 | 294 | return; |
295 | 295 | } |
296 | 296 | |
@@ -310,12 +310,12 @@ discard block |
||
310 | 310 | { |
311 | 311 | $object = $event->getObject(); |
312 | 312 | $class = StaticClassNameConverter::getClass($object); |
313 | - if (! isset($this->firedByClasses[$class])) { |
|
313 | + if ( ! isset($this->firedByClasses[$class])) { |
|
314 | 314 | $this->firedByClasses[$class] = 1; |
315 | 315 | } else { |
316 | 316 | $this->firedByClasses[$class]++; |
317 | 317 | } |
318 | - if (! ($object instanceof CmsUser)) { |
|
318 | + if ( ! ($object instanceof CmsUser)) { |
|
319 | 319 | return; |
320 | 320 | } |
321 | 321 |
@@ -18,7 +18,7 @@ |
||
18 | 18 | return; |
19 | 19 | } |
20 | 20 | |
21 | - $this->markTestSkipped('The ' . __CLASS__ . ' requires the use of mysql.'); |
|
21 | + $this->markTestSkipped('The '.__CLASS__.' requires the use of mysql.'); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | public function testGetCreateSchemaSql() : void |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | return; |
24 | 24 | } |
25 | 25 | |
26 | - $this->markTestSkipped('The ' . __CLASS__ . ' requires the use of postgresql.'); |
|
26 | + $this->markTestSkipped('The '.__CLASS__.' requires the use of postgresql.'); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | public function testPostgresMetadataSequenceIncrementedBy10() : void |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $tool->createSchema($classes); |
136 | 136 | |
137 | 137 | $sql = $tool->getUpdateSchemaSql($classes); |
138 | - $sql = array_filter($sql, function ($sql) { |
|
138 | + $sql = array_filter($sql, function($sql) { |
|
139 | 139 | return strpos($sql, 'DROP SEQUENCE stonewood.') === 0; |
140 | 140 | }); |
141 | 141 |
@@ -57,7 +57,7 @@ |
||
57 | 57 | |
58 | 58 | foreach ($uow->getScheduledEntityInsertions() as $entity) { |
59 | 59 | $this->inserts++; |
60 | - if (! ($entity instanceof CmsUser)) { |
|
60 | + if ( ! ($entity instanceof CmsUser)) { |
|
61 | 61 | continue; |
62 | 62 | } |
63 | 63 |
@@ -115,7 +115,7 @@ |
||
115 | 115 | public function setClient(DDC440Client $value, $update_inverse = true) |
116 | 116 | { |
117 | 117 | $this->client = $value; |
118 | - if (! $update_inverse) { |
|
118 | + if ( ! $update_inverse) { |
|
119 | 119 | return; |
120 | 120 | } |
121 | 121 |