@@ -66,6 +66,9 @@ discard block |
||
66 | 66 | return $this->name; |
67 | 67 | } |
68 | 68 | |
69 | + /** |
|
70 | + * @param string $name |
|
71 | + */ |
|
69 | 72 | public function setName($name) { |
70 | 73 | $this->name = $name; |
71 | 74 | } |
@@ -74,6 +77,9 @@ discard block |
||
74 | 77 | return $this->type; |
75 | 78 | } |
76 | 79 | |
80 | + /** |
|
81 | + * @param string $type |
|
82 | + */ |
|
77 | 83 | public function setType($type) { |
78 | 84 | $this->type = $type; |
79 | 85 | } |
@@ -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 | |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | $this->em->getClassMetadata(DDC656Entity::class) |
18 | 18 | ] |
19 | 19 | ); |
20 | - } catch(\Exception $e) { |
|
20 | + } catch (\Exception $e) { |
|
21 | 21 | |
22 | 22 | } |
23 | 23 | } |
@@ -118,6 +118,9 @@ discard block |
||
118 | 118 | return $this->name; |
119 | 119 | } |
120 | 120 | |
121 | + /** |
|
122 | + * @param string $name |
|
123 | + */ |
|
121 | 124 | public function setName($name) |
122 | 125 | { |
123 | 126 | $this->name = $name; |
@@ -155,6 +158,9 @@ discard block |
||
155 | 158 | $this->calls = new \Doctrine\Common\Collections\ArrayCollection(); |
156 | 159 | } |
157 | 160 | |
161 | + /** |
|
162 | + * @param integer $id |
|
163 | + */ |
|
158 | 164 | public function setId($id) |
159 | 165 | { |
160 | 166 | $this->id = $id; |
@@ -165,6 +171,9 @@ discard block |
||
165 | 171 | $this->user = $user; |
166 | 172 | } |
167 | 173 | |
174 | + /** |
|
175 | + * @param string $phoneNumber |
|
176 | + */ |
|
168 | 177 | public function setPhoneNumber($phoneNumber) |
169 | 178 | { |
170 | 179 | $this->phonenumber = $phoneNumber; |
@@ -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 | |
@@ -83,14 +83,14 @@ discard block |
||
83 | 83 | $this->em->clear(); |
84 | 84 | |
85 | 85 | // fetch-join that foreign-key/primary-key entity association |
86 | - $dql = "SELECT c, p FROM " . DDC881PhoneCall::class . " c JOIN c.phonenumber p"; |
|
86 | + $dql = "SELECT c, p FROM ".DDC881PhoneCall::class." c JOIN c.phonenumber p"; |
|
87 | 87 | $calls = $this->em->createQuery($dql)->getResult(); |
88 | 88 | |
89 | 89 | self::assertCount(2, $calls); |
90 | 90 | self::assertNotInstanceOf(GhostObjectInterface::class, $calls[0]->getPhoneNumber()); |
91 | 91 | self::assertNotInstanceOf(GhostObjectInterface::class, $calls[1]->getPhoneNumber()); |
92 | 92 | |
93 | - $dql = "SELECT p, c FROM " . DDC881PhoneNumber::class . " p JOIN p.calls c"; |
|
93 | + $dql = "SELECT p, c FROM ".DDC881PhoneNumber::class." p JOIN p.calls c"; |
|
94 | 94 | $numbers = $this->em->createQuery($dql)->getResult(); |
95 | 95 | |
96 | 96 | self::assertCount(2, $numbers); |
@@ -78,11 +78,17 @@ |
||
78 | 78 | */ |
79 | 79 | private $name; |
80 | 80 | |
81 | + /** |
|
82 | + * @param string $name |
|
83 | + */ |
|
81 | 84 | public function __construct($name) |
82 | 85 | { |
83 | 86 | $this->name = $name; |
84 | 87 | } |
85 | 88 | |
89 | + /** |
|
90 | + * @param string $name |
|
91 | + */ |
|
86 | 92 | public function setName($name) |
87 | 93 | { |
88 | 94 | $this->name = $name; |
@@ -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(DDC960Child::class) |
20 | 20 | ] |
21 | 21 | ); |
22 | - } catch(\Exception $e) { |
|
22 | + } catch (\Exception $e) { |
|
23 | 23 | |
24 | 24 | } |
25 | 25 | } |
@@ -240,7 +240,7 @@ |
||
240 | 240 | |
241 | 241 | /** |
242 | 242 | * |
243 | - * @return Phrase |
|
243 | + * @return Lemma |
|
244 | 244 | */ |
245 | 245 | public function getParent() { |
246 | 246 | return $this->parent; |
@@ -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 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | self::assertInstanceOf(Lemma::class, $lemma); |
91 | 91 | $relations = $lemma->getRelations(); |
92 | 92 | |
93 | - foreach($relations as $relation) { |
|
93 | + foreach ($relations as $relation) { |
|
94 | 94 | self::assertInstanceOf(Relation::class, $relation); |
95 | 95 | self::assertTrue($relation->getType()->getType() != ''); |
96 | 96 | } |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | } |
128 | 128 | |
129 | 129 | /** |
130 | - * @param field_type $fooTitle |
|
130 | + * @param string $fooTitle |
|
131 | 131 | */ |
132 | 132 | public function setFooTitle($fooTitle) |
133 | 133 | { |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | } |
206 | 206 | |
207 | 207 | /** |
208 | - * @param field_type $barTitle |
|
208 | + * @param string $barTitle |
|
209 | 209 | */ |
210 | 210 | public function setBarTitle($barTitle) |
211 | 211 | { |
@@ -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\Functional\Ticket; |
6 | 6 |
@@ -148,6 +148,9 @@ discard block |
||
148 | 148 | ); |
149 | 149 | } |
150 | 150 | |
151 | + /** |
|
152 | + * @param string $dql |
|
153 | + */ |
|
151 | 154 | protected function asyncDqlWithLock($dql, $params, $lockMode) |
152 | 155 | { |
153 | 156 | $this->startJob('dqlWithLock', [ |
@@ -168,6 +171,9 @@ discard block |
||
168 | 171 | ); |
169 | 172 | } |
170 | 173 | |
174 | + /** |
|
175 | + * @param string $fn |
|
176 | + */ |
|
171 | 177 | protected function startJob($fn, $fixture) |
172 | 178 | { |
173 | 179 | $this->gearman->addTask($fn, serialize( |
@@ -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\Locking; |
6 | 6 | |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | |
20 | 20 | protected function setUp() |
21 | 21 | { |
22 | - if (!class_exists('GearmanClient', false)) { |
|
22 | + if ( ! class_exists('GearmanClient', false)) { |
|
23 | 23 | $this->markTestSkipped('pecl/gearman is required for this test to run.'); |
24 | 24 | } |
25 | 25 | |
@@ -135,11 +135,11 @@ discard block |
||
135 | 135 | $this->gearman->runTasks(); |
136 | 136 | |
137 | 137 | self::assertTrue($this->maxRunTime > $forTime, |
138 | - "Because of locking this tests should have run at least " . $forTime . " seconds, ". |
|
139 | - "but only did for " . $this->maxRunTime . " seconds."); |
|
138 | + "Because of locking this tests should have run at least ".$forTime." seconds, ". |
|
139 | + "but only did for ".$this->maxRunTime." seconds."); |
|
140 | 140 | self::assertTrue($this->maxRunTime < $notLongerThan, |
141 | - "The longest task should not run longer than " . $notLongerThan . " seconds, ". |
|
142 | - "but did for " . $this->maxRunTime . " seconds." |
|
141 | + "The longest task should not run longer than ".$notLongerThan." seconds, ". |
|
142 | + "but did for ".$this->maxRunTime." seconds." |
|
143 | 143 | ); |
144 | 144 | } |
145 | 145 |
@@ -5,8 +5,8 @@ discard block |
||
5 | 5 | |
6 | 6 | // Path to composer autoloader. You can use different provided by your favorite framework, |
7 | 7 | // if you want to. |
8 | -$loaderPath = __DIR__ . '/../../vendor/autoload.php'; |
|
9 | -if(!is_readable($loaderPath)){ |
|
8 | +$loaderPath = __DIR__.'/../../vendor/autoload.php'; |
|
9 | +if ( ! is_readable($loaderPath)) { |
|
10 | 10 | throw new LogicException('Run php composer.phar install at first'); |
11 | 11 | } |
12 | 12 | $loader = require $loaderPath; |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | $config = new \Doctrine\ORM\Configuration(); |
20 | 20 | |
21 | 21 | // Set up Metadata Drivers |
22 | -$driverImpl = $config->newDefaultAnnotationDriver([__DIR__ . "/Entities"]); |
|
22 | +$driverImpl = $config->newDefaultAnnotationDriver([__DIR__."/Entities"]); |
|
23 | 23 | $config->setMetadataDriverImpl($driverImpl); |
24 | 24 | |
25 | 25 | // Set up caches, depending on $debug variable. |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | $config->setQueryCacheImpl($cache); |
30 | 30 | |
31 | 31 | // Proxy configuration |
32 | -$config->setProxyDir(__DIR__ . '/Proxies'); |
|
32 | +$config->setProxyDir(__DIR__.'/Proxies'); |
|
33 | 33 | $config->setProxyNamespace('Proxies'); |
34 | 34 | |
35 | 35 | // Database connection information |
@@ -1044,7 +1044,7 @@ |
||
1044 | 1044 | * Will return the configured id if it exists otherwise a hash will be |
1045 | 1045 | * automatically generated for you. |
1046 | 1046 | * |
1047 | - * @return array ($key, $hash) |
|
1047 | + * @return string[] ($key, $hash) |
|
1048 | 1048 | */ |
1049 | 1049 | protected function getHydrationCacheId() |
1050 | 1050 | { |
@@ -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\ORM; |
6 | 6 | |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | public function getParameter($key) |
307 | 307 | { |
308 | 308 | $filteredParameters = $this->parameters->filter( |
309 | - function ($parameter) use ($key) |
|
309 | + function($parameter) use ($key) |
|
310 | 310 | { |
311 | 311 | // Must not be identical because of string to integer conversion |
312 | 312 | return ($key == $parameter->getName()); |
@@ -355,14 +355,14 @@ discard block |
||
355 | 355 | public function setParameter($key, $value, $type = null) |
356 | 356 | { |
357 | 357 | $filteredParameters = $this->parameters->filter( |
358 | - function ($parameter) use ($key) |
|
358 | + function($parameter) use ($key) |
|
359 | 359 | { |
360 | 360 | // Must not be identical because of string to integer conversion |
361 | 361 | return ($key == $parameter->getName()); |
362 | 362 | } |
363 | 363 | ); |
364 | 364 | |
365 | - if (! $filteredParameters->isEmpty()) { |
|
365 | + if ( ! $filteredParameters->isEmpty()) { |
|
366 | 366 | $parameter = $filteredParameters->first(); |
367 | 367 | $parameter->setValue($value, $type); |
368 | 368 | |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | */ |
452 | 452 | private function translateNamespaces(Query\ResultSetMapping $rsm) |
453 | 453 | { |
454 | - $translate = function ($alias) { |
|
454 | + $translate = function($alias) { |
|
455 | 455 | return $this->em->getClassMetadata($alias)->getClassName(); |
456 | 456 | }; |
457 | 457 | |
@@ -513,7 +513,7 @@ discard block |
||
513 | 513 | */ |
514 | 514 | public function setResultCacheProfile(QueryCacheProfile $profile = null) |
515 | 515 | { |
516 | - if (! $profile->getResultCacheDriver()) { |
|
516 | + if ( ! $profile->getResultCacheDriver()) { |
|
517 | 517 | $resultCacheDriver = $this->em->getConfiguration()->getResultCacheImpl(); |
518 | 518 | $profile = $profile->setResultCacheDriver($resultCacheDriver); |
519 | 519 | } |
@@ -981,7 +981,7 @@ discard block |
||
981 | 981 | $this->getTimestampKey() |
982 | 982 | ); |
983 | 983 | |
984 | - $result = $queryCache->get($queryKey, $rsm, $this->hints); |
|
984 | + $result = $queryCache->get($queryKey, $rsm, $this->hints); |
|
985 | 985 | |
986 | 986 | if ($result !== null) { |
987 | 987 | if ($this->cacheLogger) { |
@@ -1115,6 +1115,6 @@ discard block |
||
1115 | 1115 | |
1116 | 1116 | ksort($hints); |
1117 | 1117 | |
1118 | - return sha1($query . '-' . serialize($params) . '-' . serialize($hints)); |
|
1118 | + return sha1($query.'-'.serialize($params).'-'.serialize($hints)); |
|
1119 | 1119 | } |
1120 | 1120 | } |
@@ -146,6 +146,12 @@ discard block |
||
146 | 146 | return [$user1, $user2, $user3]; |
147 | 147 | } |
148 | 148 | |
149 | + /** |
|
150 | + * @param string $name |
|
151 | + * @param string $username |
|
152 | + * @param string $status |
|
153 | + * @param CmsAddress $address |
|
154 | + */ |
|
149 | 155 | public function buildUser($name, $username, $status, $address) |
150 | 156 | { |
151 | 157 | $user = new CmsUser(); |
@@ -160,6 +166,12 @@ discard block |
||
160 | 166 | return $user; |
161 | 167 | } |
162 | 168 | |
169 | + /** |
|
170 | + * @param string $country |
|
171 | + * @param string $city |
|
172 | + * @param string $street |
|
173 | + * @param string $zip |
|
174 | + */ |
|
163 | 175 | public function buildAddress($country, $city, $street, $zip) |
164 | 176 | { |
165 | 177 | $address = new CmsAddress(); |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | */ |
311 | 311 | public function testExceptionIsThrownWhenCallingFindByWithoutParameter() { |
312 | 312 | $this->em->getRepository(CmsUser::class) |
313 | - ->findByStatus(); |
|
313 | + ->findByStatus(); |
|
314 | 314 | } |
315 | 315 | |
316 | 316 | /** |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | */ |
319 | 319 | public function testExceptionIsThrownWhenUsingInvalidFieldName() { |
320 | 320 | $this->em->getRepository(CmsUser::class) |
321 | - ->findByThisFieldDoesNotExist('testvalue'); |
|
321 | + ->findByThisFieldDoesNotExist('testvalue'); |
|
322 | 322 | } |
323 | 323 | |
324 | 324 | /** |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | $this->expectException(TransactionRequiredException::class); |
331 | 331 | |
332 | 332 | $this->em->getRepository(CmsUser::class) |
333 | - ->find(1, LockMode::PESSIMISTIC_READ); |
|
333 | + ->find(1, LockMode::PESSIMISTIC_READ); |
|
334 | 334 | } |
335 | 335 | |
336 | 336 | /** |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | $this->expectException(TransactionRequiredException::class); |
343 | 343 | |
344 | 344 | $this->em->getRepository(CmsUser::class) |
345 | - ->find(1, LockMode::PESSIMISTIC_WRITE); |
|
345 | + ->find(1, LockMode::PESSIMISTIC_WRITE); |
|
346 | 346 | } |
347 | 347 | |
348 | 348 | /** |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | $this->expectException(OptimisticLockException::class); |
355 | 355 | |
356 | 356 | $this->em->getRepository(CmsUser::class) |
357 | - ->find(1, LockMode::OPTIMISTIC); |
|
357 | + ->find(1, LockMode::OPTIMISTIC); |
|
358 | 358 | } |
359 | 359 | |
360 | 360 | /** |
@@ -435,13 +435,13 @@ discard block |
||
435 | 435 | */ |
436 | 436 | public function testFindOneByOrderBy() |
437 | 437 | { |
438 | - $this->loadFixture(); |
|
438 | + $this->loadFixture(); |
|
439 | 439 | |
440 | - $repos = $this->em->getRepository(CmsUser::class); |
|
441 | - $userAsc = $repos->findOneBy([], ["username" => "ASC"]); |
|
442 | - $userDesc = $repos->findOneBy([], ["username" => "DESC"]); |
|
440 | + $repos = $this->em->getRepository(CmsUser::class); |
|
441 | + $userAsc = $repos->findOneBy([], ["username" => "ASC"]); |
|
442 | + $userDesc = $repos->findOneBy([], ["username" => "DESC"]); |
|
443 | 443 | |
444 | - self::assertNotSame($userAsc, $userDesc); |
|
444 | + self::assertNotSame($userAsc, $userDesc); |
|
445 | 445 | } |
446 | 446 | |
447 | 447 | /** |
@@ -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 | |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | $repos = $this->em->getRepository(CmsUser::class); |
183 | 183 | |
184 | 184 | $user = $repos->find($user1Id); |
185 | - self::assertInstanceOf(CmsUser::class,$user); |
|
185 | + self::assertInstanceOf(CmsUser::class, $user); |
|
186 | 186 | self::assertEquals('Roman', $user->name); |
187 | 187 | self::assertEquals('freak', $user->status); |
188 | 188 | } |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | |
195 | 195 | $users = $repos->findBy(['status' => 'dev']); |
196 | 196 | self::assertCount(2, $users); |
197 | - self::assertInstanceOf(CmsUser::class,$users[0]); |
|
197 | + self::assertInstanceOf(CmsUser::class, $users[0]); |
|
198 | 198 | self::assertEquals('Guilherme', $users[0]->name); |
199 | 199 | self::assertEquals('dev', $users[0]->status); |
200 | 200 | } |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | $addresses = $repository->findBy(['user' => [$user1->getId(), $user2->getId()]]); |
221 | 221 | |
222 | 222 | self::assertCount(2, $addresses); |
223 | - self::assertInstanceOf(CmsAddress::class,$addresses[0]); |
|
223 | + self::assertInstanceOf(CmsAddress::class, $addresses[0]); |
|
224 | 224 | } |
225 | 225 | |
226 | 226 | public function testFindByAssociationWithObjectAsParameter() |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | $addresses = $repository->findBy(['user' => [$user1, $user2]]); |
245 | 245 | |
246 | 246 | self::assertCount(2, $addresses); |
247 | - self::assertInstanceOf(CmsAddress::class,$addresses[0]); |
|
247 | + self::assertInstanceOf(CmsAddress::class, $addresses[0]); |
|
248 | 248 | } |
249 | 249 | |
250 | 250 | public function testFindFieldByMagicCall() |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | |
255 | 255 | $users = $repos->findByStatus('dev'); |
256 | 256 | self::assertCount(2, $users); |
257 | - self::assertInstanceOf(CmsUser::class,$users[0]); |
|
257 | + self::assertInstanceOf(CmsUser::class, $users[0]); |
|
258 | 258 | self::assertEquals('Guilherme', $users[0]->name); |
259 | 259 | self::assertEquals('dev', $users[0]->status); |
260 | 260 | } |
@@ -594,7 +594,7 @@ discard block |
||
594 | 594 | self::assertCount(2, $usersAsc); |
595 | 595 | self::assertCount(2, $usersDesc); |
596 | 596 | |
597 | - self::assertInstanceOf(CmsUser::class,$usersAsc[0]); |
|
597 | + self::assertInstanceOf(CmsUser::class, $usersAsc[0]); |
|
598 | 598 | self::assertEquals('Alexander', $usersAsc[0]->name); |
599 | 599 | self::assertEquals('dev', $usersAsc[0]->status); |
600 | 600 | |
@@ -675,7 +675,7 @@ discard block |
||
675 | 675 | public function testCanRetrieveRepositoryFromClassNameWithLeadingBackslash() |
676 | 676 | { |
677 | 677 | self::assertSame( |
678 | - $this->em->getRepository('\\' . CmsUser::class), |
|
678 | + $this->em->getRepository('\\'.CmsUser::class), |
|
679 | 679 | $this->em->getRepository(CmsUser::class) |
680 | 680 | ); |
681 | 681 | } |
@@ -713,7 +713,7 @@ discard block |
||
713 | 713 | $data = $repo->findBy(['user' => [1, 2, 3]]); |
714 | 714 | |
715 | 715 | $query = array_pop($this->sqlLoggerStack->queries); |
716 | - self::assertEquals([1,2,3], $query['params'][0]); |
|
716 | + self::assertEquals([1, 2, 3], $query['params'][0]); |
|
717 | 717 | self::assertEquals(Connection::PARAM_INT_ARRAY, $query['types'][0]); |
718 | 718 | } |
719 | 719 |