@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | |
18 | 18 | protected function setUp() |
19 | 19 | { |
20 | - if (!class_exists('GearmanClient', false)) { |
|
20 | + if ( ! class_exists('GearmanClient', false)) { |
|
21 | 21 | $this->markTestSkipped('pecl/gearman is required for this test to run.'); |
22 | 22 | } |
23 | 23 | |
@@ -133,11 +133,11 @@ discard block |
||
133 | 133 | $this->gearman->runTasks(); |
134 | 134 | |
135 | 135 | $this->assertTrue($this->maxRunTime > $forTime, |
136 | - "Because of locking this tests should have run at least " . $forTime . " seconds, ". |
|
137 | - "but only did for " . $this->maxRunTime . " seconds."); |
|
136 | + "Because of locking this tests should have run at least ".$forTime." seconds, ". |
|
137 | + "but only did for ".$this->maxRunTime." seconds."); |
|
138 | 138 | $this->assertTrue($this->maxRunTime < $notLongerThan, |
139 | - "The longest task should not run longer than " . $notLongerThan . " seconds, ". |
|
140 | - "but did for " . $this->maxRunTime . " seconds." |
|
139 | + "The longest task should not run longer than ".$notLongerThan." seconds, ". |
|
140 | + "but did for ".$this->maxRunTime." seconds." |
|
141 | 141 | ); |
142 | 142 | } |
143 | 143 |
@@ -206,7 +206,7 @@ |
||
206 | 206 | $this->expectExceptionMessage('The optimistic lock on an entity failed.'); |
207 | 207 | |
208 | 208 | $this->_em->createQuery($dql) |
209 | - ->setHint(Query::HINT_LOCK_MODE, LockMode::OPTIMISTIC) |
|
210 | - ->getSQL(); |
|
209 | + ->setHint(Query::HINT_LOCK_MODE, LockMode::OPTIMISTIC) |
|
210 | + ->getSQL(); |
|
211 | 211 | } |
212 | 212 | } |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $article = new CmsArticle(); |
88 | 88 | |
89 | 89 | $this->expectException(\InvalidArgumentException::class); |
90 | - $this->expectExceptionMessage('Entity ' . CmsArticle::class); |
|
90 | + $this->expectExceptionMessage('Entity '.CmsArticle::class); |
|
91 | 91 | |
92 | 92 | $this->_em->lock($article, LockMode::OPTIMISTIC, $article->version + 1); |
93 | 93 | } |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | { |
137 | 137 | $writeLockSql = $this->_em->getConnection()->getDatabasePlatform()->getWriteLockSQL(); |
138 | 138 | |
139 | - if (! $writeLockSql) { |
|
139 | + if ( ! $writeLockSql) { |
|
140 | 140 | $this->markTestSkipped('Database Driver has no Write Lock support.'); |
141 | 141 | } |
142 | 142 | |
@@ -156,8 +156,8 @@ discard block |
||
156 | 156 | throw $e; |
157 | 157 | } |
158 | 158 | |
159 | - $query = array_pop( $this->_sqlLoggerStack->queries ); |
|
160 | - $query = array_pop( $this->_sqlLoggerStack->queries ); |
|
159 | + $query = array_pop($this->_sqlLoggerStack->queries); |
|
160 | + $query = array_pop($this->_sqlLoggerStack->queries); |
|
161 | 161 | $this->assertContains($writeLockSql, $query['sql']); |
162 | 162 | } |
163 | 163 | |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | { |
169 | 169 | $readLockSql = $this->_em->getConnection()->getDatabasePlatform()->getReadLockSQL(); |
170 | 170 | |
171 | - if (! $readLockSql) { |
|
171 | + if ( ! $readLockSql) { |
|
172 | 172 | $this->markTestSkipped('Database Driver has no Write Lock support.'); |
173 | 173 | } |
174 | 174 | |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | */ |
201 | 201 | public function testLockOptimisticNonVersionedThrowsExceptionInDQL() |
202 | 202 | { |
203 | - $dql = "SELECT u FROM " . CmsUser::class . " u WHERE u.username = 'gblanco'"; |
|
203 | + $dql = "SELECT u FROM ".CmsUser::class." u WHERE u.username = 'gblanco'"; |
|
204 | 204 | |
205 | 205 | $this->expectException(OptimisticLockException::class); |
206 | 206 | $this->expectExceptionMessage('The optimistic lock on an entity failed.'); |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | $test = new OptimisticStandard(); |
116 | 116 | |
117 | 117 | for ($i = 0; $i < 5; $i++) { |
118 | - $test->name = 'test' . $i; |
|
118 | + $test->name = 'test'.$i; |
|
119 | 119 | |
120 | 120 | $this->_em->persist($test); |
121 | 121 | $this->_em->flush(); |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | $caughtException = null; |
250 | 250 | |
251 | 251 | try { |
252 | - $expectedVersionExpired = DateTime::createFromFormat('U', $test->version->getTimestamp()-3600); |
|
252 | + $expectedVersionExpired = DateTime::createFromFormat('U', $test->version->getTimestamp() - 3600); |
|
253 | 253 | |
254 | 254 | $this->_em->lock($test, LockMode::OPTIMISTIC, $expectedVersionExpired); |
255 | 255 | } catch (OptimisticLockException $e) { |
@@ -232,7 +232,7 @@ |
||
232 | 232 | $entity = $this->_em->find(Travel::class, $entitiId); |
233 | 233 | |
234 | 234 | $this->assertEquals(0, $entity->getVisitedCities()->count()); |
235 | - $this->assertEquals($queryCount+2, $this->getCurrentQueryCount()); |
|
235 | + $this->assertEquals($queryCount + 2, $this->getCurrentQueryCount()); |
|
236 | 236 | |
237 | 237 | $this->_em->clear(); |
238 | 238 |
@@ -102,8 +102,8 @@ |
||
102 | 102 | $routeId = $this->createPersistedRouteWithLegs(); |
103 | 103 | |
104 | 104 | $route = $this->_em->createQuery("SELECT r, l FROM Doctrine\Tests\Models\Routing\RoutingRoute r JOIN r.legs l WHERE r.id = ?1") |
105 | - ->setParameter(1, $routeId) |
|
106 | - ->getSingleResult(); |
|
105 | + ->setParameter(1, $routeId) |
|
106 | + ->getSingleResult(); |
|
107 | 107 | |
108 | 108 | $this->assertEquals(2, count($route->legs)); |
109 | 109 | $this->assertEquals("Berlin", $route->legs[0]->fromLocation->getName()); |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | */ |
28 | 28 | public function testIssue2059() |
29 | 29 | { |
30 | - if (!$this->_em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { |
|
30 | + if ( ! $this->_em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { |
|
31 | 31 | $this->markTestSkipped('Platform does not support foreign keys.'); |
32 | 32 | } |
33 | 33 | |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | |
50 | 50 | public function testLoadMetadataFromDatabase() |
51 | 51 | { |
52 | - if (!$this->_em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { |
|
52 | + if ( ! $this->_em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { |
|
53 | 53 | $this->markTestSkipped('Platform does not support foreign keys.'); |
54 | 54 | } |
55 | 55 | |
@@ -65,22 +65,22 @@ discard block |
||
65 | 65 | $this->assertArrayHasKey('DbdriverFoo', $metadatas); |
66 | 66 | $metadata = $metadatas['DbdriverFoo']; |
67 | 67 | |
68 | - $this->assertArrayHasKey('id', $metadata->fieldMappings); |
|
69 | - $this->assertEquals('id', $metadata->fieldMappings['id']['fieldName']); |
|
70 | - $this->assertEquals('id', strtolower($metadata->fieldMappings['id']['columnName'])); |
|
71 | - $this->assertEquals('integer', (string)$metadata->fieldMappings['id']['type']); |
|
68 | + $this->assertArrayHasKey('id', $metadata->fieldMappings); |
|
69 | + $this->assertEquals('id', $metadata->fieldMappings['id']['fieldName']); |
|
70 | + $this->assertEquals('id', strtolower($metadata->fieldMappings['id']['columnName'])); |
|
71 | + $this->assertEquals('integer', (string) $metadata->fieldMappings['id']['type']); |
|
72 | 72 | |
73 | - $this->assertArrayHasKey('bar', $metadata->fieldMappings); |
|
74 | - $this->assertEquals('bar', $metadata->fieldMappings['bar']['fieldName']); |
|
75 | - $this->assertEquals('bar', strtolower($metadata->fieldMappings['bar']['columnName'])); |
|
76 | - $this->assertEquals('string', (string)$metadata->fieldMappings['bar']['type']); |
|
77 | - $this->assertEquals(200, $metadata->fieldMappings['bar']['length']); |
|
73 | + $this->assertArrayHasKey('bar', $metadata->fieldMappings); |
|
74 | + $this->assertEquals('bar', $metadata->fieldMappings['bar']['fieldName']); |
|
75 | + $this->assertEquals('bar', strtolower($metadata->fieldMappings['bar']['columnName'])); |
|
76 | + $this->assertEquals('string', (string) $metadata->fieldMappings['bar']['type']); |
|
77 | + $this->assertEquals(200, $metadata->fieldMappings['bar']['length']); |
|
78 | 78 | $this->assertTrue($metadata->fieldMappings['bar']['nullable']); |
79 | 79 | } |
80 | 80 | |
81 | 81 | public function testLoadMetadataWithForeignKeyFromDatabase() |
82 | 82 | { |
83 | - if (!$this->_em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { |
|
83 | + if ( ! $this->_em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { |
|
84 | 84 | $this->markTestSkipped('Platform does not support foreign keys.'); |
85 | 85 | } |
86 | 86 | |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | |
115 | 115 | public function testDetectManyToManyTables() |
116 | 116 | { |
117 | - if (!$this->_em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { |
|
117 | + if ( ! $this->_em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { |
|
118 | 118 | $this->markTestSkipped('Platform does not support foreign keys.'); |
119 | 119 | } |
120 | 120 | |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | |
170 | 170 | $table->addColumn('column_index1', 'string'); |
171 | 171 | $table->addColumn('column_index2', 'string'); |
172 | - $table->addIndex(['column_index1','column_index2'], 'index1'); |
|
172 | + $table->addIndex(['column_index1', 'column_index2'], 'index1'); |
|
173 | 173 | |
174 | 174 | $table->addColumn('column_unique_index1', 'string'); |
175 | 175 | $table->addColumn('column_unique_index2', 'string'); |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | |
209 | 209 | $this->assertTrue( ! empty($metadata->table['indexes']['index1']['columns'])); |
210 | 210 | $this->assertEquals( |
211 | - ['column_index1','column_index2'], |
|
211 | + ['column_index1', 'column_index2'], |
|
212 | 212 | $metadata->table['indexes']['index1']['columns'] |
213 | 213 | ); |
214 | 214 |
@@ -103,7 +103,7 @@ |
||
103 | 103 | public function testCreateQueryBuilderAliasValid() |
104 | 104 | { |
105 | 105 | $q = $this->_em->createQueryBuilder() |
106 | - ->select('u')->from(CmsUser::class, 'u'); |
|
106 | + ->select('u')->from(CmsUser::class, 'u'); |
|
107 | 107 | $q2 = clone $q; |
108 | 108 | |
109 | 109 | $this->assertEquals('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u', $q->getQuery()->getDql()); |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | */ |
163 | 163 | public function testThrowsExceptionOnNonObjectValues($methodName) { |
164 | 164 | $this->expectException(ORMInvalidArgumentException::class); |
165 | - $this->expectExceptionMessage('EntityManager#' . $methodName . '() expects parameter 1 to be an entity object, NULL given.'); |
|
165 | + $this->expectExceptionMessage('EntityManager#'.$methodName.'() expects parameter 1 to be an entity object, NULL given.'); |
|
166 | 166 | |
167 | 167 | $this->_em->$methodName(null); |
168 | 168 | } |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | */ |
197 | 197 | public function testTransactionalAcceptsReturn() |
198 | 198 | { |
199 | - $return = $this->_em->transactional(function ($em) { |
|
199 | + $return = $this->_em->transactional(function($em) { |
|
200 | 200 | return 'foo'; |
201 | 201 | }); |
202 | 202 | |
@@ -238,8 +238,8 @@ discard block |
||
238 | 238 | public function testTransactionalReThrowsThrowables() |
239 | 239 | { |
240 | 240 | try { |
241 | - $this->_em->transactional(function () { |
|
242 | - (function (array $value) { |
|
241 | + $this->_em->transactional(function() { |
|
242 | + (function(array $value) { |
|
243 | 243 | // this only serves as an IIFE that throws a `TypeError` |
244 | 244 | })(null); |
245 | 245 | }); |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $methods = []; |
36 | 36 | |
37 | 37 | foreach ($class->getMethods() as $method) { |
38 | - if ($method->isConstructor() || $method->isStatic() || !$method->isPublic()) { |
|
38 | + if ($method->isConstructor() || $method->isStatic() || ! $method->isPublic()) { |
|
39 | 39 | continue; |
40 | 40 | } |
41 | 41 | |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | */ |
73 | 73 | public function testAllMethodCallsAreDelegatedToTheWrappedInstance($method, array $parameters) |
74 | 74 | { |
75 | - $return = !in_array($method, self::VOID_METHODS) ? 'INNER VALUE FROM ' . $method : null; |
|
75 | + $return = ! in_array($method, self::VOID_METHODS) ? 'INNER VALUE FROM '.$method : null; |
|
76 | 76 | |
77 | 77 | $this->wrapped->expects($this->once()) |
78 | 78 | ->method($method) |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $metadata, |
90 | 90 | Events::postLoad, |
91 | 91 | $entity, |
92 | - $this->callback(function (LifecycleEventArgs $args) use ($entityManager, $entity) { |
|
92 | + $this->callback(function(LifecycleEventArgs $args) use ($entityManager, $entity) { |
|
93 | 93 | return $entity === $args->getEntity() && $entityManager === $args->getObjectManager(); |
94 | 94 | }), |
95 | 95 | $listenersFlag |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | $this->logicalOr($metadata1, $metadata2), |
158 | 158 | Events::postLoad, |
159 | 159 | $this->logicalOr($entity1, $entity2), |
160 | - $this->callback(function (LifecycleEventArgs $args) use ($entityManager, $entity1, $entity2) { |
|
160 | + $this->callback(function(LifecycleEventArgs $args) use ($entityManager, $entity1, $entity2) { |
|
161 | 161 | return in_array($args->getEntity(), [$entity1, $entity2], true) |
162 | 162 | && $entityManager === $args->getObjectManager(); |
163 | 163 | }), |