@@ -7,21 +7,21 @@ |
||
7 | 7 | error_reporting(E_ALL | E_STRICT); |
8 | 8 | date_default_timezone_set('UTC'); |
9 | 9 | |
10 | -if (file_exists(__DIR__ . '/../../../vendor/autoload.php')) { |
|
10 | +if (file_exists(__DIR__.'/../../../vendor/autoload.php')) { |
|
11 | 11 | // dependencies were installed via composer - this is the main project |
12 | - require __DIR__ . '/../../../vendor/autoload.php'; |
|
13 | -} elseif (file_exists(__DIR__ . '/../../../../../autoload.php')) { |
|
12 | + require __DIR__.'/../../../vendor/autoload.php'; |
|
13 | +} elseif (file_exists(__DIR__.'/../../../../../autoload.php')) { |
|
14 | 14 | // installed as a dependency in `vendor` |
15 | - require __DIR__ . '/../../../../../autoload.php'; |
|
15 | + require __DIR__.'/../../../../../autoload.php'; |
|
16 | 16 | } else { |
17 | 17 | throw new \Exception('Can\'t find autoload.php. Did you install dependencies via composer?'); |
18 | 18 | } |
19 | 19 | |
20 | -if ( ! file_exists(__DIR__ . '/Proxies') && ! mkdir(__DIR__ . '/Proxies')) { |
|
21 | - throw new \Exception("Could not create " . __DIR__."/Proxies Folder."); |
|
20 | +if ( ! file_exists(__DIR__.'/Proxies') && ! mkdir(__DIR__.'/Proxies')) { |
|
21 | + throw new \Exception("Could not create ".__DIR__."/Proxies Folder."); |
|
22 | 22 | } |
23 | 23 | |
24 | -if ( ! file_exists(__DIR__ . '/ORM/Proxy/generated') && ! mkdir(__DIR__ . '/ORM/Proxy/generated')) { |
|
25 | - throw new \Exception('Could not create ' . __DIR__ . '/ORM/Proxy/generated Folder.'); |
|
24 | +if ( ! file_exists(__DIR__.'/ORM/Proxy/generated') && ! mkdir(__DIR__.'/ORM/Proxy/generated')) { |
|
25 | + throw new \Exception('Could not create '.__DIR__.'/ORM/Proxy/generated Folder.'); |
|
26 | 26 | } |
27 | 27 |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | } |
97 | 97 | } |
98 | 98 | |
99 | - Annotations\AnnotationRegistry::registerFile(__DIR__ . "/../../../lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php"); |
|
99 | + Annotations\AnnotationRegistry::registerFile(__DIR__."/../../../lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php"); |
|
100 | 100 | |
101 | 101 | return new AnnotationDriver($reader, (array) $paths); |
102 | 102 | } |
@@ -127,11 +127,11 @@ discard block |
||
127 | 127 | $config->setMetadataCacheImpl($metadataCache); |
128 | 128 | $config->setMetadataDriverImpl($config->newDefaultAnnotationDriver([], true)); |
129 | 129 | $config->setQueryCacheImpl(self::getSharedQueryCacheImpl()); |
130 | - $config->setProxyDir(__DIR__ . '/Proxies'); |
|
130 | + $config->setProxyDir(__DIR__.'/Proxies'); |
|
131 | 131 | $config->setProxyNamespace('Doctrine\Tests\Proxies'); |
132 | 132 | $config->setMetadataDriverImpl($config->newDefaultAnnotationDriver( |
133 | 133 | [ |
134 | - realpath(__DIR__ . '/Models/Cache') |
|
134 | + realpath(__DIR__.'/Models/Cache') |
|
135 | 135 | ], true)); |
136 | 136 | |
137 | 137 | if ($this->isSecondLevelCacheEnabled) { |
@@ -46,7 +46,9 @@ |
||
46 | 46 | public function fetchColumn($columnNumber = 0) |
47 | 47 | { |
48 | 48 | $row = current($this->_resultSet); |
49 | - if ( ! is_array($row)) return false; |
|
49 | + if ( ! is_array($row)) { |
|
50 | + return false; |
|
51 | + } |
|
50 | 52 | $val = array_shift($row); |
51 | 53 | return $val !== null ? $val : false; |
52 | 54 | } |
@@ -95,7 +95,7 @@ |
||
95 | 95 | public function quote($input, $type = null) |
96 | 96 | { |
97 | 97 | if (is_string($input)) { |
98 | - return "'" . $input . "'"; |
|
98 | + return "'".$input."'"; |
|
99 | 99 | } |
100 | 100 | return $input; |
101 | 101 | } |
@@ -35,7 +35,7 @@ |
||
35 | 35 | /** |
36 | 36 | * {@inheritdoc} |
37 | 37 | */ |
38 | - public function errorInfo(){} |
|
38 | + public function errorInfo() {} |
|
39 | 39 | |
40 | 40 | /** |
41 | 41 | * {@inheritdoc} |
@@ -49,7 +49,7 @@ |
||
49 | 49 | /** |
50 | 50 | * {@inheritdoc} |
51 | 51 | */ |
52 | - public function quote($input, $type=\PDO::PARAM_STR) |
|
52 | + public function quote($input, $type = \PDO::PARAM_STR) |
|
53 | 53 | { |
54 | 54 | } |
55 | 55 |
@@ -70,7 +70,7 @@ |
||
70 | 70 | { |
71 | 71 | if (null === $config) { |
72 | 72 | $config = new Configuration(); |
73 | - $config->setProxyDir(__DIR__ . '/../Proxies'); |
|
73 | + $config->setProxyDir(__DIR__.'/../Proxies'); |
|
74 | 74 | $config->setProxyNamespace('Doctrine\Tests\Proxies'); |
75 | 75 | $config->setMetadataDriverImpl($config->newDefaultAnnotationDriver([], true)); |
76 | 76 | } |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | $this->_em->flush(); |
174 | 174 | $this->_em->detach($user); |
175 | 175 | |
176 | - $dql = 'SELECT u FROM ' . CmsUser::class . ' u WHERE u.id = ?1'; |
|
176 | + $dql = 'SELECT u FROM '.CmsUser::class.' u WHERE u.id = ?1'; |
|
177 | 177 | $query = $this->_em->createQuery($dql); |
178 | 178 | $query->setParameter(1, $user); |
179 | 179 | |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | |
217 | 217 | $this->_em->detach($article); |
218 | 218 | |
219 | - $sql = 'UPDATE cms_articles SET version = version + 1 WHERE id = ' . $article->id; |
|
219 | + $sql = 'UPDATE cms_articles SET version = version + 1 WHERE id = '.$article->id; |
|
220 | 220 | $this->_em->getConnection()->executeUpdate($sql); |
221 | 221 | |
222 | 222 | $this->expectException(OptimisticLockException::class); |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | */ |
309 | 309 | public function testExceptionIsThrownWhenCallingFindByWithoutParameter() { |
310 | 310 | $this->_em->getRepository(CmsUser::class) |
311 | - ->findByStatus(); |
|
311 | + ->findByStatus(); |
|
312 | 312 | } |
313 | 313 | |
314 | 314 | /** |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | */ |
317 | 317 | public function testExceptionIsThrownWhenUsingInvalidFieldName() { |
318 | 318 | $this->_em->getRepository(CmsUser::class) |
319 | - ->findByThisFieldDoesNotExist('testvalue'); |
|
319 | + ->findByThisFieldDoesNotExist('testvalue'); |
|
320 | 320 | } |
321 | 321 | |
322 | 322 | /** |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | $this->expectException(TransactionRequiredException::class); |
329 | 329 | |
330 | 330 | $this->_em->getRepository(CmsUser::class) |
331 | - ->find(1, LockMode::PESSIMISTIC_READ); |
|
331 | + ->find(1, LockMode::PESSIMISTIC_READ); |
|
332 | 332 | } |
333 | 333 | |
334 | 334 | /** |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | $this->expectException(TransactionRequiredException::class); |
341 | 341 | |
342 | 342 | $this->_em->getRepository(CmsUser::class) |
343 | - ->find(1, LockMode::PESSIMISTIC_WRITE); |
|
343 | + ->find(1, LockMode::PESSIMISTIC_WRITE); |
|
344 | 344 | } |
345 | 345 | |
346 | 346 | /** |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | $this->expectException(OptimisticLockException::class); |
353 | 353 | |
354 | 354 | $this->_em->getRepository(CmsUser::class) |
355 | - ->find(1, LockMode::OPTIMISTIC); |
|
355 | + ->find(1, LockMode::OPTIMISTIC); |
|
356 | 356 | } |
357 | 357 | |
358 | 358 | /** |
@@ -433,13 +433,13 @@ discard block |
||
433 | 433 | */ |
434 | 434 | public function testFindOneByOrderBy() |
435 | 435 | { |
436 | - $this->loadFixture(); |
|
436 | + $this->loadFixture(); |
|
437 | 437 | |
438 | - $repos = $this->_em->getRepository(CmsUser::class); |
|
439 | - $userAsc = $repos->findOneBy([], ["username" => "ASC"]); |
|
440 | - $userDesc = $repos->findOneBy([], ["username" => "DESC"]); |
|
438 | + $repos = $this->_em->getRepository(CmsUser::class); |
|
439 | + $userAsc = $repos->findOneBy([], ["username" => "ASC"]); |
|
440 | + $userDesc = $repos->findOneBy([], ["username" => "DESC"]); |
|
441 | 441 | |
442 | - $this->assertNotSame($userAsc, $userDesc); |
|
442 | + $this->assertNotSame($userAsc, $userDesc); |
|
443 | 443 | } |
444 | 444 | |
445 | 445 | /** |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | $repos = $this->_em->getRepository(CmsUser::class); |
181 | 181 | |
182 | 182 | $user = $repos->find($user1Id); |
183 | - $this->assertInstanceOf(CmsUser::class,$user); |
|
183 | + $this->assertInstanceOf(CmsUser::class, $user); |
|
184 | 184 | $this->assertEquals('Roman', $user->name); |
185 | 185 | $this->assertEquals('freak', $user->status); |
186 | 186 | } |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | |
193 | 193 | $users = $repos->findBy(['status' => 'dev']); |
194 | 194 | $this->assertEquals(2, count($users)); |
195 | - $this->assertInstanceOf(CmsUser::class,$users[0]); |
|
195 | + $this->assertInstanceOf(CmsUser::class, $users[0]); |
|
196 | 196 | $this->assertEquals('Guilherme', $users[0]->name); |
197 | 197 | $this->assertEquals('dev', $users[0]->status); |
198 | 198 | } |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | $addresses = $repository->findBy(['user' => [$user1->getId(), $user2->getId()]]); |
219 | 219 | |
220 | 220 | $this->assertEquals(2, count($addresses)); |
221 | - $this->assertInstanceOf(CmsAddress::class,$addresses[0]); |
|
221 | + $this->assertInstanceOf(CmsAddress::class, $addresses[0]); |
|
222 | 222 | } |
223 | 223 | |
224 | 224 | public function testFindByAssociationWithObjectAsParameter() |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | $addresses = $repository->findBy(['user' => [$user1, $user2]]); |
243 | 243 | |
244 | 244 | $this->assertEquals(2, count($addresses)); |
245 | - $this->assertInstanceOf(CmsAddress::class,$addresses[0]); |
|
245 | + $this->assertInstanceOf(CmsAddress::class, $addresses[0]); |
|
246 | 246 | } |
247 | 247 | |
248 | 248 | public function testFindFieldByMagicCall() |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | |
253 | 253 | $users = $repos->findByStatus('dev'); |
254 | 254 | $this->assertEquals(2, count($users)); |
255 | - $this->assertInstanceOf(CmsUser::class,$users[0]); |
|
255 | + $this->assertInstanceOf(CmsUser::class, $users[0]); |
|
256 | 256 | $this->assertEquals('Guilherme', $users[0]->name); |
257 | 257 | $this->assertEquals('dev', $users[0]->status); |
258 | 258 | } |
@@ -592,7 +592,7 @@ discard block |
||
592 | 592 | $this->assertEquals(2, count($usersAsc)); |
593 | 593 | $this->assertEquals(2, count($usersDesc)); |
594 | 594 | |
595 | - $this->assertInstanceOf(CmsUser::class,$usersAsc[0]); |
|
595 | + $this->assertInstanceOf(CmsUser::class, $usersAsc[0]); |
|
596 | 596 | $this->assertEquals('Alexander', $usersAsc[0]->name); |
597 | 597 | $this->assertEquals('dev', $usersAsc[0]->status); |
598 | 598 | |
@@ -673,7 +673,7 @@ discard block |
||
673 | 673 | public function testCanRetrieveRepositoryFromClassNameWithLeadingBackslash() |
674 | 674 | { |
675 | 675 | $this->assertSame( |
676 | - $this->_em->getRepository('\\' . CmsUser::class), |
|
676 | + $this->_em->getRepository('\\'.CmsUser::class), |
|
677 | 677 | $this->_em->getRepository(CmsUser::class) |
678 | 678 | ); |
679 | 679 | } |
@@ -711,7 +711,7 @@ discard block |
||
711 | 711 | $data = $repo->findBy(['user' => [1, 2, 3]]); |
712 | 712 | |
713 | 713 | $query = array_pop($this->_sqlLoggerStack->queries); |
714 | - $this->assertEquals([1,2,3], $query['params'][0]); |
|
714 | + $this->assertEquals([1, 2, 3], $query['params'][0]); |
|
715 | 715 | $this->assertEquals(Connection::PARAM_INT_ARRAY, $query['types'][0]); |
716 | 716 | } |
717 | 717 |