Passed
Pull Request — master (#7782)
by Gabriel
06:00
created
lib/Doctrine/ORM/Persisters/Entity/JoinedSubclassPersister.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
             }
110 110
 
111 111
             foreach ($data as $columnName => $value) {
112
-                if (! is_array($id) || ! isset($id[$columnName])) {
112
+                if ( ! is_array($id) || ! isset($id[$columnName])) {
113 113
                     $type = $this->columns[$columnName]->getType();
114 114
 
115 115
                     $stmt->bindValue($paramIndex++, $value, $type);
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
     {
134 134
         $updateData = $this->prepareUpdateData($entity);
135 135
 
136
-        if (! $updateData) {
136
+        if ( ! $updateData) {
137 137
             return;
138 138
         }
139 139
 
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
             $versionedClass = $this->class->versionProperty->getDeclaringClass();
152 152
             $versionedTable = $versionedClass->getTableName();
153 153
 
154
-            if (! isset($updateData[$versionedTable])) {
154
+            if ( ! isset($updateData[$versionedTable])) {
155 155
                 $tableName = $versionedClass->table->getQuotedQualifiedName($this->platform);
156 156
 
157 157
                 $this->updateTable($entity, $tableName, [], true);
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 
233 233
         if ($filterSql) {
234 234
             $conditionSql .= $conditionSql
235
-                ? ' AND ' . $filterSql
235
+                ? ' AND '.$filterSql
236 236
                 : $filterSql;
237 237
         }
238 238
 
@@ -240,26 +240,26 @@  discard block
 block discarded – undo
240 240
 
241 241
         switch ($lockMode) {
242 242
             case LockMode::PESSIMISTIC_READ:
243
-                $lockSql = ' ' . $this->platform->getReadLockSQL();
243
+                $lockSql = ' '.$this->platform->getReadLockSQL();
244 244
                 break;
245 245
 
246 246
             case LockMode::PESSIMISTIC_WRITE:
247
-                $lockSql = ' ' . $this->platform->getWriteLockSQL();
247
+                $lockSql = ' '.$this->platform->getWriteLockSQL();
248 248
                 break;
249 249
         }
250 250
 
251 251
         $tableName  = $this->class->table->getQuotedQualifiedName($this->platform);
252
-        $from       = ' FROM ' . $tableName . ' ' . $baseTableAlias;
253
-        $where      = $conditionSql !== '' ? ' WHERE ' . $conditionSql : '';
252
+        $from       = ' FROM '.$tableName.' '.$baseTableAlias;
253
+        $where      = $conditionSql !== '' ? ' WHERE '.$conditionSql : '';
254 254
         $lock       = $this->platform->appendLockHint($from, $lockMode);
255 255
         $columnList = $this->getSelectColumnsSQL();
256
-        $query      = 'SELECT ' . $columnList
256
+        $query      = 'SELECT '.$columnList
257 257
                     . $lock
258 258
                     . $joinSql
259 259
                     . $where
260 260
                     . $orderBySql;
261 261
 
262
-        return $this->platform->modifyLimitQuery($query, $limit, $offset ?? 0) . $lockSql;
262
+        return $this->platform->modifyLimitQuery($query, $limit, $offset ?? 0).$lockSql;
263 263
     }
264 264
 
265 265
     /**
@@ -281,14 +281,14 @@  discard block
 block discarded – undo
281 281
 
282 282
         if ($filterSql !== '') {
283 283
             $conditionSql = $conditionSql
284
-                ? $conditionSql . ' AND ' . $filterSql
284
+                ? $conditionSql.' AND '.$filterSql
285 285
                 : $filterSql;
286 286
         }
287 287
 
288 288
         return 'SELECT COUNT(*) '
289
-            . 'FROM ' . $tableName . ' ' . $baseTableAlias
289
+            . 'FROM '.$tableName.' '.$baseTableAlias
290 290
             . $joinSql
291
-            . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql);
291
+            . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql);
292 292
     }
293 293
 
294 294
     /**
@@ -307,18 +307,18 @@  discard block
 block discarded – undo
307 307
             $conditions = [];
308 308
             $tableName  = $parentClass->table->getQuotedQualifiedName($this->platform);
309 309
             $tableAlias = $this->getSQLTableAlias($parentClass->getTableName());
310
-            $joinSql   .= ' INNER JOIN ' . $tableName . ' ' . $tableAlias . ' ON ';
310
+            $joinSql   .= ' INNER JOIN '.$tableName.' '.$tableAlias.' ON ';
311 311
 
312 312
             foreach ($identifierColumns as $idColumn) {
313 313
                 $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName());
314 314
 
315
-                $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName;
315
+                $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName;
316 316
             }
317 317
 
318 318
             $joinSql .= implode(' AND ', $conditions);
319 319
         }
320 320
 
321
-        return parent::getLockTablesSql($lockMode) . $joinSql;
321
+        return parent::getLockTablesSql($lockMode).$joinSql;
322 322
     }
323 323
 
324 324
     /**
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
                 continue;
346 346
             }
347 347
 
348
-            if (! ($property instanceof ToOneAssociationMetadata) || ! $property->isOwningSide()) {
348
+            if ( ! ($property instanceof ToOneAssociationMetadata) || ! $property->isOwningSide()) {
349 349
                 continue;
350 350
             }
351 351
 
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
                 /** @var JoinColumnMetadata $joinColumn */
356 356
                 $referencedColumnName = $joinColumn->getReferencedColumnName();
357 357
 
358
-                if (! $joinColumn->getType()) {
358
+                if ( ! $joinColumn->getType()) {
359 359
                     $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
360 360
                 }
361 361
 
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
         $this->currentPersisterContext->rsm->setDiscriminatorColumn('r', $resultColumnName);
375 375
         $this->currentPersisterContext->rsm->addMetaResult('r', $resultColumnName, $discrColumnName, false, $discrColumnType);
376 376
 
377
-        $columnList[] = $discrColumnType->convertToDatabaseValueSQL($discrTableAlias . '.' . $quotedColumnName, $this->platform);
377
+        $columnList[] = $discrColumnType->convertToDatabaseValueSQL($discrTableAlias.'.'.$quotedColumnName, $this->platform);
378 378
 
379 379
         // sub tables
380 380
         foreach ($this->class->getSubClasses() as $subClassName) {
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
                             /** @var JoinColumnMetadata $joinColumn */
399 399
                             $referencedColumnName = $joinColumn->getReferencedColumnName();
400 400
 
401
-                            if (! $joinColumn->getType()) {
401
+                            if ( ! $joinColumn->getType()) {
402 402
                                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
403 403
                             }
404 404
 
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
                         $columnName           = $joinColumn->getColumnName();
449 449
                         $referencedColumnName = $joinColumn->getReferencedColumnName();
450 450
 
451
-                        if (! $joinColumn->getType()) {
451
+                        if ( ! $joinColumn->getType()) {
452 452
                             $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
453 453
                         }
454 454
 
@@ -504,12 +504,12 @@  discard block
 block discarded – undo
504 504
             $conditions = [];
505 505
             $tableName  = $parentClass->table->getQuotedQualifiedName($this->platform);
506 506
             $tableAlias = $this->getSQLTableAlias($parentClass->getTableName());
507
-            $joinSql   .= ' INNER JOIN ' . $tableName . ' ' . $tableAlias . ' ON ';
507
+            $joinSql   .= ' INNER JOIN '.$tableName.' '.$tableAlias.' ON ';
508 508
 
509 509
             foreach ($identifierColumns as $idColumn) {
510 510
                 $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName());
511 511
 
512
-                $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName;
512
+                $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName;
513 513
             }
514 514
 
515 515
             $joinSql .= implode(' AND ', $conditions);
@@ -521,12 +521,12 @@  discard block
 block discarded – undo
521 521
             $subClass   = $this->em->getClassMetadata($subClassName);
522 522
             $tableName  = $subClass->table->getQuotedQualifiedName($this->platform);
523 523
             $tableAlias = $this->getSQLTableAlias($subClass->getTableName());
524
-            $joinSql   .= ' LEFT JOIN ' . $tableName . ' ' . $tableAlias . ' ON ';
524
+            $joinSql   .= ' LEFT JOIN '.$tableName.' '.$tableAlias.' ON ';
525 525
 
526 526
             foreach ($identifierColumns as $idColumn) {
527 527
                 $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName());
528 528
 
529
-                $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName;
529
+                $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName;
530 530
             }
531 531
 
532 532
             $joinSql .= implode(' AND ', $conditions);
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -33,13 +33,13 @@
 block discarded – undo
33 33
     protected function configure()
34 34
     {
35 35
         $this->setName('orm:run-dql')
36
-             ->setDescription('Executes arbitrary DQL directly from the command line')
37
-             ->addArgument('dql', InputArgument::REQUIRED, 'The DQL to execute.')
38
-             ->addOption('hydrate', null, InputOption::VALUE_REQUIRED, 'Hydration mode of result set. Should be either: object, array, scalar or single-scalar.', 'object')
39
-             ->addOption('first-result', null, InputOption::VALUE_REQUIRED, 'The first result in the result set.')
40
-             ->addOption('max-result', null, InputOption::VALUE_REQUIRED, 'The maximum number of results in the result set.')
41
-             ->addOption('show-sql', null, InputOption::VALUE_NONE, 'Dump generated SQL instead of executing query')
42
-             ->setHelp('Executes arbitrary DQL directly from the command line.');
36
+                ->setDescription('Executes arbitrary DQL directly from the command line')
37
+                ->addArgument('dql', InputArgument::REQUIRED, 'The DQL to execute.')
38
+                ->addOption('hydrate', null, InputOption::VALUE_REQUIRED, 'Hydration mode of result set. Should be either: object, array, scalar or single-scalar.', 'object')
39
+                ->addOption('first-result', null, InputOption::VALUE_REQUIRED, 'The first result in the result set.')
40
+                ->addOption('max-result', null, InputOption::VALUE_REQUIRED, 'The maximum number of results in the result set.')
41
+                ->addOption('show-sql', null, InputOption::VALUE_NONE, 'Dump generated SQL instead of executing query')
42
+                ->setHelp('Executes arbitrary DQL directly from the command line.');
43 43
     }
44 44
 
45 45
     /**
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -58,9 +58,9 @@  discard block
 block discarded – undo
58 58
         }
59 59
 
60 60
         $hydrationModeName = $input->getOption('hydrate');
61
-        $hydrationMode     = 'Doctrine\ORM\Query::HYDRATE_' . strtoupper(str_replace('-', '_', $hydrationModeName));
61
+        $hydrationMode     = 'Doctrine\ORM\Query::HYDRATE_'.strtoupper(str_replace('-', '_', $hydrationModeName));
62 62
 
63
-        if (! defined($hydrationMode)) {
63
+        if ( ! defined($hydrationMode)) {
64 64
             throw new RuntimeException(sprintf(
65 65
                 "Hydration mode '%s' does not exist. It should be either: object. array, scalar or single-scalar.",
66 66
                 $hydrationModeName
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
         $firstResult = $input->getOption('first-result');
72 72
 
73 73
         if ($firstResult !== null) {
74
-            if (! is_numeric($firstResult)) {
74
+            if ( ! is_numeric($firstResult)) {
75 75
                 throw new LogicException("Option 'first-result' must contain an integer value");
76 76
             }
77 77
 
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
         $maxResult = $input->getOption('max-result');
82 82
 
83 83
         if ($maxResult !== null) {
84
-            if (! is_numeric($maxResult)) {
84
+            if ( ! is_numeric($maxResult)) {
85 85
                 throw new LogicException("Option 'max-result' must contain an integer value");
86 86
             }
87 87
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
         $resultSet = $query->execute([], constant($hydrationMode));
97 97
 
98
-        $dumper = new CliDumper(static function (string $payload) use ($output) : void {
98
+        $dumper = new CliDumper(static function(string $payload) use ($output) : void {
99 99
             $output->write($payload);
100 100
         });
101 101
         $dumper->dump((new VarCloner())->cloneVar($resultSet));
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Setup.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
     {
87 87
         $cache = self::createCacheInstance($isDevMode, $cache);
88 88
 
89
-        if (! $cache instanceof CacheProvider) {
89
+        if ( ! $cache instanceof CacheProvider) {
90 90
             return $cache;
91 91
         }
92 92
 
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
             $namespace .= ':';
97 97
         }
98 98
 
99
-        $cache->setNamespace($namespace . 'dc2_' . md5($proxyDir) . '_'); // to avoid collisions
99
+        $cache->setNamespace($namespace.'dc2_'.md5($proxyDir).'_'); // to avoid collisions
100 100
 
101 101
         return $cache;
102 102
     }
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Tools/SetupTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 
36 36
     public function tearDown() : void
37 37
     {
38
-        if (! $this->originalIncludePath) {
38
+        if ( ! $this->originalIncludePath) {
39 39
             return;
40 40
         }
41 41
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         $config = Setup::createConfiguration(false, __DIR__);
75 75
         $cache  = $config->getMetadataCacheImpl();
76 76
 
77
-        self::assertSame('dc2_' . md5(__DIR__) . '_', $cache->getNamespace());
77
+        self::assertSame('dc2_'.md5(__DIR__).'_', $cache->getNamespace());
78 78
     }
79 79
 
80 80
     /**
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
         $config = Setup::createConfiguration(false, __DIR__, new ArrayCache());
86 86
         $cache  = $config->getMetadataCacheImpl();
87 87
 
88
-        self::assertSame('dc2_' . md5(__DIR__) . '_', $cache->getNamespace());
88
+        self::assertSame('dc2_'.md5(__DIR__).'_', $cache->getNamespace());
89 89
     }
90 90
 
91 91
     /**
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
         $cache  = $config->getMetadataCacheImpl();
101 101
 
102 102
         self::assertSame($originalCache, $cache);
103
-        self::assertSame('foo:dc2_' . md5(__DIR__) . '_', $cache->getNamespace());
103
+        self::assertSame('foo:dc2_'.md5(__DIR__).'_', $cache->getNamespace());
104 104
     }
105 105
 
106 106
     /**
Please login to merge, or discard this patch.
tests/Doctrine/Performance/Query/QueryBoundParameterProcessingBench.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,8 +57,8 @@
 block discarded – undo
57 57
         $this->parsedQueryWithDeclaredParameterType = $entityManager->createQuery($dql);
58 58
 
59 59
         foreach (range(1, 10) as $index) {
60
-            $this->parsedQueryWithInferredParameterType->setParameter('parameter' . $index, new DateTime());
61
-            $this->parsedQueryWithDeclaredParameterType->setParameter('parameter' . $index, new DateTime(), DateTimeType::DATETIME);
60
+            $this->parsedQueryWithInferredParameterType->setParameter('parameter'.$index, new DateTime());
61
+            $this->parsedQueryWithDeclaredParameterType->setParameter('parameter'.$index, new DateTime(), DateTimeType::DATETIME);
62 62
         }
63 63
 
64 64
         // Force parsing upfront - we don't benchmark that bit in this scenario
Please login to merge, or discard this patch.
tests/Doctrine/Tests/Mocks/DriverMock.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
      */
35 35
     public function getDatabasePlatform()
36 36
     {
37
-        if (! $this->platformMock) {
37
+        if ( ! $this->platformMock) {
38 38
             $this->platformMock = new DatabasePlatformMock();
39 39
         }
40 40
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/Mocks/ConnectionMock.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@
 block discarded – undo
116 116
     public function quote($input, $type = null)
117 117
     {
118 118
         if (is_string($input)) {
119
-            return "'" . $input . "'";
119
+            return "'".$input."'";
120 120
         }
121 121
 
122 122
         return $input;
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Functional/Locking/LockAgentWorker.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 
37 37
         while ($worker->work()) {
38 38
             if ($worker->returnCode() !== GEARMAN_SUCCESS) {
39
-                echo 'return_code: ' . $worker->returnCode() . "\n";
39
+                echo 'return_code: '.$worker->returnCode()."\n";
40 40
                 break;
41 41
             }
42 42
         }
@@ -61,14 +61,14 @@  discard block
 block discarded – undo
61 61
 
62 62
     public function findWithLock($job)
63 63
     {
64
-        return $this->process($job, static function ($fixture, $em) {
64
+        return $this->process($job, static function($fixture, $em) {
65 65
             $entity = $em->find($fixture['entityName'], $fixture['entityId'], $fixture['lockMode']);
66 66
         });
67 67
     }
68 68
 
69 69
     public function dqlWithLock($job)
70 70
     {
71
-        return $this->process($job, static function ($fixture, $em) {
71
+        return $this->process($job, static function($fixture, $em) {
72 72
             /** @var Doctrine\ORM\Query $query */
73 73
             $query = $em->createQuery($fixture['dql']);
74 74
 
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 
81 81
     public function lock($job)
82 82
     {
83
-        return $this->process($job, static function ($fixture, $em) {
83
+        return $this->process($job, static function($fixture, $em) {
84 84
             $entity = $em->find($fixture['entityName'], $fixture['entityId']);
85 85
 
86 86
             $em->lock($entity, $fixture['lockMode']);
@@ -89,18 +89,18 @@  discard block
 block discarded – undo
89 89
 
90 90
     protected function processWorkload($job)
91 91
     {
92
-        echo 'Received job: ' . $job->handle() . ' for function ' . $job->functionName() . "\n";
92
+        echo 'Received job: '.$job->handle().' for function '.$job->functionName()."\n";
93 93
 
94 94
         $workload = $job->workload();
95 95
         $workload = unserialize($workload);
96 96
 
97
-        if (! isset($workload['conn']) || ! is_array($workload['conn'])) {
97
+        if ( ! isset($workload['conn']) || ! is_array($workload['conn'])) {
98 98
             throw new InvalidArgumentException('Missing Database parameters');
99 99
         }
100 100
 
101 101
         $this->em = $this->createEntityManager($workload['conn']);
102 102
 
103
-        if (! isset($workload['fixture'])) {
103
+        if ( ! isset($workload['fixture'])) {
104 104
             throw new InvalidArgumentException('Missing Fixture parameters');
105 105
         }
106 106
 
@@ -110,11 +110,11 @@  discard block
 block discarded – undo
110 110
     protected function createEntityManager($conn)
111 111
     {
112 112
         $config = new Configuration();
113
-        $config->setProxyDir(__DIR__ . '/../../../Proxies');
113
+        $config->setProxyDir(__DIR__.'/../../../Proxies');
114 114
         $config->setProxyNamespace('MyProject\Proxies');
115 115
         $config->setAutoGenerateProxyClasses(true);
116 116
 
117
-        $annotDriver = $config->newDefaultAnnotationDriver([__DIR__ . '/../../../Models/']);
117
+        $annotDriver = $config->newDefaultAnnotationDriver([__DIR__.'/../../../Models/']);
118 118
         $config->setMetadataDriverImpl($annotDriver);
119 119
 
120 120
         $cache = new ArrayCache();
Please login to merge, or discard this patch.
lib/Doctrine/ORM/PersistentObject.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
     {
80 80
         if ($entityManager !== self::$entityManager) {
81 81
             throw new RuntimeException(
82
-                'Trying to use PersistentObject with different EntityManager instances. ' .
82
+                'Trying to use PersistentObject with different EntityManager instances. '.
83 83
                 'Was PersistentObject::setEntityManager() called?'
84 84
             );
85 85
         }
@@ -104,8 +104,8 @@  discard block
 block discarded – undo
104 104
 
105 105
         $property = $this->cm->getProperty($field);
106 106
 
107
-        if (! $property) {
108
-            throw new BadMethodCallException("no field with name '" . $field . "' exists on '" . $this->cm->getClassName() . "'");
107
+        if ( ! $property) {
108
+            throw new BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getClassName()."'");
109 109
         }
110 110
 
111 111
         switch (true) {
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
                 $targetClassName = $property->getTargetEntity();
118 118
 
119 119
                 if ($args[0] !== null && ! ($args[0] instanceof $targetClassName)) {
120
-                    throw new InvalidArgumentException("Expected persistent object of type '" . $targetClassName . "'");
120
+                    throw new InvalidArgumentException("Expected persistent object of type '".$targetClassName."'");
121 121
                 }
122 122
 
123 123
                 $this->{$field} = $args[0];
@@ -143,8 +143,8 @@  discard block
 block discarded – undo
143 143
 
144 144
         $property = $this->cm->getProperty($field);
145 145
 
146
-        if (! $property) {
147
-            throw new BadMethodCallException("no field with name '" . $field . "' exists on '" . $this->cm->getClassName() . "'");
146
+        if ( ! $property) {
147
+            throw new BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getClassName()."'");
148 148
         }
149 149
 
150 150
         return $this->{$field};
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
         $mappedByField    = $property->getMappedBy();
167 167
         $targetMetadata   = self::$entityManager->getClassMetadata($property->getTargetEntity());
168 168
         $targetProperty   = $targetMetadata->getProperty($mappedByField);
169
-        $setterMethodName = ($targetProperty instanceof ToManyAssociationMetadata ? 'add' : 'set') . $mappedByField;
169
+        $setterMethodName = ($targetProperty instanceof ToManyAssociationMetadata ? 'add' : 'set').$mappedByField;
170 170
 
171 171
         $targetObject->{$setterMethodName}($this);
172 172
     }
@@ -188,21 +188,21 @@  discard block
 block discarded – undo
188 188
 
189 189
         $property = $this->cm->getProperty($field);
190 190
 
191
-        if (! $property) {
192
-            throw new BadMethodCallException("no field with name '" . $field . "' exists on '" . $this->cm->getClassName() . "'");
191
+        if ( ! $property) {
192
+            throw new BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getClassName()."'");
193 193
         }
194 194
 
195
-        if (! ($property instanceof ToManyAssociationMetadata)) {
196
-            throw new BadMethodCallException('There is no method add' . $field . '() on ' . $this->cm->getClassName());
195
+        if ( ! ($property instanceof ToManyAssociationMetadata)) {
196
+            throw new BadMethodCallException('There is no method add'.$field.'() on '.$this->cm->getClassName());
197 197
         }
198 198
 
199 199
         $targetClassName = $property->getTargetEntity();
200 200
 
201
-        if (! ($args[0] instanceof $targetClassName)) {
202
-            throw new InvalidArgumentException("Expected persistent object of type '" . $targetClassName . "'");
201
+        if ( ! ($args[0] instanceof $targetClassName)) {
202
+            throw new InvalidArgumentException("Expected persistent object of type '".$targetClassName."'");
203 203
         }
204 204
 
205
-        if (! ($this->{$field} instanceof Collection)) {
205
+        if ( ! ($this->{$field} instanceof Collection)) {
206 206
             $this->{$field} = new ArrayCollection($this->{$field} ?: []);
207 207
         }
208 208
 
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
             return;
225 225
         }
226 226
 
227
-        if (! self::$entityManager) {
227
+        if ( ! self::$entityManager) {
228 228
             throw new RuntimeException('No runtime entity manager set. Call PersistentObject#setEntityManager().');
229 229
         }
230 230
 
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
             case 'add':
255 255
                 return $this->add($field, $args);
256 256
             default:
257
-                throw new BadMethodCallException('There is no method ' . $method . ' on ' . $this->cm->getClassName());
257
+                throw new BadMethodCallException('There is no method '.$method.' on '.$this->cm->getClassName());
258 258
         }
259 259
     }
260 260
 }
Please login to merge, or discard this patch.