@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | * <http://www.doctrine-project.org>. |
19 | 19 | */ |
20 | 20 | |
21 | -declare(strict_types=1); |
|
21 | +declare(strict_types = 1); |
|
22 | 22 | |
23 | 23 | namespace Doctrine\ORM\Mapping\Driver; |
24 | 24 | |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | foreach ($this->drivers as $namespace => $driver) { |
131 | 131 | $oid = spl_object_hash($driver); |
132 | 132 | |
133 | - if (!isset($driverClasses[$oid])) { |
|
133 | + if ( ! isset($driverClasses[$oid])) { |
|
134 | 134 | $driverClasses[$oid] = $driver->getAllClassNames(); |
135 | 135 | } |
136 | 136 |
@@ -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\Functional\Ticket; |
6 | 6 | |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | $this->em->getClassMetadata(DDC633Appointment::class), |
20 | 20 | ] |
21 | 21 | ); |
22 | - } catch(\Exception $e) { |
|
22 | + } catch (\Exception $e) { |
|
23 | 23 | |
24 | 24 | } |
25 | 25 | } |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $this->em->flush(); |
67 | 67 | $this->em->clear(); |
68 | 68 | |
69 | - $appointments = $this->em->createQuery("SELECT a FROM " . __NAMESPACE__ . "\DDC633Appointment a")->getResult(); |
|
69 | + $appointments = $this->em->createQuery("SELECT a FROM ".__NAMESPACE__."\DDC633Appointment a")->getResult(); |
|
70 | 70 | |
71 | 71 | foreach ($appointments as $eagerAppointment) { |
72 | 72 | self::assertInstanceOf(GhostObjectInterface::class, $eagerAppointment->patient); |
@@ -54,65 +54,65 @@ |
||
54 | 54 | /** @ORM\Column(type="string", nullable=false) */ |
55 | 55 | protected $name; |
56 | 56 | |
57 | - /** @ORM\Column(type="string", nullable=true) */ |
|
58 | - protected $description; |
|
59 | - |
|
60 | - /** |
|
61 | - * @ORM\ManyToMany(targetEntity="DDC719Group", inversedBy="parents") |
|
62 | - * @ORM\JoinTable(name="groups_groups", |
|
63 | - * joinColumns={@ORM\JoinColumn(name="parent_id", referencedColumnName="id")}, |
|
64 | - * inverseJoinColumns={@ORM\JoinColumn(name="child_id", referencedColumnName="id")} |
|
65 | - * ) |
|
66 | - */ |
|
67 | - protected $children = null; |
|
68 | - |
|
69 | - /** |
|
70 | - * @ORM\ManyToMany(targetEntity="DDC719Group", mappedBy="children") |
|
71 | - */ |
|
72 | - protected $parents = null; |
|
73 | - |
|
74 | - /** |
|
75 | - * construct |
|
76 | - */ |
|
77 | - public function __construct() { |
|
78 | - parent::__construct(); |
|
79 | - |
|
80 | - $this->channels = new ArrayCollection(); |
|
81 | - $this->children = new ArrayCollection(); |
|
82 | - $this->parents = new ArrayCollection(); |
|
83 | - } |
|
84 | - |
|
85 | - /** |
|
86 | - * adds group as new child |
|
87 | - * |
|
88 | - * @param Group $child |
|
89 | - */ |
|
90 | - public function addGroup(Group $child) { |
|
57 | + /** @ORM\Column(type="string", nullable=true) */ |
|
58 | + protected $description; |
|
59 | + |
|
60 | + /** |
|
61 | + * @ORM\ManyToMany(targetEntity="DDC719Group", inversedBy="parents") |
|
62 | + * @ORM\JoinTable(name="groups_groups", |
|
63 | + * joinColumns={@ORM\JoinColumn(name="parent_id", referencedColumnName="id")}, |
|
64 | + * inverseJoinColumns={@ORM\JoinColumn(name="child_id", referencedColumnName="id")} |
|
65 | + * ) |
|
66 | + */ |
|
67 | + protected $children = null; |
|
68 | + |
|
69 | + /** |
|
70 | + * @ORM\ManyToMany(targetEntity="DDC719Group", mappedBy="children") |
|
71 | + */ |
|
72 | + protected $parents = null; |
|
73 | + |
|
74 | + /** |
|
75 | + * construct |
|
76 | + */ |
|
77 | + public function __construct() { |
|
78 | + parent::__construct(); |
|
79 | + |
|
80 | + $this->channels = new ArrayCollection(); |
|
81 | + $this->children = new ArrayCollection(); |
|
82 | + $this->parents = new ArrayCollection(); |
|
83 | + } |
|
84 | + |
|
85 | + /** |
|
86 | + * adds group as new child |
|
87 | + * |
|
88 | + * @param Group $child |
|
89 | + */ |
|
90 | + public function addGroup(Group $child) { |
|
91 | 91 | if ( ! $this->children->contains($child)) { |
92 | 92 | $this->children->add($child); |
93 | 93 | $child->addGroup($this); |
94 | 94 | } |
95 | - } |
|
96 | - |
|
97 | - /** |
|
98 | - * adds channel as new child |
|
99 | - * |
|
100 | - * @param Channel $child |
|
101 | - */ |
|
102 | - public function addChannel(Channel $child) { |
|
95 | + } |
|
96 | + |
|
97 | + /** |
|
98 | + * adds channel as new child |
|
99 | + * |
|
100 | + * @param Channel $child |
|
101 | + */ |
|
102 | + public function addChannel(Channel $child) { |
|
103 | 103 | if ( ! $this->channels->contains($child)) { |
104 | 104 | $this->channels->add($child); |
105 | 105 | } |
106 | - } |
|
107 | - |
|
108 | - /** |
|
109 | - * getter & setter |
|
110 | - */ |
|
111 | - public function getName() { return $this->name; } |
|
112 | - public function setName($name) { $this->name = $name; } |
|
113 | - public function getDescription() { return $this->description; } |
|
114 | - public function setDescription($description) { $this->description = $description; } |
|
115 | - public function getChildren() { return $this->children; } |
|
116 | - public function getParents() { return $this->parents; } |
|
117 | - public function getChannels() { return $this->channels; } |
|
106 | + } |
|
107 | + |
|
108 | + /** |
|
109 | + * getter & setter |
|
110 | + */ |
|
111 | + public function getName() { return $this->name; } |
|
112 | + public function setName($name) { $this->name = $name; } |
|
113 | + public function getDescription() { return $this->description; } |
|
114 | + public function setDescription($description) { $this->description = $description; } |
|
115 | + public function getChildren() { return $this->children; } |
|
116 | + public function getParents() { return $this->parents; } |
|
117 | + public function getChannels() { return $this->channels; } |
|
118 | 118 | } |
@@ -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\Functional; |
6 | 6 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | $this->em->flush(); |
96 | 96 | $this->em->clear(); |
97 | 97 | |
98 | - $query = $this->em->createQuery('select u, a from ' . CmsUser::class . ' u join u.articles a ORDER BY a.topic'); |
|
98 | + $query = $this->em->createQuery('select u, a from '.CmsUser::class.' u join u.articles a ORDER BY a.topic'); |
|
99 | 99 | $users = $query->getResult(); |
100 | 100 | |
101 | 101 | self::assertCount(1, $users); |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | $this->em->flush(); |
116 | 116 | $this->em->clear(); |
117 | 117 | |
118 | - $q = $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.username = ?0'); |
|
118 | + $q = $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u WHERE u.username = ?0'); |
|
119 | 119 | $q->setParameter(0, 'jwage'); |
120 | 120 | $user = $q->getSingleResult(); |
121 | 121 | |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | $this->expectException(QueryException::class); |
128 | 128 | $this->expectExceptionMessage('Invalid parameter: token 2 is not defined in the query.'); |
129 | 129 | |
130 | - $q = $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1'); |
|
130 | + $q = $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u WHERE u.name = ?1'); |
|
131 | 131 | $q->setParameter(2, 'jwage'); |
132 | 132 | $user = $q->getSingleResult(); |
133 | 133 | } |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | $this->expectException(QueryException::class); |
138 | 138 | $this->expectExceptionMessage('Too many parameters: the query defines 1 parameters and you bound 2'); |
139 | 139 | |
140 | - $q = $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1'); |
|
140 | + $q = $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u WHERE u.name = ?1'); |
|
141 | 141 | $q->setParameter(1, 'jwage'); |
142 | 142 | $q->setParameter(2, 'jwage'); |
143 | 143 | |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | $this->expectException(QueryException::class); |
150 | 150 | $this->expectExceptionMessage('Too few parameters: the query defines 1 parameters but you only bound 0'); |
151 | 151 | |
152 | - $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1') |
|
152 | + $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u WHERE u.name = ?1') |
|
153 | 153 | ->getSingleResult(); |
154 | 154 | } |
155 | 155 | |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | { |
158 | 158 | $this->expectException(QueryException::class); |
159 | 159 | |
160 | - $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?') |
|
160 | + $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u WHERE u.name = ?') |
|
161 | 161 | ->setParameter(1, 'jwage') |
162 | 162 | ->getSingleResult(); |
163 | 163 | } |
@@ -168,11 +168,11 @@ discard block |
||
168 | 168 | $parameters->add(new Parameter(1, 'jwage')); |
169 | 169 | $parameters->add(new Parameter(2, 'active')); |
170 | 170 | |
171 | - $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1 AND u.status = ?2') |
|
171 | + $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u WHERE u.name = ?1 AND u.status = ?2') |
|
172 | 172 | ->setParameters($parameters) |
173 | 173 | ->getResult(); |
174 | 174 | |
175 | - $extractValue = function (Parameter $parameter) { |
|
175 | + $extractValue = function(Parameter $parameter) { |
|
176 | 176 | return $parameter->getValue(); |
177 | 177 | }; |
178 | 178 | |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | { |
187 | 187 | $parameters = [1 => 'jwage', 2 => 'active']; |
188 | 188 | |
189 | - $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1 AND u.status = ?2') |
|
189 | + $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u WHERE u.name = ?1 AND u.status = ?2') |
|
190 | 190 | ->setParameters($parameters) |
191 | 191 | ->getResult(); |
192 | 192 | |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | $this->em->clear(); |
217 | 217 | $articleId = $article1->id; |
218 | 218 | |
219 | - $query = $this->em->createQuery('select a from ' . CmsArticle::class . ' a WHERE a.topic = ?1'); |
|
219 | + $query = $this->em->createQuery('select a from '.CmsArticle::class.' a WHERE a.topic = ?1'); |
|
220 | 220 | $articles = $query->iterate(new ArrayCollection([new Parameter(1, 'Doctrine 2')]), Query::HYDRATE_ARRAY); |
221 | 221 | |
222 | 222 | $found = []; |
@@ -257,13 +257,13 @@ discard block |
||
257 | 257 | $this->em->flush(); |
258 | 258 | $this->em->clear(); |
259 | 259 | |
260 | - $query = $this->em->createQuery('select a from ' . CmsArticle::class . ' a'); |
|
260 | + $query = $this->em->createQuery('select a from '.CmsArticle::class.' a'); |
|
261 | 261 | $articles = $query->iterate(); |
262 | 262 | |
263 | 263 | $iteratedCount = 0; |
264 | 264 | $topics = []; |
265 | 265 | |
266 | - foreach($articles as $row) { |
|
266 | + foreach ($articles as $row) { |
|
267 | 267 | $article = $row[0]; |
268 | 268 | $topics[] = $article->topic; |
269 | 269 | |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | |
303 | 303 | $iteratedCount = 0; |
304 | 304 | $topics = []; |
305 | - foreach($articles as $row) { |
|
305 | + foreach ($articles as $row) { |
|
306 | 306 | $article = $row[0]; |
307 | 307 | $topics[] = $article->topic; |
308 | 308 | |
@@ -379,8 +379,8 @@ discard block |
||
379 | 379 | { |
380 | 380 | for ($i = 0; $i < 5; $i++) { |
381 | 381 | $user = new CmsUser; |
382 | - $user->name = 'Guilherme' . $i; |
|
383 | - $user->username = 'gblanco' . $i; |
|
382 | + $user->name = 'Guilherme'.$i; |
|
383 | + $user->username = 'gblanco'.$i; |
|
384 | 384 | $user->status = 'developer'; |
385 | 385 | $this->em->persist($user); |
386 | 386 | } |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | $this->em->flush(); |
389 | 389 | $this->em->clear(); |
390 | 390 | |
391 | - $data = $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u') |
|
391 | + $data = $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u') |
|
392 | 392 | ->setFirstResult(1) |
393 | 393 | ->setMaxResults(2) |
394 | 394 | ->getResult(); |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | self::assertEquals('gblanco1', $data[0]->username); |
398 | 398 | self::assertEquals('gblanco2', $data[1]->username); |
399 | 399 | |
400 | - $data = $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u') |
|
400 | + $data = $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u') |
|
401 | 401 | ->setFirstResult(3) |
402 | 402 | ->setMaxResults(2) |
403 | 403 | ->getResult(); |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | self::assertEquals('gblanco3', $data[0]->username); |
407 | 407 | self::assertEquals('gblanco4', $data[1]->username); |
408 | 408 | |
409 | - $data = $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u') |
|
409 | + $data = $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u') |
|
410 | 410 | ->setFirstResult(3) |
411 | 411 | ->setMaxResults(2) |
412 | 412 | ->getScalarResult(); |
@@ -515,13 +515,13 @@ discard block |
||
515 | 515 | $this->em->flush(); |
516 | 516 | $this->em->clear(); |
517 | 517 | |
518 | - $query = $this->em->createQuery("select u from " . CmsUser::class . " u where u.username = 'gblanco'"); |
|
518 | + $query = $this->em->createQuery("select u from ".CmsUser::class." u where u.username = 'gblanco'"); |
|
519 | 519 | $fetchedUser = $query->getOneOrNullResult(); |
520 | 520 | |
521 | 521 | self::assertInstanceOf(CmsUser::class, $fetchedUser); |
522 | 522 | self::assertEquals('gblanco', $fetchedUser->username); |
523 | 523 | |
524 | - $query = $this->em->createQuery("select u.username from " . CmsUser::class . " u where u.username = 'gblanco'"); |
|
524 | + $query = $this->em->createQuery("select u.username from ".CmsUser::class." u where u.username = 'gblanco'"); |
|
525 | 525 | $fetchedUsername = $query->getOneOrNullResult(Query::HYDRATE_SINGLE_SCALAR); |
526 | 526 | |
527 | 527 | self::assertEquals('gblanco', $fetchedUsername); |
@@ -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 | } elseif (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; |