Failed Conditions
Pull Request — 2.6 (#7506)
by
unknown
09:52
created
tests/Doctrine/Tests/ORM/Functional/ValueObjectsTest.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
                 $this->_em->getClassMetadata(DDC3027Dog::class),
28 28
                 ]
29 29
             );
30
-        } catch(\Exception $e) {
30
+        } catch (\Exception $e) {
31 31
         }
32 32
     }
33 33
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
         $this->assertEquals('United States of America', $person->address->country->name);
83 83
 
84 84
         // 4. check deleting works
85
-        $personId = $person->id;;
85
+        $personId = $person->id; ;
86 86
         $this->_em->remove($person);
87 87
         $this->_em->flush();
88 88
 
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
         $this->_em->flush();
107 107
         $this->_em->clear();
108 108
 
109
-        $dql = "SELECT p FROM " . __NAMESPACE__ . "\DDC93Person p";
109
+        $dql = "SELECT p FROM ".__NAMESPACE__."\DDC93Person p";
110 110
         $persons = $this->_em->createQuery($dql)->getResult();
111 111
 
112 112
         $this->assertCount(3, $persons);
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
             $this->assertEquals('United States of America', $person->address->country->name);
120 120
         }
121 121
 
122
-        $dql = "SELECT p FROM " . __NAMESPACE__ . "\DDC93Person p";
122
+        $dql = "SELECT p FROM ".__NAMESPACE__."\DDC93Person p";
123 123
         $persons = $this->_em->createQuery($dql)->getArrayResult();
124 124
 
125 125
         foreach ($persons as $person) {
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
         $this->_em->flush();
145 145
 
146 146
         // SELECT
147
-        $selectDql = "SELECT p FROM " . __NAMESPACE__ ."\\DDC93Person p WHERE p.address.city = :city AND p.address.country.name = :country";
147
+        $selectDql = "SELECT p FROM ".__NAMESPACE__."\\DDC93Person p WHERE p.address.city = :city AND p.address.country.name = :country";
148 148
         $loadedPerson = $this->_em->createQuery($selectDql)
149 149
             ->setParameter('city', 'Karlsruhe')
150 150
             ->setParameter('country', 'Germany')
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
         );
160 160
 
161 161
         // UPDATE
162
-        $updateDql = "UPDATE " . __NAMESPACE__ . "\\DDC93Person p SET p.address.street = :street, p.address.country.name = :country WHERE p.address.city = :city";
162
+        $updateDql = "UPDATE ".__NAMESPACE__."\\DDC93Person p SET p.address.street = :street, p.address.country.name = :country WHERE p.address.city = :city";
163 163
         $this->_em->createQuery($updateDql)
164 164
             ->setParameter('street', 'Boo')
165 165
             ->setParameter('country', 'DE')
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
         $this->assertEquals('DE', $person->address->country->name);
172 172
 
173 173
         // DELETE
174
-        $this->_em->createQuery("DELETE " . __NAMESPACE__ . "\\DDC93Person p WHERE p.address.city = :city AND p.address.country.name = :country")
174
+        $this->_em->createQuery("DELETE ".__NAMESPACE__."\\DDC93Person p WHERE p.address.city = :city AND p.address.country.name = :country")
175 175
             ->setParameter('city', 'Karlsruhe')
176 176
             ->setParameter('country', 'DE')
177 177
             ->execute();
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
         $this->_em->clear();
189 189
 
190 190
         // Prove that the entity was persisted correctly.
191
-        $dql = "SELECT p FROM " . __NAMESPACE__ ."\\DDC93Person p WHERE p.name = :name";
191
+        $dql = "SELECT p FROM ".__NAMESPACE__."\\DDC93Person p WHERE p.name = :name";
192 192
 
193 193
         $person = $this->_em->createQuery($dql)
194 194
             ->setParameter('name', 'Karl')
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
         // Clear the EM and prove that the embeddable can be the subject of a partial query.
203 203
         $this->_em->clear();
204 204
 
205
-        $dql = "SELECT PARTIAL p.{id,address.city} FROM " . __NAMESPACE__ ."\\DDC93Person p WHERE p.name = :name";
205
+        $dql = "SELECT PARTIAL p.{id,address.city} FROM ".__NAMESPACE__."\\DDC93Person p WHERE p.name = :name";
206 206
 
207 207
         $person = $this->_em->createQuery($dql)
208 208
             ->setParameter('name', 'Karl')
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
         // Clear the EM and prove that the embeddable can be the subject of a partial query regardless of attributes positions.
219 219
         $this->_em->clear();
220 220
 
221
-        $dql = "SELECT PARTIAL p.{address.city, id} FROM " . __NAMESPACE__ ."\\DDC93Person p WHERE p.name = :name";
221
+        $dql = "SELECT PARTIAL p.{address.city, id} FROM ".__NAMESPACE__."\\DDC93Person p WHERE p.name = :name";
222 222
 
223 223
         $person = $this->_em->createQuery($dql)
224 224
             ->setParameter('name', 'Karl')
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
         $this->expectException(QueryException::class);
238 238
         $this->expectExceptionMessage('no field or association named address.asdfasdf');
239 239
 
240
-        $this->_em->createQuery("SELECT p FROM " . __NAMESPACE__ . "\\DDC93Person p WHERE p.address.asdfasdf IS NULL")
240
+        $this->_em->createQuery("SELECT p FROM ".__NAMESPACE__."\\DDC93Person p WHERE p.address.asdfasdf IS NULL")
241 241
             ->execute();
242 242
     }
243 243
 
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
         $this->expectException(QueryException::class);
247 247
         $this->expectExceptionMessage("no mapped field named 'address.asdfasdf'");
248 248
 
249
-        $this->_em->createQuery("SELECT PARTIAL p.{id,address.asdfasdf} FROM " . __NAMESPACE__ . "\\DDC93Person p")
249
+        $this->_em->createQuery("SELECT PARTIAL p.{id,address.asdfasdf} FROM ".__NAMESPACE__."\\DDC93Person p")
250 250
             ->execute();
251 251
     }
252 252
 
@@ -308,15 +308,15 @@  discard block
 block discarded – undo
308 308
         $this->expectException(MappingException::class);
309 309
         $this->expectExceptionMessage(
310 310
             sprintf(
311
-                'Infinite nesting detected for embedded property %s::nested. ' .
311
+                'Infinite nesting detected for embedded property %s::nested. '.
312 312
                 'You cannot embed an embeddable from the same type inside an embeddable.',
313
-                __NAMESPACE__ . '\\' . $declaredEmbeddableClassName
313
+                __NAMESPACE__.'\\'.$declaredEmbeddableClassName
314 314
             )
315 315
         );
316 316
 
317 317
         $this->_schemaTool->createSchema(
318 318
             [
319
-            $this->_em->getClassMetadata(__NAMESPACE__ . '\\' . $embeddableClassName),
319
+            $this->_em->getClassMetadata(__NAMESPACE__.'\\'.$embeddableClassName),
320 320
             ]
321 321
         );
322 322
     }
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2984Test.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
         $this->_em->persist($user);
43 43
         $this->_em->flush();
44 44
 
45
-        $repository = $this->_em->getRepository(__NAMESPACE__ . "\DDC2984User");
45
+        $repository = $this->_em->getRepository(__NAMESPACE__."\DDC2984User");
46 46
 
47 47
         $sameUser = $repository->find(new DDC2984DomainUserId('unique_id_within_a_vo'));
48 48
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Console/Command/GenerateRepositoriesCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
61 61
     protected function execute(InputInterface $input, OutputInterface $output)
62 62
     {
63 63
         $ui = new SymfonyStyle($input, $output);
64
-        $ui->warning('Command ' . $this->getName() . ' is deprecated and will be removed in Doctrine 3.0.');
64
+        $ui->warning('Command '.$this->getName().' is deprecated and will be removed in Doctrine 3.0.');
65 65
 
66 66
         $em = $this->getHelper('em')->getEntityManager();
67 67
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
     protected function execute(InputInterface $input, OutputInterface $output)
121 121
     {
122 122
         $ui = new SymfonyStyle($input, $output);
123
-        $ui->warning('Command ' . $this->getName() . ' is deprecated and will be removed in Doctrine 3.0.');
123
+        $ui->warning('Command '.$this->getName().' is deprecated and will be removed in Doctrine 3.0.');
124 124
 
125 125
         // Process source directories
126 126
         $fromPaths = array_merge([$input->getArgument('from-path')], $input->getOption('from'));
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
             $exporter->setMetadata($metadata);
203 203
             $exporter->export();
204 204
 
205
-            $output->writeln(PHP_EOL . sprintf(
205
+            $output->writeln(PHP_EOL.sprintf(
206 206
                 'Converting Doctrine 1.X schema to "<info>%s</info>" mapping type in "<info>%s</info>"', $toType, $destPath
207 207
             ));
208 208
         } else {
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
     protected function execute(InputInterface $input, OutputInterface $output)
90 90
     {
91 91
         $ui = new SymfonyStyle($input, $output);
92
-        $ui->warning('Command ' . $this->getName() . ' is deprecated and will be removed in Doctrine 3.0.');
92
+        $ui->warning('Command '.$this->getName().' is deprecated and will be removed in Doctrine 3.0.');
93 93
 
94 94
         $em = $this->getHelper('em')->getEntityManager();
95 95
 
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
         $entityGenerator->setRegenerateEntityIfExists($input->getOption('regenerate-entities'));
126 126
         $entityGenerator->setUpdateEntityIfExists($input->getOption('update-entities'));
127 127
         $entityGenerator->setNumSpaces($input->getOption('num-spaces'));
128
-        $entityGenerator->setBackupExisting(!$input->getOption('no-backup'));
128
+        $entityGenerator->setBackupExisting( ! $input->getOption('no-backup'));
129 129
 
130 130
         if (($extend = $input->getOption('extend')) !== null) {
131 131
             $entityGenerator->setClassToExtend($extend);
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
 
43 43
     public function __construct()
44 44
     {
45
-        @trigger_error(self::class . ' is deprecated and will be removed in Doctrine 3.0', E_USER_DEPRECATED);
45
+        @trigger_error(self::class.' is deprecated and will be removed in Doctrine 3.0', E_USER_DEPRECATED);
46 46
     }
47 47
 
48 48
     /**
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Export/Driver/AbstractExporter.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
      */
60 60
     public function __construct($dir = null)
61 61
     {
62
-        @trigger_error(static::class . ' is deprecated and will be removed in Doctrine 3.0', E_USER_DEPRECATED);
62
+        @trigger_error(static::class.' is deprecated and will be removed in Doctrine 3.0', E_USER_DEPRECATED);
63 63
 
64 64
         $this->_outputDir = $dir;
65 65
     }
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
                 if ( ! is_dir($dir)) {
146 146
                     mkdir($dir, 0775, true);
147 147
                 }
148
-                if (file_exists($path) && !$this->_overwriteExistingFiles) {
148
+                if (file_exists($path) && ! $this->_overwriteExistingFiles) {
149 149
                     throw ExportException::attemptOverwriteExistingFile($path);
150 150
                 }
151 151
                 file_put_contents($path, $output);
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
      */
164 164
     protected function _generateOutputPath(ClassMetadataInfo $metadata)
165 165
     {
166
-        return $this->_outputDir . '/' . str_replace('\\', '.', $metadata->name) . $this->_extension;
166
+        return $this->_outputDir.'/'.str_replace('\\', '.', $metadata->name).$this->_extension;
167 167
     }
168 168
 
169 169
     /**
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/EntityRepositoryGenerator.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
     public function __construct()
56 56
     {
57
-        @trigger_error(self::class . ' is deprecated and will be removed in Doctrine 3.0', E_USER_DEPRECATED);
57
+        @trigger_error(self::class.' is deprecated and will be removed in Doctrine 3.0', E_USER_DEPRECATED);
58 58
     }
59 59
 
60 60
     /**
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
     {
119 119
         $namespace = $this->getClassNamespace($fullClassName);
120 120
 
121
-        return $namespace ? 'namespace ' . $namespace . ';' : '';
121
+        return $namespace ? 'namespace '.$namespace.';' : '';
122 122
     }
123 123
 
124 124
     /**
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
         $repositoryName = $this->repositoryName ?: EntityRepository::class;
134 134
 
135 135
         if ($namespace && $repositoryName[0] !== '\\') {
136
-            $repositoryName = '\\' . $repositoryName;
136
+            $repositoryName = '\\'.$repositoryName;
137 137
         }
138 138
 
139 139
         return $repositoryName;
@@ -149,8 +149,8 @@  discard block
 block discarded – undo
149 149
     {
150 150
         $code = $this->generateEntityRepositoryClass($fullClassName);
151 151
 
152
-        $path = $outputDirectory . DIRECTORY_SEPARATOR
153
-              . str_replace('\\', \DIRECTORY_SEPARATOR, $fullClassName) . '.php';
152
+        $path = $outputDirectory.DIRECTORY_SEPARATOR
153
+              . str_replace('\\', \DIRECTORY_SEPARATOR, $fullClassName).'.php';
154 154
         $dir = dirname($path);
155 155
 
156 156
         if ( ! is_dir($dir)) {
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Query/QueryTest.php 2 patches
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -88,18 +88,18 @@  discard block
 block discarded – undo
88 88
     {
89 89
         $q = $this->_em->createQuery("select a from Doctrine\Tests\Models\CMS\CmsArticle a");
90 90
         $q2 = $q->expireQueryCache(true)
91
-          ->setQueryCacheLifetime(3600)
92
-          ->setQueryCacheDriver(null)
93
-          ->expireResultCache(true)
94
-          ->setHint('foo', 'bar')
95
-          ->setHint('bar', 'baz')
96
-          ->setParameter(1, 'bar')
97
-          ->setParameters(new ArrayCollection([new Parameter(2, 'baz')]))
98
-          ->setResultCacheDriver(null)
99
-          ->setResultCacheId('foo')
100
-          ->setDQL('foo')
101
-          ->setFirstResult(10)
102
-          ->setMaxResults(10);
91
+            ->setQueryCacheLifetime(3600)
92
+            ->setQueryCacheDriver(null)
93
+            ->expireResultCache(true)
94
+            ->setHint('foo', 'bar')
95
+            ->setHint('bar', 'baz')
96
+            ->setParameter(1, 'bar')
97
+            ->setParameters(new ArrayCollection([new Parameter(2, 'baz')]))
98
+            ->setResultCacheDriver(null)
99
+            ->setResultCacheId('foo')
100
+            ->setDQL('foo')
101
+            ->setFirstResult(10)
102
+            ->setMaxResults(10);
103 103
 
104 104
         $this->assertSame($q2, $q);
105 105
     }
@@ -257,11 +257,11 @@  discard block
 block discarded – undo
257 257
         $this->_em->getConfiguration()->setResultCacheImpl(new ArrayCache());
258 258
 
259 259
         $query = $this->_em->createQuery("SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u")
260
-                           ->enableResultCache();
260
+                            ->enableResultCache();
261 261
 
262 262
         /** @var DriverConnectionMock $driverConnectionMock */
263 263
         $driverConnectionMock = $this->_em->getConnection()
264
-                                          ->getWrappedConnection();
264
+                                            ->getWrappedConnection();
265 265
 
266 266
         $driverConnectionMock->setStatementMock(new StatementArrayMock([['id_0' => 1]]));
267 267
 
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
             9 => "St Julien"
169 169
         ];
170 170
 
171
-        $query  = $this->_em
171
+        $query = $this->_em
172 172
                 ->createQuery("SELECT a FROM Doctrine\Tests\Models\CMS\CmsAddress a WHERE a.city IN (:cities)")
173 173
                 ->setParameter('cities', $cities);
174 174
 
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
      */
185 185
     public function testProcessParameterValueClassMetadata()
186 186
     {
187
-        $query  = $this->_em->createQuery("SELECT a FROM Doctrine\Tests\Models\CMS\CmsAddress a WHERE a.city IN (:cities)");
187
+        $query = $this->_em->createQuery("SELECT a FROM Doctrine\Tests\Models\CMS\CmsAddress a WHERE a.city IN (:cities)");
188 188
         $this->assertEquals(
189 189
             CmsAddress::class,
190 190
             $query->processParameterValue($this->_em->getClassMetadata(CmsAddress::class))
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
      */
333 333
     public function testGetParameterTypeJuggling() : void
334 334
     {
335
-        $query = $this->_em->createQuery('select u from ' . CmsUser::class . ' u where u.id = ?0');
335
+        $query = $this->_em->createQuery('select u from '.CmsUser::class.' u where u.id = ?0');
336 336
 
337 337
         $query->setParameter(0, 0);
338 338
 
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
      */
347 347
     public function testSetParameterWithNameZeroIsNotOverridden() : void
348 348
     {
349
-        $query = $this->_em->createQuery('select u from ' . CmsUser::class . ' u where u.id != ?0 and u.username = :name');
349
+        $query = $this->_em->createQuery('select u from '.CmsUser::class.' u where u.id != ?0 and u.username = :name');
350 350
 
351 351
         $query->setParameter(0, 0);
352 352
         $query->setParameter('name', 'Doctrine');
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
      */
362 362
     public function testSetParameterWithNameZeroDoesNotOverrideAnotherParameter() : void
363 363
     {
364
-        $query = $this->_em->createQuery('select u from ' . CmsUser::class . ' u where u.id != ?0 and u.username = :name');
364
+        $query = $this->_em->createQuery('select u from '.CmsUser::class.' u where u.id != ?0 and u.username = :name');
365 365
 
366 366
         $query->setParameter('name', 'Doctrine');
367 367
         $query->setParameter(0, 0);
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
      */
377 377
     public function testSetParameterWithTypeJugglingWorks() : void
378 378
     {
379
-        $query = $this->_em->createQuery('select u from ' . CmsUser::class . ' u where u.id != ?0 and u.username = :name');
379
+        $query = $this->_em->createQuery('select u from '.CmsUser::class.' u where u.id != ?0 and u.username = :name');
380 380
 
381 381
         $query->setParameter('0', 1);
382 382
         $query->setParameter('name', 'Doctrine');
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
     {
397 397
         $this->_em->getConfiguration()->setResultCacheImpl(new ArrayCache());
398 398
 
399
-        $query = $this->_em->createQuery('SELECT u FROM ' . CmsUser::class . ' u');
399
+        $query = $this->_em->createQuery('SELECT u FROM '.CmsUser::class.' u');
400 400
         $query->enableResultCache();
401 401
         $query->setResultCacheProfile();
402 402
 
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
             ->expects(self::never())
415 415
             ->method('getSingleIdentifierValue');
416 416
 
417
-        $query = $this->_em->createQuery('SELECT d FROM ' . DateTimeModel::class . ' d WHERE d.datetime = :value');
417
+        $query = $this->_em->createQuery('SELECT d FROM '.DateTimeModel::class.' d WHERE d.datetime = :value');
418 418
 
419 419
         $query->setParameter('value', new DateTime(), Type::DATETIME);
420 420
 
Please login to merge, or discard this patch.