Test Failed
Pull Request — develop (#6596)
by
unknown
62:09
created
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC832Test.php 2 patches
Doc Comments   +11 added lines patch added patch discarded remove patch
@@ -167,6 +167,9 @@  discard block
 block discarded – undo
167 167
      */
168 168
     public $version;
169 169
 
170
+    /**
171
+     * @param string $word
172
+     */
170 173
     public function __construct($word)
171 174
     {
172 175
         $this->word = $word;
@@ -196,6 +199,9 @@  discard block
 block discarded – undo
196 199
      */
197 200
     public $version;
198 201
 
202
+    /**
203
+     * @param string $name
204
+     */
199 205
     public function __construct($name)
200 206
     {
201 207
         $this->name = $name;
@@ -214,6 +220,11 @@  discard block
 block discarded – undo
214 220
     /** @ORM\Column(type="integer") */
215 221
     public $rgt;
216 222
 
223
+    /**
224
+     * @param string $name
225
+     * @param integer $lft
226
+     * @param integer $rgt
227
+     */
217 228
     public function __construct($name, $lft, $rgt)
218 229
     {
219 230
         $this->name = $name;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
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
 
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
                     $this->em->getClassMetadata(DDC832Like::class),
29 29
                 ]
30 30
             );
31
-        } catch(\Exception $e) {
31
+        } catch (\Exception $e) {
32 32
         }
33 33
     }
34 34
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/ValueObjectsTest.php 2 patches
Doc Comments   +11 added lines patch added patch discarded remove patch
@@ -353,6 +353,9 @@  discard block
 block discarded – undo
353 353
     /** @ORM\Embedded(class = "DDC93Timestamps") */
354 354
     public $timestamps;
355 355
 
356
+    /**
357
+     * @param string $name
358
+     */
356 359
     public function __construct($name = null, DDC93Address $address = null)
357 360
     {
358 361
         $this->name = $name;
@@ -415,6 +418,9 @@  discard block
 block discarded – undo
415 418
      */
416 419
     public $name;
417 420
 
421
+    /**
422
+     * @param string $name
423
+     */
418 424
     public function __construct($name = null)
419 425
     {
420 426
         $this->name = $name;
@@ -441,6 +447,11 @@  discard block
 block discarded – undo
441 447
     /** @ORM\Embedded(class = "DDC93Country") */
442 448
     public $country;
443 449
 
450
+    /**
451
+     * @param string $street
452
+     * @param string $zip
453
+     * @param string $city
454
+     */
444 455
     public function __construct($street = null, $zip = null, $city = null, DDC93Country $country = null)
445 456
     {
446 457
         $this->street = $street;
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
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
 
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
                 $this->em->getClassMetadata(DDC3027Dog::class),
33 33
                 ]
34 34
             );
35
-        } catch(\Exception $e) {
35
+        } catch (\Exception $e) {
36 36
         }
37 37
     }
38 38
 
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         self::assertEquals('United States of America', $person->address->country->name);
88 88
 
89 89
         // 4. check deleting works
90
-        $personId = $person->id;;
90
+        $personId = $person->id; ;
91 91
         $this->em->remove($person);
92 92
         $this->em->flush();
93 93
 
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
         $this->em->flush();
112 112
         $this->em->clear();
113 113
 
114
-        $dql = "SELECT p FROM " . __NAMESPACE__ . "\DDC93Person p";
114
+        $dql = "SELECT p FROM ".__NAMESPACE__."\DDC93Person p";
115 115
         $persons = $this->em->createQuery($dql)->getResult();
116 116
 
117 117
         self::assertCount(3, $persons);
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
             self::assertEquals('United States of America', $person->address->country->name);
125 125
         }
126 126
 
127
-        $dql = "SELECT p FROM " . __NAMESPACE__ . "\DDC93Person p";
127
+        $dql = "SELECT p FROM ".__NAMESPACE__."\DDC93Person p";
128 128
         $persons = $this->em->createQuery($dql)->getArrayResult();
129 129
 
130 130
         foreach ($persons as $person) {
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
         $this->em->flush();
150 150
 
151 151
         // SELECT
152
-        $selectDql = "SELECT p FROM " . __NAMESPACE__ ."\\DDC93Person p WHERE p.address.city = :city AND p.address.country.name = :country";
152
+        $selectDql = "SELECT p FROM ".__NAMESPACE__."\\DDC93Person p WHERE p.address.city = :city AND p.address.country.name = :country";
153 153
         $loadedPerson = $this->em->createQuery($selectDql)
154 154
             ->setParameter('city', 'Karlsruhe')
155 155
             ->setParameter('country', 'Germany')
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
         );
165 165
 
166 166
         // UPDATE
167
-        $updateDql = "UPDATE " . __NAMESPACE__ . "\\DDC93Person p SET p.address.street = :street, p.address.country.name = :country WHERE p.address.city = :city";
167
+        $updateDql = "UPDATE ".__NAMESPACE__."\\DDC93Person p SET p.address.street = :street, p.address.country.name = :country WHERE p.address.city = :city";
168 168
         $this->em->createQuery($updateDql)
169 169
             ->setParameter('street', 'Boo')
170 170
             ->setParameter('country', 'DE')
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
         self::assertEquals('DE', $person->address->country->name);
177 177
 
178 178
         // DELETE
179
-        $this->em->createQuery("DELETE " . __NAMESPACE__ . "\\DDC93Person p WHERE p.address.city = :city AND p.address.country.name = :country")
179
+        $this->em->createQuery("DELETE ".__NAMESPACE__."\\DDC93Person p WHERE p.address.city = :city AND p.address.country.name = :country")
180 180
             ->setParameter('city', 'Karlsruhe')
181 181
             ->setParameter('country', 'DE')
182 182
             ->execute();
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
         $this->em->clear();
194 194
 
195 195
         // Prove that the entity was persisted correctly.
196
-        $dql = "SELECT p FROM " . __NAMESPACE__ ."\\DDC93Person p WHERE p.name = :name";
196
+        $dql = "SELECT p FROM ".__NAMESPACE__."\\DDC93Person p WHERE p.name = :name";
197 197
 
198 198
         $person = $this->em->createQuery($dql)
199 199
             ->setParameter('name', 'Karl')
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
         // Clear the EM and prove that the embeddable can be the subject of a partial query.
208 208
         $this->em->clear();
209 209
 
210
-        $dql = "SELECT PARTIAL p.{id,address.city} FROM " . __NAMESPACE__ ."\\DDC93Person p WHERE p.name = :name";
210
+        $dql = "SELECT PARTIAL p.{id,address.city} FROM ".__NAMESPACE__."\\DDC93Person p WHERE p.name = :name";
211 211
 
212 212
         $person = $this->em->createQuery($dql)
213 213
             ->setParameter('name', 'Karl')
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
         // Clear the EM and prove that the embeddable can be the subject of a partial query regardless of attributes positions.
224 224
         $this->em->clear();
225 225
 
226
-        $dql = "SELECT PARTIAL p.{address.city, id} FROM " . __NAMESPACE__ ."\\DDC93Person p WHERE p.name = :name";
226
+        $dql = "SELECT PARTIAL p.{address.city, id} FROM ".__NAMESPACE__."\\DDC93Person p WHERE p.name = :name";
227 227
 
228 228
         $person = $this->em->createQuery($dql)
229 229
             ->setParameter('name', 'Karl')
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
         $this->expectException(QueryException::class);
243 243
         $this->expectExceptionMessage('no field or association named address.asdfasdf');
244 244
 
245
-        $this->em->createQuery("SELECT p FROM " . __NAMESPACE__ . "\\DDC93Person p WHERE p.address.asdfasdf IS NULL")
245
+        $this->em->createQuery("SELECT p FROM ".__NAMESPACE__."\\DDC93Person p WHERE p.address.asdfasdf IS NULL")
246 246
             ->execute();
247 247
     }
248 248
 
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
         $this->expectException(QueryException::class);
252 252
         $this->expectExceptionMessage("no mapped field named 'address.asdfasdf'");
253 253
 
254
-        $this->em->createQuery("SELECT PARTIAL p.{id,address.asdfasdf} FROM " . __NAMESPACE__ . "\\DDC93Person p")
254
+        $this->em->createQuery("SELECT PARTIAL p.{id,address.asdfasdf} FROM ".__NAMESPACE__."\\DDC93Person p")
255 255
             ->execute();
256 256
     }
257 257
 
@@ -313,15 +313,15 @@  discard block
 block discarded – undo
313 313
         $this->expectException(MappingException::class);
314 314
         $this->expectExceptionMessage(
315 315
             sprintf(
316
-                'Infinite nesting detected for embedded property %s::nested. ' .
316
+                'Infinite nesting detected for embedded property %s::nested. '.
317 317
                 'You cannot embed an embeddable from the same type inside an embeddable.',
318
-                __NAMESPACE__ . '\\' . $declaredEmbeddableClassName
318
+                __NAMESPACE__.'\\'.$declaredEmbeddableClassName
319 319
             )
320 320
         );
321 321
 
322 322
         $this->schemaTool->createSchema(
323 323
             [
324
-            $this->em->getClassMetadata(__NAMESPACE__ . '\\' . $embeddableClassName),
324
+            $this->em->getClassMetadata(__NAMESPACE__.'\\'.$embeddableClassName),
325 325
             ]
326 326
         );
327 327
     }
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Hydration/ObjectHydratorTest.php 3 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,6 @@
 block discarded – undo
5 5
 namespace Doctrine\Tests\ORM\Hydration;
6 6
 
7 7
 use Doctrine\DBAL\Types\Type;
8
-use Doctrine\ORM\Mapping\ClassMetadata;
9 8
 use Doctrine\ORM\Mapping\FetchMode;
10 9
 use Doctrine\ORM\PersistentCollection;
11 10
 use Doctrine\ORM\Proxy\ProxyFactory;
Please login to merge, or discard this patch.
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -1024,14 +1024,14 @@  discard block
 block discarded – undo
1024 1024
 
1025 1025
         // mocking the proxy factory
1026 1026
         $proxyFactory = $this->getMockBuilder(ProxyFactory::class)
1027
-                             ->setMethods(['getProxy'])
1028
-                             ->disableOriginalConstructor()
1029
-                             ->getMock();
1027
+                                ->setMethods(['getProxy'])
1028
+                                ->disableOriginalConstructor()
1029
+                                ->getMock();
1030 1030
 
1031 1031
         $proxyFactory->expects($this->once())
1032
-                     ->method('getProxy')
1033
-                     ->with($this->equalTo(ECommerceShipping::class), ['id' => 42])
1034
-                     ->will($this->returnValue($proxyInstance));
1032
+                        ->method('getProxy')
1033
+                        ->with($this->equalTo(ECommerceShipping::class), ['id' => 42])
1034
+                        ->will($this->returnValue($proxyInstance));
1035 1035
 
1036 1036
         $this->em->setProxyFactory($proxyFactory);
1037 1037
 
@@ -1073,14 +1073,14 @@  discard block
 block discarded – undo
1073 1073
 
1074 1074
         // mocking the proxy factory
1075 1075
         $proxyFactory = $this->getMockBuilder(ProxyFactory::class)
1076
-                             ->setMethods(['getProxy'])
1077
-                             ->disableOriginalConstructor()
1078
-                             ->getMock();
1076
+                                ->setMethods(['getProxy'])
1077
+                                ->disableOriginalConstructor()
1078
+                                ->getMock();
1079 1079
 
1080 1080
         $proxyFactory->expects($this->once())
1081
-                     ->method('getProxy')
1082
-                     ->with($this->equalTo(ECommerceShipping::class), ['id' => 42])
1083
-                     ->will($this->returnValue($proxyInstance));
1081
+                        ->method('getProxy')
1082
+                        ->with($this->equalTo(ECommerceShipping::class), ['id' => 42])
1083
+                        ->will($this->returnValue($proxyInstance));
1084 1084
 
1085 1085
         $this->em->setProxyFactory($proxyFactory);
1086 1086
 
@@ -1906,10 +1906,10 @@  discard block
 block discarded – undo
1906 1906
         $rsm->setDiscriminatorColumn('c', 'c_discr');
1907 1907
 
1908 1908
         $resultSet = [
1909
-              [
1910
-                  'c__id'   => '1',
1911
-                  'c_discr' => 'fix',
1912
-              ],
1909
+                [
1910
+                    'c__id'   => '1',
1911
+                    'c_discr' => 'fix',
1912
+                ],
1913 1913
         ];
1914 1914
 
1915 1915
         $stmt     = new HydratorMockStatement($resultSet);
@@ -1938,12 +1938,12 @@  discard block
 block discarded – undo
1938 1938
         $rsm->setDiscriminatorColumn('e', 'e_discr');
1939 1939
 
1940 1940
         $resultSet = [
1941
-              [
1942
-                  'c__id'   => '1',
1943
-                  'c_discr' => 'fix',
1944
-                  'e__id'   => '1',
1945
-                  'e__name' => 'Fabio B. Silva'
1946
-              ],
1941
+                [
1942
+                    'c__id'   => '1',
1943
+                    'c_discr' => 'fix',
1944
+                    'e__id'   => '1',
1945
+                    'e__name' => 'Fabio B. Silva'
1946
+                ],
1947 1947
         ];
1948 1948
 
1949 1949
         $stmt     = new HydratorMockStatement($resultSet);
@@ -1968,11 +1968,11 @@  discard block
 block discarded – undo
1968 1968
         $rsm->setDiscriminatorColumn('p', 'discr');
1969 1969
 
1970 1970
         $resultSet = [
1971
-              [
1972
-                  'p__id'   => '1',
1973
-                  'p__name' => 'Fabio B. Silva',
1974
-                  'discr'   => 'subworker'
1975
-              ],
1971
+                [
1972
+                    'p__id'   => '1',
1973
+                    'p__name' => 'Fabio B. Silva',
1974
+                    'discr'   => 'subworker'
1975
+                ],
1976 1976
         ];
1977 1977
 
1978 1978
         $stmt       = new HydratorMockStatement($resultSet);
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\Tests\ORM\Hydration;
6 6
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Mapping/ClassMetadataFactoryTest.php 3 patches
Doc Comments   +7 added lines, -1 removed lines patch added patch discarded remove patch
@@ -225,6 +225,9 @@  discard block
 block discarded – undo
225 225
         self::assertEquals([], $metadata);
226 226
     }
227 227
 
228
+    /**
229
+     * @param \PHPUnit_Framework_MockObject_MockObject $conn
230
+     */
228 231
     protected function createEntityManager($metadataDriver, $conn = null)
229 232
     {
230 233
         $driverMock = new DriverMock();
@@ -257,7 +260,6 @@  discard block
 block discarded – undo
257 260
     }
258 261
 
259 262
     /**
260
-     * @param string $class
261 263
      * @return ClassMetadata
262 264
      */
263 265
     protected function createValidClassMetadata()
@@ -498,6 +500,10 @@  discard block
 block discarded – undo
498 500
         return $this->mockMetadata[$className];
499 501
     }
500 502
 
503
+    /**
504
+     * @param string $className
505
+     * @param ClassMetadata $metadata
506
+     */
501 507
     public function setMetadataForClass($className, $metadata)
502 508
     {
503 509
         $this->mockMetadata[$className] = $metadata;
Please login to merge, or discard this patch.
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -129,13 +129,13 @@  discard block
 block discarded – undo
129 129
         $cmf = new ClassMetadataFactory();
130 130
         $driver = $this->createMock(MappingDriver::class);
131 131
         $driver->expects($this->at(0))
132
-               ->method('isTransient')
133
-               ->with($this->equalTo(CmsUser::class))
134
-               ->will($this->returnValue(true));
132
+                ->method('isTransient')
133
+                ->with($this->equalTo(CmsUser::class))
134
+                ->will($this->returnValue(true));
135 135
         $driver->expects($this->at(1))
136
-               ->method('isTransient')
137
-               ->with($this->equalTo(CmsArticle::class))
138
-               ->will($this->returnValue(false));
136
+                ->method('isTransient')
137
+                ->with($this->equalTo(CmsArticle::class))
138
+                ->will($this->returnValue(false));
139 139
 
140 140
         $em = $this->createEntityManager($driver);
141 141
 
@@ -151,13 +151,13 @@  discard block
 block discarded – undo
151 151
         $cmf = new ClassMetadataFactory();
152 152
         $driver = $this->createMock(MappingDriver::class);
153 153
         $driver->expects($this->at(0))
154
-               ->method('isTransient')
155
-               ->with($this->equalTo(CmsUser::class))
156
-               ->will($this->returnValue(true));
154
+                ->method('isTransient')
155
+                ->with($this->equalTo(CmsUser::class))
156
+                ->will($this->returnValue(true));
157 157
         $driver->expects($this->at(1))
158
-               ->method('isTransient')
159
-               ->with($this->equalTo(CmsArticle::class))
160
-               ->will($this->returnValue(false));
158
+                ->method('isTransient')
159
+                ->with($this->equalTo(CmsArticle::class))
160
+                ->will($this->returnValue(false));
161 161
 
162 162
         $em = $this->createEntityManager($driver);
163 163
         $em->getConfiguration()->addEntityNamespace('CMS', 'Doctrine\Tests\Models\CMS');
@@ -316,8 +316,8 @@  discard block
 block discarded – undo
316 316
     }
317 317
 
318 318
     /**
319
-    * @group DDC-1845
320
-    */
319
+     * @group DDC-1845
320
+     */
321 321
     public function testQuoteMetadata()
322 322
     {
323 323
         $cmf    = new ClassMetadataFactory();
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\Tests\ORM\Mapping;
6 6
 
@@ -113,15 +113,15 @@  discard block
 block discarded – undo
113 113
     {
114 114
         require_once __DIR__."/../../Models/Global/GlobalNamespaceModel.php";
115 115
 
116
-        $metadataDriver = $this->createAnnotationDriver([__DIR__ . '/../../Models/Global/']);
116
+        $metadataDriver = $this->createAnnotationDriver([__DIR__.'/../../Models/Global/']);
117 117
 
118 118
         $entityManager = $this->createEntityManager($metadataDriver);
119 119
 
120 120
         $mf = $entityManager->getMetadataFactory();
121 121
         $m1 = $mf->getMetadataFor(DoctrineGlobal_Article::class);
122 122
         $h1 = $mf->hasMetadataFor(DoctrineGlobal_Article::class);
123
-        $h2 = $mf->hasMetadataFor('\\' . DoctrineGlobal_Article::class);
124
-        $m2 = $mf->getMetadataFor('\\' . DoctrineGlobal_Article::class);
123
+        $h2 = $mf->hasMetadataFor('\\'.DoctrineGlobal_Article::class);
124
+        $m2 = $mf->getMetadataFor('\\'.DoctrineGlobal_Article::class);
125 125
 
126 126
         self::assertNotSame($m1, $m2);
127 127
         self::assertFalse($h2);
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
     public function testAddDefaultDiscriminatorMap()
177 177
     {
178 178
         $cmf = new ClassMetadataFactory();
179
-        $driver = $this->createAnnotationDriver([__DIR__ . '/../../Models/JoinedInheritanceType/']);
179
+        $driver = $this->createAnnotationDriver([__DIR__.'/../../Models/JoinedInheritanceType/']);
180 180
         $em = $this->createEntityManager($driver);
181 181
         $cmf->setEntityManager($em);
182 182
 
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
     {
217 217
         // DDC-3551
218 218
         $conn = $this->createMock(Connection::class);
219
-        $mockDriver    = new MetadataDriverMock();
219
+        $mockDriver = new MetadataDriverMock();
220 220
         $conn->expects($this->any())
221 221
             ->method('getEventManager')
222 222
             ->willReturn(new EventManager());
@@ -240,10 +240,10 @@  discard block
 block discarded – undo
240 240
         $driverMock = new DriverMock();
241 241
         $config = new Configuration();
242 242
 
243
-        $config->setProxyDir(__DIR__ . '/../../Proxies');
243
+        $config->setProxyDir(__DIR__.'/../../Proxies');
244 244
         $config->setProxyNamespace('Doctrine\Tests\Proxies');
245 245
 
246
-        if (!$conn) {
246
+        if ( ! $conn) {
247 247
             $conn = new ConnectionMock([], $driverMock, $config, new EventManager());
248 248
         }
249 249
         $eventManager = $conn->getEventManager();
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
     public function testQuoteMetadata()
334 334
     {
335 335
         $cmf    = new ClassMetadataFactory();
336
-        $driver = $this->createAnnotationDriver([__DIR__ . '/../../Models/Quote/']);
336
+        $driver = $this->createAnnotationDriver([__DIR__.'/../../Models/Quote/']);
337 337
         $em     = $this->createEntityManager($driver);
338 338
         $cmf->setEntityManager($em);
339 339
 
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
         $listener
423 423
             ->expects($this->any())
424 424
             ->method('onClassMetadataNotFound')
425
-            ->will($this->returnCallback(function (OnClassMetadataNotFoundEventArgs $args) use ($metadata, $em, $test) {
425
+            ->will($this->returnCallback(function(OnClassMetadataNotFoundEventArgs $args) use ($metadata, $em, $test) {
426 426
                 $test->assertNull($args->getFoundMetadata());
427 427
                 $test->assertSame('Foo', $args->getClassName());
428 428
                 $test->assertSame($em, $args->getObjectManager());
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
     public function testInheritsIdGeneratorMappingFromEmbeddable()
485 485
     {
486 486
         $cmf = new ClassMetadataFactory();
487
-        $driver = $this->createAnnotationDriver([__DIR__ . '/../../Models/DDC4006/']);
487
+        $driver = $this->createAnnotationDriver([__DIR__.'/../../Models/DDC4006/']);
488 488
         $em = $this->createEntityManager($driver);
489 489
         $cmf->setEntityManager($em);
490 490
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Performance/SecondLevelCacheTest.php 2 patches
Doc Comments   +12 added lines patch added patch discarded remove patch
@@ -127,6 +127,9 @@  discard block
 block discarded – undo
127 127
         self::assertEquals(503, $this->countQuery($em));
128 128
     }
129 129
 
130
+    /**
131
+     * @param string $label
132
+     */
130 133
     private function queryEntity(EntityManagerInterface $em, $label)
131 134
     {
132 135
         $times        = 100;
@@ -158,6 +161,9 @@  discard block
 block discarded – undo
158 161
         printf("\n%s\n", str_repeat('-', 50));
159 162
     }
160 163
 
164
+    /**
165
+     * @param string $label
166
+     */
161 167
     public function findEntityOneToMany(EntityManagerInterface $em, $label)
162 168
     {
163 169
         $times        = 50;
@@ -217,6 +223,9 @@  discard block
 block discarded – undo
217 223
         printf("\n%s\n", str_repeat('-', 50));
218 224
     }
219 225
 
226
+    /**
227
+     * @param string $label
228
+     */
220 229
     private function findEntity(EntityManagerInterface $em, $label)
221 230
     {
222 231
         $times        = 10;
@@ -252,6 +261,9 @@  discard block
 block discarded – undo
252 261
         printf("\n%s\n", str_repeat('-', 50));
253 262
     }
254 263
 
264
+    /**
265
+     * @param string $label
266
+     */
255 267
     private function findAllEntity(EntityManagerInterface $em, $label)
256 268
     {
257 269
         $times        = 100;
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\Tests\ORM\Performance;
6 6
 
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
         $size         = 500;
134 134
         $startPersist = microtime(true);
135 135
 
136
-        echo PHP_EOL . $label;
136
+        echo PHP_EOL.$label;
137 137
 
138 138
         for ($i = 0; $i < $size; $i++) {
139 139
             $em->persist(new Country("Country $i"));
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
         $startPersist = microtime(true);
168 168
         $country      = new Country("Country");
169 169
 
170
-        echo PHP_EOL . $label;
170
+        echo PHP_EOL.$label;
171 171
 
172 172
         $em->persist($country);
173 173
         $em->flush();
@@ -197,9 +197,9 @@  discard block
 block discarded – undo
197 197
         $em->flush();
198 198
         $em->clear();
199 199
 
200
-        printf("\n[%s] persist %s states and %s cities", number_format( microtime(true) - $startPersist, 6), count($states), count($cities));
200
+        printf("\n[%s] persist %s states and %s cities", number_format(microtime(true) - $startPersist, 6), count($states), count($cities));
201 201
 
202
-        $startFind  = microtime(true);
202
+        $startFind = microtime(true);
203 203
 
204 204
         for ($i = 0; $i < $times; $i++) {
205 205
 
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
         $countries    = [];
225 225
         $startPersist = microtime(true);
226 226
 
227
-        echo PHP_EOL . $label;
227
+        echo PHP_EOL.$label;
228 228
 
229 229
         for ($i = 0; $i < $size; $i++) {
230 230
             $country = new Country("Country $i");
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 
240 240
         printf("\n[%s] persist %s countries", number_format(microtime(true) - $startPersist, 6), $size);
241 241
 
242
-        $startFind  = microtime(true);
242
+        $startFind = microtime(true);
243 243
 
244 244
         for ($i = 0; $i <= $times; $i++) {
245 245
             foreach ($countries as $country) {
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
         $startPersist = microtime(true);
260 260
         $rep          = $em->getRepository(Country::class);
261 261
 
262
-        echo PHP_EOL . $label;
262
+        echo PHP_EOL.$label;
263 263
 
264 264
         for ($i = 0; $i < $size; $i++) {
265 265
             $em->persist(new Country("Country $i"));
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 
271 271
         printf("\n[%s] persist %s countries", number_format(microtime(true) - $startPersist, 6), $size);
272 272
 
273
-        $startFind  = microtime(true);
273
+        $startFind = microtime(true);
274 274
 
275 275
         for ($i = 0; $i <= $times; $i++) {
276 276
             $list = $rep->findAll();
Please login to merge, or discard this patch.
Doctrine/Tests/ORM/Persisters/BasicEntityPersisterTypeValueSqlTest.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,6 @@
 block discarded – undo
10 10
 use Doctrine\ORM\Mapping\OneToOneAssociationMetadata;
11 11
 use Doctrine\ORM\Persisters\Entity\BasicEntityPersister;
12 12
 use Doctrine\Tests\Models\CustomType\CustomTypeChild;
13
-use Doctrine\Tests\Models\CustomType\CustomTypeFriend;
14 13
 use Doctrine\Tests\Models\CustomType\CustomTypeParent;
15 14
 use Doctrine\Tests\Models\Generic\NonAlphaColumnsEntity;
16 15
 use Doctrine\Tests\OrmTestCase;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\Tests\ORM\Persisters;
6 6
 
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
         $method = new \ReflectionMethod($this->persister, 'getSelectConditionSQL');
94 94
         $method->setAccessible(true);
95 95
 
96
-        $sql = $method->invoke($this->persister,  ['customInteger' => 1, 'child' => 1]);
96
+        $sql = $method->invoke($this->persister, ['customInteger' => 1, 'child' => 1]);
97 97
 
98 98
         self::assertEquals('t0."customInteger" = ABS(?) AND t0."child_id" = ?', $sql);
99 99
     }
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Query/CustomTreeWalkersJoinTest.php 3 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -25,6 +25,10 @@
 block discarded – undo
25 25
         $this->em = $this->getTestEntityManager();
26 26
     }
27 27
 
28
+    /**
29
+     * @param string $dqlToBeTested
30
+     * @param string $sqlToBeConfirmed
31
+     */
28 32
     public function assertSqlGeneration($dqlToBeTested, $sqlToBeConfirmed)
29 33
     {
30 34
         try {
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
         try {
31 31
             $query = $this->em->createQuery($dqlToBeTested);
32 32
             $query->setHint(Query::HINT_CUSTOM_TREE_WALKERS, [CustomTreeWalkerJoin::class])
33
-                  ->useQueryCache(false);
33
+                    ->useQueryCache(false);
34 34
 
35 35
             $sqlGenerated = $query->getSql();
36 36
 
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\Tests\ORM\Query;
6 6
 
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 
37 37
             $query->free();
38 38
         } catch (\Exception $e) {
39
-            $this->fail($e->getMessage() . ' at "' . $e->getFile() . '" on line ' . $e->getLine());
39
+            $this->fail($e->getMessage().' at "'.$e->getFile().'" on line '.$e->getLine());
40 40
         }
41 41
 
42 42
         self::assertEquals($sqlToBeConfirmed, $sqlGenerated);
@@ -78,9 +78,9 @@  discard block
 block discarded – undo
78 78
     {
79 79
         $rangeVariableDecl       = $identificationVariableDecl->rangeVariableDeclaration;
80 80
         $joinAssocPathExpression = new Query\AST\JoinAssociationPathExpression($rangeVariableDecl->aliasIdentificationVariable, 'address');
81
-        $joinAssocDeclaration    = new Query\AST\JoinAssociationDeclaration($joinAssocPathExpression, $rangeVariableDecl->aliasIdentificationVariable . 'a', null);
81
+        $joinAssocDeclaration    = new Query\AST\JoinAssociationDeclaration($joinAssocPathExpression, $rangeVariableDecl->aliasIdentificationVariable.'a', null);
82 82
         $join                    = new Query\AST\Join(Query\AST\Join::JOIN_TYPE_LEFT, $joinAssocDeclaration);
83
-        $selectExpression        = new Query\AST\SelectExpression($rangeVariableDecl->aliasIdentificationVariable . 'a', null, false);
83
+        $selectExpression        = new Query\AST\SelectExpression($rangeVariableDecl->aliasIdentificationVariable.'a', null, false);
84 84
 
85 85
         $identificationVariableDecl->joins[]                = $join;
86 86
         $selectStatement->selectClause->selectExpressions[] = $selectExpression;
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
         $userMetadata    = $entityManager->getClassMetadata(CmsUser::class);
90 90
         $addressMetadata = $entityManager->getClassMetadata(CmsAddress::class);
91 91
 
92
-        $this->setQueryComponent($rangeVariableDecl->aliasIdentificationVariable . 'a',
92
+        $this->setQueryComponent($rangeVariableDecl->aliasIdentificationVariable.'a',
93 93
             [
94 94
                 'metadata'     => $addressMetadata,
95 95
                 'parent'       => $rangeVariableDecl->aliasIdentificationVariable,
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/QueryBuilderTest.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -37,6 +37,9 @@
 block discarded – undo
37 37
         $this->em = $this->getTestEntityManager();
38 38
     }
39 39
 
40
+    /**
41
+     * @param string $expectedDql
42
+     */
40 43
     protected function assertValidQueryBuilder(QueryBuilder $qb, $expectedDql)
41 44
     {
42 45
         $dql = $qb->getDQL();
Please login to merge, or discard this patch.
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -274,12 +274,12 @@  discard block
 block discarded – undo
274 274
     {
275 275
         $qb = $this->em->createQueryBuilder();
276 276
         $qb->select('u')
277
-           ->from(CmsUser::class, 'u')
278
-           ->where('u.id = :uid')
279
-           ->orWhere('u.id = :uid2')
280
-           ->andWhere('u.id = :uid3')
281
-           ->orWhere('u.name = :name1', 'u.name = :name2')
282
-           ->andWhere('u.name <> :noname');
277
+            ->from(CmsUser::class, 'u')
278
+            ->where('u.id = :uid')
279
+            ->orWhere('u.id = :uid2')
280
+            ->andWhere('u.id = :uid3')
281
+            ->orWhere('u.name = :name1', 'u.name = :name2')
282
+            ->andWhere('u.name <> :noname');
283 283
 
284 284
         self::assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE (((u.id = :uid OR u.id = :uid2) AND u.id = :uid3) OR u.name = :name1 OR u.name = :name2) AND u.name <> :noname');
285 285
     }
@@ -288,9 +288,9 @@  discard block
 block discarded – undo
288 288
     {
289 289
         $qb = $this->em->createQueryBuilder();
290 290
         $qb->select('u')
291
-           ->from(CmsUser::class, 'u')
292
-           ->where('u.id = :uid')
293
-           ->andWhere($qb->expr()->in('u.id', [1, 2, 3]));
291
+            ->from(CmsUser::class, 'u')
292
+            ->where('u.id = :uid')
293
+            ->andWhere($qb->expr()->in('u.id', [1, 2, 3]));
294 294
 
295 295
         self::assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :uid AND u.id IN(1, 2, 3)');
296 296
     }
@@ -299,9 +299,9 @@  discard block
 block discarded – undo
299 299
     {
300 300
         $qb = $this->em->createQueryBuilder();
301 301
         $qb->select('u')
302
-           ->from(CmsUser::class, 'u')
303
-           ->where('u.id = :uid')
304
-           ->orWhere($qb->expr()->in('u.id', [1, 2, 3]));
302
+            ->from(CmsUser::class, 'u')
303
+            ->where('u.id = :uid')
304
+            ->orWhere($qb->expr()->in('u.id', [1, 2, 3]));
305 305
 
306 306
         self::assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :uid OR u.id IN(1, 2, 3)');
307 307
     }
@@ -310,9 +310,9 @@  discard block
 block discarded – undo
310 310
     {
311 311
         $qb = $this->em->createQueryBuilder();
312 312
         $qb->select('u')
313
-           ->from(CmsUser::class, 'u')
314
-           ->where('u.id = :uid')
315
-           ->andWhere($qb->expr()->notIn('u.id', [1, 2, 3]));
313
+            ->from(CmsUser::class, 'u')
314
+            ->where('u.id = :uid')
315
+            ->andWhere($qb->expr()->notIn('u.id', [1, 2, 3]));
316 316
 
317 317
         self::assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :uid AND u.id NOT IN(1, 2, 3)');
318 318
     }
@@ -321,9 +321,9 @@  discard block
 block discarded – undo
321 321
     {
322 322
         $qb = $this->em->createQueryBuilder();
323 323
         $qb->select('u')
324
-           ->from(CmsUser::class, 'u')
325
-           ->where('u.id = :uid')
326
-           ->orWhere($qb->expr()->notIn('u.id', [1, 2, 3]));
324
+            ->from(CmsUser::class, 'u')
325
+            ->where('u.id = :uid')
326
+            ->orWhere($qb->expr()->notIn('u.id', [1, 2, 3]));
327 327
 
328 328
         self::assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :uid OR u.id NOT IN(1, 2, 3)');
329 329
     }
@@ -619,8 +619,8 @@  discard block
 block discarded – undo
619 619
     {
620 620
         $qb = $this->em->createQueryBuilder();
621 621
         $qb->select('u')
622
-           ->from(CmsUser::class, 'u')
623
-           ->where($qb->expr()->orX('u.username = :username', 'u.username = :username2'));
622
+            ->from(CmsUser::class, 'u')
623
+            ->where($qb->expr()->orX('u.username = :username', 'u.username = :username2'));
624 624
 
625 625
         $parameters = new ArrayCollection();
626 626
         $parameters->add(new Parameter('username', 'jwage'));
@@ -636,8 +636,8 @@  discard block
 block discarded – undo
636 636
     {
637 637
         $qb = $this->em->createQueryBuilder();
638 638
         $qb->select('u')
639
-           ->from(CmsUser::class, 'u')
640
-           ->where('u.id = :id');
639
+            ->from(CmsUser::class, 'u')
640
+            ->where('u.id = :id');
641 641
 
642 642
         $parameters = new ArrayCollection();
643 643
         $parameters->add(new Parameter('id', 1));
@@ -686,8 +686,8 @@  discard block
 block discarded – undo
686 686
     {
687 687
         $qb = $this->em->createQueryBuilder();
688 688
         $qb->select('u')
689
-           ->from(CmsUser::class, 'u')
690
-           ->orWhere('u.id = :uid', $qb->expr()->eq('u.id', ':uid2'));
689
+            ->from(CmsUser::class, 'u')
690
+            ->orWhere('u.id = :uid', $qb->expr()->eq('u.id', ':uid2'));
691 691
 
692 692
         self::assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :uid OR u.id = :uid2');
693 693
     }
@@ -700,8 +700,8 @@  discard block
 block discarded – undo
700 700
         $orExpr->add($qb->expr()->in('u.id', [1]));
701 701
 
702 702
         $qb->select('u')
703
-           ->from(CmsUser::class, 'u')
704
-           ->where($orExpr);
703
+            ->from(CmsUser::class, 'u')
704
+            ->where($orExpr);
705 705
 
706 706
         self::assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :uid3 OR u.id IN(1)');
707 707
     }
@@ -710,8 +710,8 @@  discard block
 block discarded – undo
710 710
     {
711 711
         $qb = $this->em->createQueryBuilder();
712 712
         $qb->select('u')
713
-           ->from(CmsUser::class, 'u')
714
-           ->where($qb->expr()->in('u.name', ['one', 'two', 'three']));
713
+            ->from(CmsUser::class, 'u')
714
+            ->where($qb->expr()->in('u.name', ['one', 'two', 'three']));
715 715
 
716 716
         self::assertValidQueryBuilder($qb, "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name IN('one', 'two', 'three')");
717 717
 
@@ -725,8 +725,8 @@  discard block
 block discarded – undo
725 725
         $qb = $this->em->createQueryBuilder();
726 726
         $expr = $this->em->getExpressionBuilder();
727 727
         $qb->select('u')
728
-           ->from(CmsUser::class, 'u')
729
-           ->where($expr->in('u.name', [$expr->literal('one'), $expr->literal('two'), $expr->literal('three')]));
728
+            ->from(CmsUser::class, 'u')
729
+            ->where($expr->in('u.name', [$expr->literal('one'), $expr->literal('two'), $expr->literal('three')]));
730 730
 
731 731
         self::assertValidQueryBuilder($qb, "SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.name IN('one', 'two', 'three')");
732 732
 
@@ -744,8 +744,8 @@  discard block
 block discarded – undo
744 744
 
745 745
         $qb = $this->em->createQueryBuilder();
746 746
         $qb->select('u')
747
-           ->from(CmsUser::class, 'u')
748
-           ->where($orExpr);
747
+            ->from(CmsUser::class, 'u')
748
+            ->where($orExpr);
749 749
 
750 750
         self::assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id = :uid3 OR NOT(u.id IN(1))');
751 751
     }
@@ -756,8 +756,8 @@  discard block
 block discarded – undo
756 756
         $expr = $this->em->getExpressionBuilder();
757 757
 
758 758
         $qb->select('u')
759
-           ->from(CmsUser::class, 'u')
760
-           ->where($expr->gt('u.id', $expr->all('select a.id from Doctrine\Tests\Models\CMS\CmsArticle a')));
759
+            ->from(CmsUser::class, 'u')
760
+            ->where($expr->gt('u.id', $expr->all('select a.id from Doctrine\Tests\Models\CMS\CmsArticle a')));
761 761
 
762 762
         self::assertValidQueryBuilder($qb, 'SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u WHERE u.id > ALL(select a.id from Doctrine\Tests\Models\CMS\CmsArticle a)');
763 763
 
@@ -1123,9 +1123,9 @@  discard block
 block discarded – undo
1123 1123
     public function testRebuildsFromParts()
1124 1124
     {
1125 1125
         $qb = $this->em->createQueryBuilder()
1126
-          ->select('u')
1127
-          ->from(CmsUser::class, 'u')
1128
-          ->join('u.article', 'a');
1126
+            ->select('u')
1127
+            ->from(CmsUser::class, 'u')
1128
+            ->join('u.article', 'a');
1129 1129
 
1130 1130
         $dqlParts = $qb->getDQLParts();
1131 1131
         $dql = $qb->getDQL();
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\Tests\ORM;
6 6
 
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
         $qb = $this->em->createQueryBuilder();
550 550
         $qb->select('u')
551 551
             ->from(CmsUser::class, 'u')
552
-            ->join('u.article','a');
552
+            ->join('u.article', 'a');
553 553
 
554 554
         $criteria = new Criteria();
555 555
         $criteria->orderBy(['a.field' => Criteria::DESC]);
@@ -826,7 +826,7 @@  discard block
 block discarded – undo
826 826
             ->from(CmsUser::class, 'u')
827 827
             ->where('u.username = ?1')->orderBy('u.username');
828 828
 
829
-        self::assertEquals('u.username = ?1', (string)$qb->getDQLPart('where'));
829
+        self::assertEquals('u.username = ?1', (string) $qb->getDQLPart('where'));
830 830
         self::assertEquals(1, count($qb->getDQLPart('orderBy')));
831 831
 
832 832
         $qb->resetDQLPart('where')->resetDQLPart('orderBy');
@@ -890,7 +890,7 @@  discard block
 block discarded – undo
890 890
     {
891 891
         $qb = $this->em->createQueryBuilder();
892 892
         $qb->select('alias1')->from(CmsUser::class, 'alias1');
893
-        $qb->join('alias1.articles','alias2');
893
+        $qb->join('alias1.articles', 'alias2');
894 894
 
895 895
         $criteria = new Criteria();
896 896
         $criteria->where($criteria->expr()->eq('field', 'value1'));
@@ -910,7 +910,7 @@  discard block
 block discarded – undo
910 910
     {
911 911
         $qb = $this->em->createQueryBuilder();
912 912
         $qb->select('alias1')->from(CmsUser::class, 'alias1');
913
-        $qb->join('alias1.articles','alias2');
913
+        $qb->join('alias1.articles', 'alias2');
914 914
 
915 915
         $criteria = new Criteria();
916 916
         $criteria->where($criteria->expr()->eq('alias1.field', 'value1'));
@@ -930,7 +930,7 @@  discard block
 block discarded – undo
930 930
     {
931 931
         $qb = $this->em->createQueryBuilder();
932 932
         $qb->select('alias1')->from(CmsUser::class, 'alias1');
933
-        $qb->join('alias1.articles','alias2');
933
+        $qb->join('alias1.articles', 'alias2');
934 934
 
935 935
         $criteria = new Criteria();
936 936
         $criteria->where($criteria->expr()->eq('alias1.field', 'value1'));
@@ -1046,7 +1046,7 @@  discard block
 block discarded – undo
1046 1046
     {
1047 1047
         $qb = $this->em->createQueryBuilder()
1048 1048
             ->add('select', 'u')
1049
-            ->add('from', CmsUser::class . ' u');
1049
+            ->add('from', CmsUser::class.' u');
1050 1050
 
1051 1051
         self::assertEquals('SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u', $qb->getDQL());
1052 1052
     }
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php 3 patches
Doc Comments   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -213,6 +213,7 @@  discard block
 block discarded – undo
213 213
     }
214 214
 
215 215
     /**
216
+     * @param string|false $columnPrefix
216 217
      * @return ClassMetadata
217 218
      */
218 219
     private function generateIsbnEmbeddableFixture(array $embeddedClasses = [], $columnPrefix = null)
@@ -1311,7 +1312,7 @@  discard block
 block discarded – undo
1311 1312
 
1312 1313
     /**
1313 1314
      * @param string $type
1314
-     * @param \ReflectionProperty $method
1315
+     * @param \ReflectionMethod $method
1315 1316
      */
1316 1317
     private function assertPhpDocParamType($type, \ReflectionMethod $method)
1317 1318
     {
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -677,7 +677,7 @@  discard block
 block discarded – undo
677 677
         $this->generator->writeEntityClass($metadata, $this->tmpDir);
678 678
 
679 679
         $filename = $this->tmpDir . DIRECTORY_SEPARATOR
680
-                  . $this->namespace . DIRECTORY_SEPARATOR . 'DDC1784Entity.php';
680
+                    . $this->namespace . DIRECTORY_SEPARATOR . 'DDC1784Entity.php';
681 681
 
682 682
         self::assertFileExists($filename);
683 683
 
@@ -761,9 +761,9 @@  discard block
 block discarded – undo
761 761
 
762 762
     }
763 763
 
764
-     /**
765
-     * @group DDC-2172
766
-     */
764
+        /**
765
+         * @group DDC-2172
766
+         */
767 767
     public function testGetInheritanceTypeString()
768 768
     {
769 769
         $reflection = new \ReflectionClass('\Doctrine\ORM\Mapping\ClassMetadata');
@@ -791,8 +791,8 @@  discard block
 block discarded – undo
791 791
     }
792 792
 
793 793
     /**
794
-    * @group DDC-2172
795
-    */
794
+     * @group DDC-2172
795
+     */
796 796
     public function testGetChangeTrackingPolicyString()
797 797
     {
798 798
         $reflection = new \ReflectionClass('\Doctrine\ORM\Mapping\ClassMetadata');
Please login to merge, or discard this patch.
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\Tests\ORM\Tools;
6 6
 
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         $this->namespace = uniqid("doctrine_", false);
40 40
         $this->tmpDir = sys_get_temp_dir();
41 41
 
42
-        mkdir($this->tmpDir . \DIRECTORY_SEPARATOR . $this->namespace);
42
+        mkdir($this->tmpDir.\DIRECTORY_SEPARATOR.$this->namespace);
43 43
 
44 44
         $this->generator = new EntityGenerator();
45 45
 
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
     public function tearDown()
54 54
     {
55
-        $ri = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->tmpDir . '/' . $this->namespace));
55
+        $ri = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->tmpDir.'/'.$this->namespace));
56 56
 
57 57
         foreach ($ri AS $file) {
58 58
             /* @var $file \SplFileInfo */
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
             }
62 62
         }
63 63
 
64
-        rmdir($this->tmpDir . '/' . $this->namespace);
64
+        rmdir($this->tmpDir.'/'.$this->namespace);
65 65
     }
66 66
 
67 67
     /**
@@ -71,9 +71,9 @@  discard block
 block discarded – undo
71 71
      */
72 72
     public function generateBookEntityFixture(array $embeddedClasses = [])
73 73
     {
74
-        $metadata = new ClassMetadata($this->namespace . '\EntityGeneratorBook', $this->metadataBuildingContext);
74
+        $metadata = new ClassMetadata($this->namespace.'\EntityGeneratorBook', $this->metadataBuildingContext);
75 75
 
76
-        $metadata->setCustomRepositoryClassName($this->namespace . '\EntityGeneratorBookRepository');
76
+        $metadata->setCustomRepositoryClassName($this->namespace.'\EntityGeneratorBookRepository');
77 77
 
78 78
         $tableMetadata = new Mapping\TableMetadata();
79 79
 
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 
193 193
     private function generateEntityTypeFixture(array $field)
194 194
     {
195
-        $metadata = new ClassMetadata($this->namespace . '\EntityType', $this->metadataBuildingContext);
195
+        $metadata = new ClassMetadata($this->namespace.'\EntityType', $this->metadataBuildingContext);
196 196
 
197 197
         $tableMetadata = new Mapping\TableMetadata();
198 198
         $tableMetadata->setName('entity_type');
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
      */
226 226
     private function generateIsbnEmbeddableFixture(array $embeddedClasses = [], $columnPrefix = null)
227 227
     {
228
-        $metadata = new ClassMetadata($this->namespace . '\EntityGeneratorIsbn', $this->metadataBuildingContext);
228
+        $metadata = new ClassMetadata($this->namespace.'\EntityGeneratorIsbn', $this->metadataBuildingContext);
229 229
         $metadata->isEmbeddedClass = true;
230 230
 
231 231
         $fieldMetadata = new Mapping\FieldMetadata('prefix');
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
      */
284 284
     private function generateTestEmbeddableFixture()
285 285
     {
286
-        $metadata = new ClassMetadata($this->namespace . '\EntityGeneratorTestEmbeddable', $this->metadataBuildingContext);
286
+        $metadata = new ClassMetadata($this->namespace.'\EntityGeneratorTestEmbeddable', $this->metadataBuildingContext);
287 287
 
288 288
         $metadata->isEmbeddedClass = true;
289 289
 
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
     private function loadEntityClass(ClassMetadata $metadata)
327 327
     {
328 328
         $className = basename(str_replace('\\', '/', $metadata->getClassName()));
329
-        $path      = $this->tmpDir . '/' . $this->namespace . '/' . $className . '.php';
329
+        $path      = $this->tmpDir.'/'.$this->namespace.'/'.$className.'.php';
330 330
 
331 331
         self::assertFileExists($path);
332 332
 
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
 
478 478
         $this->generator->writeEntityClass($metadata, $this->tmpDir);
479 479
 
480
-        self::assertFileExists($this->tmpDir . "/" . $this->namespace . "/EntityGeneratorBook.php~");
480
+        self::assertFileExists($this->tmpDir."/".$this->namespace."/EntityGeneratorBook.php~");
481 481
 
482 482
         $book = $this->newInstance($metadata);
483 483
         $reflClass = new \ReflectionClass($metadata->getClassName());
@@ -629,7 +629,7 @@  discard block
 block discarded – undo
629 629
      */
630 630
     public function testMappedSuperclassAnnotationGeneration()
631 631
     {
632
-        $metadata = new ClassMetadata($this->namespace . '\EntityGeneratorBook', $this->metadataBuildingContext);
632
+        $metadata = new ClassMetadata($this->namespace.'\EntityGeneratorBook', $this->metadataBuildingContext);
633 633
 
634 634
         $metadata->isMappedSuperclass = true;
635 635
 
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
      */
668 668
     public function testGenerateEntityWithSequenceGenerator()
669 669
     {
670
-        $metadata = new ClassMetadata($this->namespace . '\DDC1784Entity', $this->metadataBuildingContext);
670
+        $metadata = new ClassMetadata($this->namespace.'\DDC1784Entity', $this->metadataBuildingContext);
671 671
 
672 672
         $fieldMetadata = new Mapping\FieldMetadata('id');
673 673
         $fieldMetadata->setType(Type::getType('integer'));
@@ -684,8 +684,8 @@  discard block
 block discarded – undo
684 684
 
685 685
         $this->generator->writeEntityClass($metadata, $this->tmpDir);
686 686
 
687
-        $filename = $this->tmpDir . DIRECTORY_SEPARATOR
688
-                  . $this->namespace . DIRECTORY_SEPARATOR . 'DDC1784Entity.php';
687
+        $filename = $this->tmpDir.DIRECTORY_SEPARATOR
688
+                  . $this->namespace.DIRECTORY_SEPARATOR.'DDC1784Entity.php';
689 689
 
690 690
         self::assertFileExists($filename);
691 691
 
@@ -705,7 +705,7 @@  discard block
 block discarded – undo
705 705
      */
706 706
     public function testGenerateEntityWithMultipleInverseJoinColumns()
707 707
     {
708
-        $metadata = new ClassMetadata($this->namespace . '\DDC2079Entity', $this->metadataBuildingContext);
708
+        $metadata = new ClassMetadata($this->namespace.'\DDC2079Entity', $this->metadataBuildingContext);
709 709
 
710 710
         $fieldMetadata = new Mapping\FieldMetadata('id');
711 711
         $fieldMetadata->setType(Type::getType('integer'));
@@ -744,14 +744,14 @@  discard block
 block discarded – undo
744 744
         $association = new Mapping\ManyToManyAssociationMetadata('centroCustos');
745 745
 
746 746
         $association->setJoinTable($joinTable);
747
-        $association->setTargetEntity($this->namespace . '\\DDC2079CentroCusto');
747
+        $association->setTargetEntity($this->namespace.'\\DDC2079CentroCusto');
748 748
 
749 749
         $metadata->addProperty($association);
750 750
 
751 751
         $this->generator->writeEntityClass($metadata, $this->tmpDir);
752 752
 
753
-        $filename = $this->tmpDir . DIRECTORY_SEPARATOR
754
-            . $this->namespace . DIRECTORY_SEPARATOR . 'DDC2079Entity.php';
753
+        $filename = $this->tmpDir.DIRECTORY_SEPARATOR
754
+            . $this->namespace.DIRECTORY_SEPARATOR.'DDC2079Entity.php';
755 755
 
756 756
         self::assertFileExists($filename);
757 757
 
@@ -782,7 +782,7 @@  discard block
 block discarded – undo
782 782
         $method->setAccessible(true);
783 783
 
784 784
         foreach ($constants as $name => $value) {
785
-            if( ! preg_match($pattern, $name)) {
785
+            if ( ! preg_match($pattern, $name)) {
786 786
                 continue;
787 787
             }
788 788
 
@@ -811,7 +811,7 @@  discard block
 block discarded – undo
811 811
         $method->setAccessible(true);
812 812
 
813 813
         foreach ($constants as $name => $value) {
814
-            if( ! preg_match($pattern, $name)) {
814
+            if ( ! preg_match($pattern, $name)) {
815 815
                 continue;
816 816
             }
817 817
 
@@ -840,7 +840,7 @@  discard block
 block discarded – undo
840 840
         $method->setAccessible(true);
841 841
 
842 842
         foreach ($constants as $name => $value) {
843
-            if( ! preg_match($pattern, $name)) {
843
+            if ( ! preg_match($pattern, $name)) {
844 844
                 continue;
845 845
             }
846 846
 
@@ -864,7 +864,7 @@  discard block
 block discarded – undo
864 864
     public function testEntityTypeAlias(array $field)
865 865
     {
866 866
         $metadata   = $this->generateEntityTypeFixture($field);
867
-        $path       = $this->tmpDir . '/'. $this->namespace . '/EntityType.php';
867
+        $path       = $this->tmpDir.'/'.$this->namespace.'/EntityType.php';
868 868
 
869 869
         self::assertFileExists($path);
870 870
         require_once $path;
@@ -877,8 +877,8 @@  discard block
 block discarded – undo
877 877
         $type   = $field['phpType'];
878 878
         $name   = $field['fieldName'];
879 879
         $value  = $field['value'];
880
-        $getter = "get" . ucfirst($name);
881
-        $setter = "set" . ucfirst($name);
880
+        $getter = "get".ucfirst($name);
881
+        $setter = "set".ucfirst($name);
882 882
 
883 883
         self::assertPhpDocVarType($type, $reflClass->getProperty($name));
884 884
         self::assertPhpDocParamType($type, $reflClass->getMethod($setter));
@@ -901,13 +901,13 @@  discard block
 block discarded – undo
901 901
         $metadata = $cmf->getMetadataFor(get_class($user));
902 902
 
903 903
         // @todo guilhermeblanco Fix this test as changing Entity class should never be allowed.
904
-        $metadata->setClassName($this->namespace . "\DDC2372User");
904
+        $metadata->setClassName($this->namespace."\DDC2372User");
905 905
 
906 906
         $this->generator->writeEntityClass($metadata, $this->tmpDir);
907 907
 
908
-        self::assertFileExists($this->tmpDir . "/" . $this->namespace . "/DDC2372User.php");
908
+        self::assertFileExists($this->tmpDir."/".$this->namespace."/DDC2372User.php");
909 909
 
910
-        require $this->tmpDir . "/" . $this->namespace . "/DDC2372User.php";
910
+        require $this->tmpDir."/".$this->namespace."/DDC2372User.php";
911 911
 
912 912
         $reflClass = new \ReflectionClass($metadata->getClassName());
913 913
 
@@ -929,12 +929,12 @@  discard block
 block discarded – undo
929 929
         $metadata = $cmf->getMetadataFor(get_class($user));
930 930
 
931 931
         // @todo guilhermeblanco Fix this test as changing Entity class should never be allowed.
932
-        $metadata->setClassName($this->namespace . "\DDC2372Admin");
932
+        $metadata->setClassName($this->namespace."\DDC2372Admin");
933 933
 
934 934
         $this->generator->writeEntityClass($metadata, $this->tmpDir);
935 935
 
936
-        self::assertFileExists($this->tmpDir . "/" . $this->namespace . "/DDC2372Admin.php");
937
-        require $this->tmpDir . "/" . $this->namespace . "/DDC2372Admin.php";
936
+        self::assertFileExists($this->tmpDir."/".$this->namespace."/DDC2372Admin.php");
937
+        require $this->tmpDir."/".$this->namespace."/DDC2372Admin.php";
938 938
 
939 939
         $reflClass = new \ReflectionClass($metadata->getClassName());
940 940
 
@@ -954,22 +954,22 @@  discard block
 block discarded – undo
954 954
         $cmf->setEntityManager($em);
955 955
 
956 956
         $ns     = $this->namespace;
957
-        $nsdir  = $this->tmpDir . '/' . $ns;
957
+        $nsdir  = $this->tmpDir.'/'.$ns;
958 958
 
959 959
         // Dump DDC1590User into temp file
960 960
         $content = str_replace(
961 961
             'namespace Doctrine\Tests\Models\DDC1590',
962
-            'namespace ' . $ns,
963
-            file_get_contents(__DIR__ . '/../../Models/DDC1590/DDC1590User.php')
962
+            'namespace '.$ns,
963
+            file_get_contents(__DIR__.'/../../Models/DDC1590/DDC1590User.php')
964 964
         );
965 965
 
966
-        $fname = $nsdir . "/DDC1590User.php";
966
+        $fname = $nsdir."/DDC1590User.php";
967 967
         file_put_contents($fname, $content);
968 968
 
969 969
         // Require DDC1590User
970 970
         require $fname;
971 971
 
972
-        $metadata = $cmf->getMetadataFor($ns . '\DDC1590User');
972
+        $metadata = $cmf->getMetadataFor($ns.'\DDC1590User');
973 973
         $this->generator->writeEntityClass($metadata, $this->tmpDir);
974 974
 
975 975
         // class DDC1590User extends DDC1590Entity { ... }
@@ -977,13 +977,13 @@  discard block
 block discarded – undo
977 977
 
978 978
         // class _DDC1590User extends DDC1590Entity { ... }
979 979
         $source2    = str_replace('class DDC1590User', 'class _DDC1590User', $source);
980
-        $fname2     = $nsdir . "/_DDC1590User.php";
980
+        $fname2     = $nsdir."/_DDC1590User.php";
981 981
         file_put_contents($fname2, $source2);
982 982
         require $fname2;
983 983
 
984 984
         // class __DDC1590User { ... }
985 985
         $source3    = str_replace('class DDC1590User extends DDC1590Entity', 'class __DDC1590User', $source);
986
-        $fname3     = $nsdir . "/__DDC1590User.php";
986
+        $fname3     = $nsdir."/__DDC1590User.php";
987 987
         file_put_contents($fname3, $source3);
988 988
         require $fname3;
989 989
 
@@ -1146,7 +1146,7 @@  discard block
 block discarded – undo
1146 1146
         $this->loadEntityClass($metadata);
1147 1147
 
1148 1148
         $className = basename(str_replace('\\', '/', $metadata->getClassName()));
1149
-        $path = $this->tmpDir . '/' . $this->namespace . '/' . $className . '.php';
1149
+        $path = $this->tmpDir.'/'.$this->namespace.'/'.$className.'.php';
1150 1150
         $classTest = file_get_contents($path);
1151 1151
 
1152 1152
         $this->generator->setRegenerateEntityIfExists(true);
@@ -1155,7 +1155,7 @@  discard block
 block discarded – undo
1155 1155
         $this->generator->writeEntityClass($metadata, $this->tmpDir);
1156 1156
         $classNew = file_get_contents($path);
1157 1157
 
1158
-        self::assertSame($classTest,$classNew);
1158
+        self::assertSame($classTest, $classNew);
1159 1159
     }
1160 1160
 
1161 1161
     /**
Please login to merge, or discard this patch.