Failed Conditions
Push — develop ( 26c78d...044239 )
by Michael
63:26
created
tests/Doctrine/Tests/ORM/Functional/SQLFilterTest.php 2 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -183,6 +183,9 @@  discard block
 block discarded – undo
183 183
         self::assertFalse($em->getFilters()->isEnabled("foo_filter"));
184 184
     }
185 185
 
186
+    /**
187
+     * @param EntityManagerInterface $em
188
+     */
186 189
     protected function configureFilters($em)
187 190
     {
188 191
         // Add filters to the configuration of the EM
@@ -902,6 +905,9 @@  discard block
 block discarded – undo
902 905
         self::assertCount(2, $manager->managedContracts->slice(0, 10));
903 906
     }
904 907
 
908
+    /**
909
+     * @param string $name
910
+     */
905 911
     private function usePersonNameFilter($name)
906 912
     {
907 913
         // Enable the filter
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 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
 
@@ -577,11 +577,11 @@  discard block
 block discarded – undo
577 577
         $user = $this->em->find(CmsUser::class, $this->userId);
578 578
 
579 579
         self::assertFalse($user->articles->isInitialized());
580
-        self::assertCount(2, $user->articles->slice(0,10));
580
+        self::assertCount(2, $user->articles->slice(0, 10));
581 581
 
582 582
         $this->useCMSArticleTopicFilter();
583 583
 
584
-        self::assertCount(1, $user->articles->slice(0,10));
584
+        self::assertCount(1, $user->articles->slice(0, 10));
585 585
     }
586 586
 
587 587
     private function useCMSGroupPrefixFilter()
@@ -625,11 +625,11 @@  discard block
 block discarded – undo
625 625
         $user = $this->em->find(CmsUser::class, $this->userId2);
626 626
 
627 627
         self::assertFalse($user->groups->isInitialized());
628
-        self::assertCount(2, $user->groups->slice(0,10));
628
+        self::assertCount(2, $user->groups->slice(0, 10));
629 629
 
630 630
         $this->useCMSGroupPrefixFilter();
631 631
 
632
-        self::assertCount(1, $user->groups->slice(0,10));
632
+        self::assertCount(1, $user->groups->slice(0, 10));
633 633
     }
634 634
 
635 635
     private function loadFixtureData()
@@ -1119,11 +1119,11 @@  discard block
 block discarded – undo
1119 1119
 {
1120 1120
     public function addFilterConstraint(ClassMetadata $targetEntity, $targetTableAlias)
1121 1121
     {
1122
-        if (!in_array("LocaleAware", $targetEntity->getReflectionClass()->getInterfaceNames())) {
1122
+        if ( ! in_array("LocaleAware", $targetEntity->getReflectionClass()->getInterfaceNames())) {
1123 1123
             return "";
1124 1124
         }
1125 1125
 
1126
-        return $targetTableAlias.'.locale = ' . $this->getParameter('locale'); // getParam uses connection to quote the value.
1126
+        return $targetTableAlias.'.locale = '.$this->getParameter('locale'); // getParam uses connection to quote the value.
1127 1127
     }
1128 1128
 }
1129 1129
 
@@ -1135,7 +1135,7 @@  discard block
 block discarded – undo
1135 1135
             return "";
1136 1136
         }
1137 1137
 
1138
-        return $targetTableAlias.'.country = ' . $this->getParameter('country'); // getParam uses connection to quote the value.
1138
+        return $targetTableAlias.'.country = '.$this->getParameter('country'); // getParam uses connection to quote the value.
1139 1139
     }
1140 1140
 }
1141 1141
 
@@ -1147,7 +1147,7 @@  discard block
 block discarded – undo
1147 1147
             return "";
1148 1148
         }
1149 1149
 
1150
-        return $targetTableAlias.'.name LIKE ' . $this->getParameter('prefix'); // getParam uses connection to quote the value.
1150
+        return $targetTableAlias.'.name LIKE '.$this->getParameter('prefix'); // getParam uses connection to quote the value.
1151 1151
     }
1152 1152
 }
1153 1153
 
@@ -1159,7 +1159,7 @@  discard block
 block discarded – undo
1159 1159
             return "";
1160 1160
         }
1161 1161
 
1162
-        return $targetTableAlias.'.topic = ' . $this->getParameter('topic'); // getParam uses connection to quote the value.
1162
+        return $targetTableAlias.'.topic = '.$this->getParameter('topic'); // getParam uses connection to quote the value.
1163 1163
     }
1164 1164
 }
1165 1165
 
@@ -1171,7 +1171,7 @@  discard block
 block discarded – undo
1171 1171
             return "";
1172 1172
         }
1173 1173
 
1174
-        return $targetTableAlias.'.name LIKE ' . $this->getParameter('name');
1174
+        return $targetTableAlias.'.name LIKE '.$this->getParameter('name');
1175 1175
     }
1176 1176
 }
1177 1177
 
@@ -1183,7 +1183,7 @@  discard block
 block discarded – undo
1183 1183
             return "";
1184 1184
         }
1185 1185
 
1186
-        return $targetTableAlias.'."completed" = ' . $this->getParameter('completed');
1186
+        return $targetTableAlias.'."completed" = '.$this->getParameter('completed');
1187 1187
     }
1188 1188
 }
1189 1189
 
@@ -1195,6 +1195,6 @@  discard block
 block discarded – undo
1195 1195
             return "";
1196 1196
         }
1197 1197
 
1198
-        return $targetTableAlias.'.id = ' . $this->getParameter('id');
1198
+        return $targetTableAlias.'.id = '.$this->getParameter('id');
1199 1199
     }
1200 1200
 }
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/QueryBuilderTest.php 1 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::assertCount(1, $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/Export/AbstractClassMetadataExporterTest.php 1 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\Tools\Export;
6 6
 
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
             'xml'        => XmlDriver::class,
67 67
         ];
68 68
 
69
-        self::assertArrayHasKey($type, $mappingDriver, "There is no metadata driver for the type '" . $type . "'.");
69
+        self::assertArrayHasKey($type, $mappingDriver, "There is no metadata driver for the type '".$type."'.");
70 70
 
71 71
         $class  = $mappingDriver[$type];
72 72
         $driver = ($type === 'annotation')
@@ -89,10 +89,10 @@  discard block
 block discarded – undo
89 89
 
90 90
     public function testExportDirectoryAndFilesAreCreated()
91 91
     {
92
-        $this->deleteDirectory(__DIR__ . '/export/'.$this->getType());
92
+        $this->deleteDirectory(__DIR__.'/export/'.$this->getType());
93 93
 
94 94
         $type = $this->getType();
95
-        $metadataDriver = $this->createMetadataDriver($type, __DIR__ . '/' . $type);
95
+        $metadataDriver = $this->createMetadataDriver($type, __DIR__.'/'.$type);
96 96
         $em = $this->createEntityManager($metadataDriver);
97 97
         $cmf = $this->createClassMetadataFactory($em, $type);
98 98
         $metadata = $cmf->getAllMetadata();
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 
105 105
         $type = $this->getType();
106 106
         $cme = new ClassMetadataExporter();
107
-        $exporter = $cme->getExporter($type, __DIR__ . '/export/' . $type);
107
+        $exporter = $cme->getExporter($type, __DIR__.'/export/'.$type);
108 108
 
109 109
         if ($type === 'annotation') {
110 110
             $exporter->setEntityGenerator(new EntityGenerator());
@@ -116,9 +116,9 @@  discard block
 block discarded – undo
116 116
         $exporter->export();
117 117
 
118 118
         if ($type == 'annotation') {
119
-            self::assertFileExists(__DIR__ . '/export/' . $type . '/'.str_replace('\\', '/', ExportedUser::class).$this->extension);
119
+            self::assertFileExists(__DIR__.'/export/'.$type.'/'.str_replace('\\', '/', ExportedUser::class).$this->extension);
120 120
         } else {
121
-            self::assertFileExists(__DIR__ . '/export/' . $type . '/Doctrine.Tests.ORM.Tools.Export.ExportedUser'.$this->extension);
121
+            self::assertFileExists(__DIR__.'/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser'.$this->extension);
122 122
         }
123 123
     }
124 124
 
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
     {
130 130
         $type = $this->getType();
131 131
 
132
-        $metadataDriver = $this->createMetadataDriver($type, __DIR__ . '/export/' . $type);
132
+        $metadataDriver = $this->createMetadataDriver($type, __DIR__.'/export/'.$type);
133 133
         $em = $this->createEntityManager($metadataDriver);
134 134
         $cmf = $this->createClassMetadataFactory($em, $type);
135 135
         $metadata = $cmf->getAllMetadata();
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
 
384 384
         if ($type === 'xml') {
385 385
             $xml = simplexml_load_string(
386
-                file_get_contents(__DIR__ . '/export/' . $type . '/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.xml')
386
+                file_get_contents(__DIR__.'/export/'.$type.'/Doctrine.Tests.ORM.Tools.Export.ExportedUser.dcm.xml')
387 387
             );
388 388
 
389 389
             $xml->registerXPathNamespace("d", "http://doctrine-project.org/schemas/orm/doctrine-mapping");
@@ -430,10 +430,10 @@  discard block
 block discarded – undo
430 430
         }
431 431
 
432 432
         if (is_dir($path)) {
433
-            $files = glob(rtrim($path,'/').'/*');
433
+            $files = glob(rtrim($path, '/').'/*');
434 434
 
435 435
             if (is_array($files)) {
436
-                foreach ($files as $file){
436
+                foreach ($files as $file) {
437 437
                     $this->deleteDirectory($file);
438 438
                 }
439 439
             }
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Tools/SetupTest.php 1 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\Tools;
6 6
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
     public function testDirectoryAutoload()
42 42
     {
43
-        Setup::registerAutoloadDirectory(__DIR__ . "/../../../../../vendor/doctrine/common/lib");
43
+        Setup::registerAutoloadDirectory(__DIR__."/../../../../../vendor/doctrine/common/lib");
44 44
 
45 45
         self::assertCount($this->originalAutoloaderCount + 2, spl_autoload_functions());
46 46
     }
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/ManyToManyBasicAssociationTest.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -268,8 +268,8 @@
 block discarded – undo
268 268
         $this->em->clear();
269 269
 
270 270
         $newUser = $this->em->createQuery('SELECT u, g FROM Doctrine\Tests\Models\CMS\CmsUser u LEFT JOIN u.groups g WHERE u.id = ?1')
271
-                             ->setParameter(1, $user->getId())
272
-                             ->getSingleResult();
271
+                                ->setParameter(1, $user->getId())
272
+                                ->getSingleResult();
273 273
         self::assertCount(0, $newUser->groups);
274 274
         self::assertInstanceOf(ManyToManyAssociationMetadata::class, $newUser->groups->getMapping());
275 275
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/QueryDqlFunctionTest.php 2 patches
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     public function testAggregateSum()
26 26
     {
27 27
         $salarySum = $this->em->createQuery('SELECT SUM(m.salary) AS salary FROM Doctrine\Tests\Models\Company\CompanyManager m')
28
-                               ->getSingleResult();
28
+                                ->getSingleResult();
29 29
 
30 30
         self::assertEquals(1500000, $salarySum['salary']);
31 31
     }
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     public function testAggregateAvg()
34 34
     {
35 35
         $salaryAvg = $this->em->createQuery('SELECT AVG(m.salary) AS salary FROM Doctrine\Tests\Models\Company\CompanyManager m')
36
-                               ->getSingleResult();
36
+                                ->getSingleResult();
37 37
 
38 38
         self::assertEquals(375000, round($salaryAvg['salary'], 0));
39 39
     }
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     public function testAggregateMin()
42 42
     {
43 43
         $salary = $this->em->createQuery('SELECT MIN(m.salary) AS salary FROM Doctrine\Tests\Models\Company\CompanyManager m')
44
-                               ->getSingleResult();
44
+                                ->getSingleResult();
45 45
 
46 46
         self::assertEquals(100000, $salary['salary']);
47 47
     }
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     public function testAggregateMax()
50 50
     {
51 51
         $salary = $this->em->createQuery('SELECT MAX(m.salary) AS salary FROM Doctrine\Tests\Models\Company\CompanyManager m')
52
-                               ->getSingleResult();
52
+                                ->getSingleResult();
53 53
 
54 54
         self::assertEquals(800000, $salary['salary']);
55 55
     }
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
     public function testAggregateCount()
58 58
     {
59 59
         $managerCount = $this->em->createQuery('SELECT COUNT(m.id) AS managers FROM Doctrine\Tests\Models\Company\CompanyManager m')
60
-                               ->getSingleResult();
60
+                                ->getSingleResult();
61 61
 
62 62
         self::assertEquals(4, $managerCount['managers']);
63 63
     }
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     public function testFunctionAbs()
66 66
     {
67 67
         $result = $this->em->createQuery('SELECT m, ABS(m.salary * -1) AS abs FROM Doctrine\Tests\Models\Company\CompanyManager m ORDER BY m.salary ASC')
68
-                         ->getResult();
68
+                            ->getResult();
69 69
 
70 70
         self::assertCount(4, $result);
71 71
         self::assertEquals(100000, $result[0]['abs']);
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
     public function testFunctionConcat()
78 78
     {
79 79
         $arg = $this->em->createQuery('SELECT m, CONCAT(m.name, m.department) AS namedep FROM Doctrine\Tests\Models\Company\CompanyManager m ORDER BY m.salary ASC')
80
-                         ->getArrayResult();
80
+                            ->getArrayResult();
81 81
 
82 82
         self::assertCount(4, $arg);
83 83
         self::assertEquals('Roman B.IT', $arg[0]['namedep']);
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
     public function testFunctionLength()
90 90
     {
91 91
         $result = $this->em->createQuery('SELECT m, LENGTH(CONCAT(m.name, m.department)) AS namedeplength FROM Doctrine\Tests\Models\Company\CompanyManager m ORDER BY m.salary ASC')
92
-                         ->getArrayResult();
92
+                            ->getArrayResult();
93 93
 
94 94
         self::assertCount(4, $result);
95 95
         self::assertEquals(10, $result[0]['namedeplength']);
@@ -101,10 +101,10 @@  discard block
 block discarded – undo
101 101
     public function testFunctionLocate()
102 102
     {
103 103
         $dql = "SELECT m, LOCATE('e', LOWER(m.name)) AS loc, LOCATE('e', LOWER(m.name), 7) AS loc2 ".
104
-               "FROM Doctrine\Tests\Models\Company\CompanyManager m ORDER BY m.salary ASC";
104
+                "FROM Doctrine\Tests\Models\Company\CompanyManager m ORDER BY m.salary ASC";
105 105
 
106 106
         $result = $this->em->createQuery($dql)
107
-                         ->getArrayResult();
107
+                            ->getArrayResult();
108 108
 
109 109
         self::assertCount(4, $result);
110 110
         self::assertEquals(0, $result[0]['loc']);
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
     public function testFunctionLower()
121 121
     {
122 122
         $result = $this->em->createQuery("SELECT m, LOWER(m.name) AS lowername FROM Doctrine\Tests\Models\Company\CompanyManager m ORDER BY m.salary ASC")
123
-                         ->getArrayResult();
123
+                            ->getArrayResult();
124 124
 
125 125
         self::assertCount(4, $result);
126 126
         self::assertEquals('roman b.', $result[0]['lowername']);
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
     public function testFunctionMod()
133 133
     {
134 134
         $result = $this->em->createQuery("SELECT m, MOD(m.salary, 3500) AS amod FROM Doctrine\Tests\Models\Company\CompanyManager m ORDER BY m.salary ASC")
135
-                         ->getArrayResult();
135
+                            ->getArrayResult();
136 136
 
137 137
         self::assertCount(4, $result);
138 138
         self::assertEquals(2000, $result[0]['amod']);
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
     public function testFunctionSqrt()
145 145
     {
146 146
         $result = $this->em->createQuery("SELECT m, SQRT(m.salary) AS sqrtsalary FROM Doctrine\Tests\Models\Company\CompanyManager m ORDER BY m.salary ASC")
147
-                         ->getArrayResult();
147
+                            ->getArrayResult();
148 148
 
149 149
         self::assertCount(4, $result);
150 150
         self::assertEquals(316, round($result[0]['sqrtsalary']));
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
     public function testFunctionUpper()
157 157
     {
158 158
         $result = $this->em->createQuery("SELECT m, UPPER(m.name) AS uppername FROM Doctrine\Tests\Models\Company\CompanyManager m ORDER BY m.salary ASC")
159
-                         ->getArrayResult();
159
+                            ->getArrayResult();
160 160
 
161 161
         self::assertCount(4, $result);
162 162
         self::assertEquals('ROMAN B.', $result[0]['uppername']);
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
                 "FROM Doctrine\Tests\Models\Company\CompanyManager m ORDER BY m.name";
172 172
 
173 173
         $result = $this->em->createQuery($dql)
174
-                         ->getArrayResult();
174
+                            ->getArrayResult();
175 175
 
176 176
         self::assertCount(4, $result);
177 177
         self::assertEquals('Ben', $result[0]['str1']);
@@ -188,8 +188,8 @@  discard block
 block discarded – undo
188 188
     public function testFunctionTrim()
189 189
     {
190 190
         $dql = "SELECT m, TRIM(TRAILING '.' FROM m.name) AS str1, ".
191
-               " TRIM(LEADING '.' FROM m.name) AS str2, TRIM(CONCAT(' ', CONCAT(m.name, ' '))) AS str3 ".
192
-               "FROM Doctrine\Tests\Models\Company\CompanyManager m ORDER BY m.salary ASC";
191
+                " TRIM(LEADING '.' FROM m.name) AS str2, TRIM(CONCAT(' ', CONCAT(m.name, ' '))) AS str3 ".
192
+                "FROM Doctrine\Tests\Models\Company\CompanyManager m ORDER BY m.salary ASC";
193 193
 
194 194
         $result = $this->em->createQuery($dql)->getArrayResult();
195 195
 
@@ -361,8 +361,8 @@  discard block
 block discarded – undo
361 361
     }
362 362
 
363 363
     /**
364
-    * @group DDC-1213
365
-    */
364
+     * @group DDC-1213
365
+     */
366 366
     public function testBitAndComparison()
367 367
     {
368 368
         $dql    = 'SELECT m, ' .
Please login to merge, or discard this patch.
Spacing   +22 added lines, -22 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
 
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 
149 149
         self::assertCount(4, $result);
150 150
         self::assertEquals(316, round($result[0]['sqrtsalary']));
151
-        self::assertEquals(447,  round($result[1]['sqrtsalary']));
151
+        self::assertEquals(447, round($result[1]['sqrtsalary']));
152 152
         self::assertEquals(632, round($result[2]['sqrtsalary']));
153 153
         self::assertEquals(894, round($result[3]['sqrtsalary']));
154 154
     }
@@ -341,12 +341,12 @@  discard block
 block discarded – undo
341 341
      */
342 342
     public function testBitOrComparison()
343 343
     {
344
-        $dql    = 'SELECT m, ' .
345
-                    'BIT_OR(4, 2) AS bit_or,' .
346
-                    'BIT_OR( (m.salary/100000) , 2 ) AS salary_bit_or ' .
347
-                    'FROM Doctrine\Tests\Models\Company\CompanyManager m ' .
348
-                'ORDER BY ' .
349
-                    'm.id ' ;
344
+        $dql = 'SELECT m, '.
345
+                    'BIT_OR(4, 2) AS bit_or,'.
346
+                    'BIT_OR( (m.salary/100000) , 2 ) AS salary_bit_or '.
347
+                    'FROM Doctrine\Tests\Models\Company\CompanyManager m '.
348
+                'ORDER BY '.
349
+                    'm.id ';
350 350
         $result = $this->em->createQuery($dql)->getArrayResult();
351 351
 
352 352
         self::assertEquals(4 | 2, $result[0]['bit_or']);
@@ -354,10 +354,10 @@  discard block
 block discarded – undo
354 354
         self::assertEquals(4 | 2, $result[2]['bit_or']);
355 355
         self::assertEquals(4 | 2, $result[3]['bit_or']);
356 356
 
357
-        self::assertEquals(($result[0][0]['salary']/100000) | 2, $result[0]['salary_bit_or']);
358
-        self::assertEquals(($result[1][0]['salary']/100000) | 2, $result[1]['salary_bit_or']);
359
-        self::assertEquals(($result[2][0]['salary']/100000) | 2, $result[2]['salary_bit_or']);
360
-        self::assertEquals(($result[3][0]['salary']/100000) | 2, $result[3]['salary_bit_or']);
357
+        self::assertEquals(($result[0][0]['salary'] / 100000) | 2, $result[0]['salary_bit_or']);
358
+        self::assertEquals(($result[1][0]['salary'] / 100000) | 2, $result[1]['salary_bit_or']);
359
+        self::assertEquals(($result[2][0]['salary'] / 100000) | 2, $result[2]['salary_bit_or']);
360
+        self::assertEquals(($result[3][0]['salary'] / 100000) | 2, $result[3]['salary_bit_or']);
361 361
     }
362 362
 
363 363
     /**
@@ -365,12 +365,12 @@  discard block
 block discarded – undo
365 365
     */
366 366
     public function testBitAndComparison()
367 367
     {
368
-        $dql    = 'SELECT m, ' .
369
-                    'BIT_AND(4, 2) AS bit_and,' .
370
-                    'BIT_AND( (m.salary/100000) , 2 ) AS salary_bit_and ' .
371
-                    'FROM Doctrine\Tests\Models\Company\CompanyManager m ' .
372
-                'ORDER BY ' .
373
-                    'm.id ' ;
368
+        $dql = 'SELECT m, '.
369
+                    'BIT_AND(4, 2) AS bit_and,'.
370
+                    'BIT_AND( (m.salary/100000) , 2 ) AS salary_bit_and '.
371
+                    'FROM Doctrine\Tests\Models\Company\CompanyManager m '.
372
+                'ORDER BY '.
373
+                    'm.id ';
374 374
         $result = $this->em->createQuery($dql)->getArrayResult();
375 375
 
376 376
         self::assertEquals(4 & 2, $result[0]['bit_and']);
@@ -378,10 +378,10 @@  discard block
 block discarded – undo
378 378
         self::assertEquals(4 & 2, $result[2]['bit_and']);
379 379
         self::assertEquals(4 & 2, $result[3]['bit_and']);
380 380
 
381
-        self::assertEquals(($result[0][0]['salary']/100000) & 2, $result[0]['salary_bit_and']);
382
-        self::assertEquals(($result[1][0]['salary']/100000) & 2, $result[1]['salary_bit_and']);
383
-        self::assertEquals(($result[2][0]['salary']/100000) & 2, $result[2]['salary_bit_and']);
384
-        self::assertEquals(($result[3][0]['salary']/100000) & 2, $result[3]['salary_bit_and']);
381
+        self::assertEquals(($result[0][0]['salary'] / 100000) & 2, $result[0]['salary_bit_and']);
382
+        self::assertEquals(($result[1][0]['salary'] / 100000) & 2, $result[1]['salary_bit_and']);
383
+        self::assertEquals(($result[2][0]['salary'] / 100000) & 2, $result[2]['salary_bit_and']);
384
+        self::assertEquals(($result[3][0]['salary'] / 100000) & 2, $result[3]['salary_bit_and']);
385 385
     }
386 386
 
387 387
     protected function generateFixture()
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/OrderedCollectionTest.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -104,8 +104,8 @@
 block discarded – undo
104 104
         $routeId = $this->createPersistedRouteWithLegs();
105 105
 
106 106
         $route = $this->em->createQuery("SELECT r, l FROM Doctrine\Tests\Models\Routing\RoutingRoute r JOIN r.legs l WHERE r.id = ?1")
107
-                           ->setParameter(1, $routeId)
108
-                           ->getSingleResult();
107
+                            ->setParameter(1, $routeId)
108
+                            ->getSingleResult();
109 109
 
110 110
         self::assertCount(2, $route->legs);
111 111
         self::assertEquals("Berlin", $route->legs[0]->fromLocation->getName());
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest.php 1 patch
Spacing   +14 added lines, -14 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
 
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
         $this->em->clear();
51 51
 
52
-        $query = $this->em->createQuery('select p from ' . CompanyPerson::class . ' p order by p.name desc');
52
+        $query = $this->em->createQuery('select p from '.CompanyPerson::class.' p order by p.name desc');
53 53
 
54 54
         $entities = $query->getResult();
55 55
 
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 
65 65
         $this->em->clear();
66 66
 
67
-        $query = $this->em->createQuery('select p from ' . CompanyEmployee::class . ' p');
67
+        $query = $this->em->createQuery('select p from '.CompanyEmployee::class.' p');
68 68
 
69 69
         $entities = $query->getResult();
70 70
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 
84 84
         $this->em->clear();
85 85
 
86
-        $query = $this->em->createQuery("update " . CompanyEmployee::class . " p set p.name = ?1, p.department = ?2 where p.name='Guilherme Blanco' and p.salary = ?3");
86
+        $query = $this->em->createQuery("update ".CompanyEmployee::class." p set p.name = ?1, p.department = ?2 where p.name='Guilherme Blanco' and p.salary = ?3");
87 87
 
88 88
         $query->setParameter(1, 'NewName', 'string');
89 89
         $query->setParameter(2, 'NewDepartment');
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 
95 95
         self::assertEquals(1, $numUpdated);
96 96
 
97
-        $query = $this->em->createQuery('delete from ' . CompanyPerson::class . ' p');
97
+        $query = $this->em->createQuery('delete from '.CompanyPerson::class.' p');
98 98
 
99 99
         $numDeleted = $query->execute();
100 100
 
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
         $this->em->flush();
170 170
         $this->em->clear();
171 171
 
172
-        $query = $this->em->createQuery('select p, s from ' . CompanyPerson::class . ' p join p.spouse s where p.name=\'Mary Smith\'');
172
+        $query = $this->em->createQuery('select p, s from '.CompanyPerson::class.' p join p.spouse s where p.name=\'Mary Smith\'');
173 173
 
174 174
         $result = $query->getResult();
175 175
 
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 
202 202
         $this->em->clear();
203 203
 
204
-        $query = $this->em->createQuery('select p, f from ' . CompanyPerson::class . ' p join p.friends f where p.name=?1');
204
+        $query = $this->em->createQuery('select p, f from '.CompanyPerson::class.' p join p.friends f where p.name=?1');
205 205
 
206 206
         $query->setParameter(1, 'Roman');
207 207
 
@@ -267,18 +267,18 @@  discard block
 block discarded – undo
267 267
         $this->em->flush();
268 268
         $this->em->clear();
269 269
 
270
-        $q = $this->em->createQuery('select a from ' . CompanyEvent::class . ' a where a.id = ?1');
270
+        $q = $this->em->createQuery('select a from '.CompanyEvent::class.' a where a.id = ?1');
271 271
 
272 272
         $q->setParameter(1, $event1->getId());
273 273
 
274 274
         $result = $q->getResult();
275 275
 
276 276
         self::assertCount(1, $result);
277
-        self::assertInstanceOf(CompanyAuction::class, $result[0], sprintf("Is of class %s",get_class($result[0])));
277
+        self::assertInstanceOf(CompanyAuction::class, $result[0], sprintf("Is of class %s", get_class($result[0])));
278 278
 
279 279
         $this->em->clear();
280 280
 
281
-        $q = $this->em->createQuery('select a from ' . CompanyOrganization::class . ' a where a.id = ?1');
281
+        $q = $this->em->createQuery('select a from '.CompanyOrganization::class.' a where a.id = ?1');
282 282
 
283 283
         $q->setParameter(1, $org->getId());
284 284
 
@@ -299,10 +299,10 @@  discard block
 block discarded – undo
299 299
      */
300 300
     public function testBulkUpdateIssueDDC368()
301 301
     {
302
-        $this->em->createQuery('UPDATE ' . CompanyEmployee::class . ' AS p SET p.salary = 1')
302
+        $this->em->createQuery('UPDATE '.CompanyEmployee::class.' AS p SET p.salary = 1')
303 303
                   ->execute();
304 304
 
305
-        $result = $this->em->createQuery('SELECT count(p.id) FROM ' . CompanyEmployee::class . ' p WHERE p.salary = 1')
305
+        $result = $this->em->createQuery('SELECT count(p.id) FROM '.CompanyEmployee::class.' p WHERE p.salary = 1')
306 306
                             ->getResult();
307 307
 
308 308
         self::assertGreaterThan(0, $result);
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
      */
314 314
     public function testBulkUpdateNonScalarParameterDDC1341()
315 315
     {
316
-        $this->em->createQuery('UPDATE ' . CompanyEmployee::class . ' AS p SET p.startDate = ?0 WHERE p.department = ?1')
316
+        $this->em->createQuery('UPDATE '.CompanyEmployee::class.' AS p SET p.startDate = ?0 WHERE p.department = ?1')
317 317
                   ->setParameter(0, new \DateTime())
318 318
                   ->setParameter(1, 'IT')
319 319
                   ->execute();
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
         $this->em->flush();
372 372
         $this->em->clear();
373 373
 
374
-        $dqlManager = $this->em->createQuery('SELECT m FROM ' . CompanyManager::class . ' m WHERE m.spouse = ?1')
374
+        $dqlManager = $this->em->createQuery('SELECT m FROM '.CompanyManager::class.' m WHERE m.spouse = ?1')
375 375
                                 ->setParameter(1, $person->getId())
376 376
                                 ->getSingleResult();
377 377
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/NativeQueryTest.php 1 patch
Spacing   +6 added lines, -6 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
 
@@ -436,8 +436,8 @@  discard block
 block discarded – undo
436 436
 
437 437
         self::assertCount(1, $result);
438 438
         self::assertInstanceOf(CmsAddress::class, $result[0]);
439
-        self::assertEquals($addr->id,  $result[0]->id);
440
-        self::assertEquals($addr->city,  $result[0]->city);
439
+        self::assertEquals($addr->id, $result[0]->id);
440
+        self::assertEquals($addr->city, $result[0]->city);
441 441
         self::assertEquals($addr->country, $result[0]->country);
442 442
     }
443 443
 
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
 
455 455
         $email = new CmsEmail();
456 456
 
457
-        $email->email   = '[email protected]';
457
+        $email->email = '[email protected]';
458 458
 
459 459
         $user->setEmail($email);
460 460
 
@@ -605,7 +605,7 @@  discard block
 block discarded – undo
605 605
         $repository = $this->em->getRepository(CmsUser::class);
606 606
         $result     = $repository
607 607
             ->createNativeNamedQuery('fetchUserPhonenumberCount')
608
-            ->setParameter(1, ['test','FabioBatSilva'])->getResult();
608
+            ->setParameter(1, ['test', 'FabioBatSilva'])->getResult();
609 609
 
610 610
         self::assertCount(2, $result);
611 611
         self::assertInternalType('array', $result[0]);
@@ -832,7 +832,7 @@  discard block
 block discarded – undo
832 832
 
833 833
         $rsm->addRootEntityFromClassMetadata(CmsUser::class, 'u');
834 834
 
835
-        self::assertSQLEquals('u.id AS id0, u.status AS status1, u.username AS username2, u.name AS name3, u.email_id AS email_id4', (string)$rsm);
835
+        self::assertSQLEquals('u.id AS id0, u.status AS status1, u.username AS username2, u.name AS name3, u.email_id AS email_id4', (string) $rsm);
836 836
     }
837 837
 
838 838
     /**
Please login to merge, or discard this patch.