Passed
Pull Request — master (#262)
by
unknown
06:11 queued 03:05
created
src/AbstractTDBMObject.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
      */
258 258
     protected function setRef(string $foreignKeyName, ?AbstractTDBMObject $bean, string $tableName, string $className, string $resultIteratorClass): void
259 259
     {
260
-        assert($bean === null || is_a($bean, $className), new TDBMInvalidArgumentException('$bean should be `null` or `' . $className . '`. `' . ($bean === null ? 'null' : get_class($bean)) . '` provided.'));
260
+        assert($bean === null || is_a($bean, $className), new TDBMInvalidArgumentException('$bean should be `null` or `'.$className.'`. `'.($bean === null ? 'null' : get_class($bean)).'` provided.'));
261 261
 
262 262
         if (!isset($this->dbRows[$tableName])) {
263 263
             $this->registerTable($tableName);
@@ -521,7 +521,7 @@  discard block
 block discarded – undo
521 521
      */
522 522
     protected function retrieveManyToOneRelationshipsStorage(string $tableName, string $foreignKeyName, array $searchFilter, ?string $orderString, string $resultIteratorClass) : AlterableResultIterator
523 523
     {
524
-        assert(is_a($resultIteratorClass, ResultIterator::class, true), new TDBMInvalidArgumentException('$resultIteratorClass should be a `'. ResultIterator::class. '`. `' . $resultIteratorClass . '` provided.'));
524
+        assert(is_a($resultIteratorClass, ResultIterator::class, true), new TDBMInvalidArgumentException('$resultIteratorClass should be a `'.ResultIterator::class.'`. `'.$resultIteratorClass.'` provided.'));
525 525
         $key = $tableName.'___'.$foreignKeyName;
526 526
         $alterableResultIterator = $this->getManyToOneAlterableResultIterator($tableName, $foreignKeyName);
527 527
         if ($this->status === TDBMObjectStateEnum::STATE_DETACHED || $this->status === TDBMObjectStateEnum::STATE_NEW || (isset($this->manyToOneRelationships[$key]) && $this->manyToOneRelationships[$key]->getUnderlyingResultIterator() !== null)) {
Please login to merge, or discard this patch.
src/TDBMService.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -365,10 +365,10 @@  discard block
 block discarded – undo
365 365
 
366 366
                     $localTableName = $incomingFk->getLocalTableName();
367 367
 
368
-                    $className = $this->beanNamespace . '\\' . $this->namingStrategy->getBeanClassName($localTableName);
368
+                    $className = $this->beanNamespace.'\\'.$this->namingStrategy->getBeanClassName($localTableName);
369 369
                     assert(class_exists($className));
370 370
 
371
-                    $resultIteratorClassName = $this->resultIteratorNamespace . '\\' . $this->namingStrategy->getResultIteratorClassName($localTableName);
371
+                    $resultIteratorClassName = $this->resultIteratorNamespace.'\\'.$this->namingStrategy->getResultIteratorClassName($localTableName);
372 372
                     assert(class_exists($resultIteratorClassName));
373 373
 
374 374
                     $results = $this->findObjects(
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
                 }
439 439
             }
440 440
 
441
-            return ['(' . implode(') AND (', $sqlParts) . ')', $parameters, $counter];
441
+            return ['('.implode(') AND (', $sqlParts).')', $parameters, $counter];
442 442
         } elseif ($filter_bag instanceof ResultIterator) {
443 443
             $subQuery = $filter_bag->_getSubQuery();
444 444
             return [$subQuery, [], $counter];
@@ -1016,7 +1016,7 @@  discard block
 block discarded – undo
1016 1016
 
1017 1017
         return $this->fromCache(
1018 1018
             $this->cachePrefix.'_linkbetweeninheritedtables_'.implode('__split__', $tables),
1019
-            function () use ($tables) {
1019
+            function() use ($tables) {
1020 1020
                 return $this->_getLinkBetweenInheritedTablesWithoutCache($tables);
1021 1021
             }
1022 1022
         );
@@ -1064,7 +1064,7 @@  discard block
 block discarded – undo
1064 1064
      */
1065 1065
     public function _getRelatedTablesByInheritance(string $table): array
1066 1066
     {
1067
-        return $this->fromCache($this->cachePrefix.'_relatedtables_'.$table, function () use ($table) {
1067
+        return $this->fromCache($this->cachePrefix.'_relatedtables_'.$table, function() use ($table) {
1068 1068
             return $this->_getRelatedTablesByInheritanceWithoutCache($table);
1069 1069
         });
1070 1070
     }
@@ -1153,7 +1153,7 @@  discard block
 block discarded – undo
1153 1153
     public function findObjects(string $mainTable, $filter, array $parameters, $orderString, array $additionalTablesFetch, ?int $mode, ?string $className, string $resultIteratorClass): ResultIterator
1154 1154
     {
1155 1155
         if (!is_a($resultIteratorClass, ResultIterator::class, true)) {
1156
-            throw new TDBMInvalidArgumentException('$resultIteratorClass should be a `'. ResultIterator::class. '`. `' . $resultIteratorClass . '` provided.');
1156
+            throw new TDBMInvalidArgumentException('$resultIteratorClass should be a `'.ResultIterator::class.'`. `'.$resultIteratorClass.'` provided.');
1157 1157
         }
1158 1158
         // $mainTable is not secured in MagicJoin, let's add a bit of security to avoid SQL injection.
1159 1159
         if (!preg_match('/^[a-zA-Z_][a-zA-Z0-9_]*$/', $mainTable)) {
@@ -1190,7 +1190,7 @@  discard block
 block discarded – undo
1190 1190
     public function findObjectsFromSql(string $mainTable, string $from, $filter, array $parameters, $orderString, ?int $mode, ?string $className, string $resultIteratorClass): ResultIterator
1191 1191
     {
1192 1192
         if (!is_a($resultIteratorClass, ResultIterator::class, true)) {
1193
-            throw new TDBMInvalidArgumentException('$resultIteratorClass should be a `'. ResultIterator::class. '`. `' . $resultIteratorClass . '` provided.');
1193
+            throw new TDBMInvalidArgumentException('$resultIteratorClass should be a `'.ResultIterator::class.'`. `'.$resultIteratorClass.'` provided.');
1194 1194
         }
1195 1195
         // $mainTable is not secured in MagicJoin, let's add a bit of security to avoid SQL injection.
1196 1196
         if (!preg_match('/^[a-zA-Z_][a-zA-Z0-9_]*$/', $mainTable)) {
@@ -1223,8 +1223,8 @@  discard block
 block discarded – undo
1223 1223
      */
1224 1224
     public function findObjectByPk(string $table, array $primaryKeys, array $additionalTablesFetch, bool $lazy, string $className, string $resultIteratorClass): AbstractTDBMObject
1225 1225
     {
1226
-        assert(is_a($resultIteratorClass, ResultIterator::class, true), new TDBMInvalidArgumentException('$resultIteratorClass should be a `'. ResultIterator::class. '`. `' . $resultIteratorClass . '` provided.'));
1227
-        assert(is_a($className, AbstractTDBMObject::class, true), new TDBMInvalidArgumentException('$className should be a `'. AbstractTDBMObject::class. '`. `' . $className . '` provided.'));
1226
+        assert(is_a($resultIteratorClass, ResultIterator::class, true), new TDBMInvalidArgumentException('$resultIteratorClass should be a `'.ResultIterator::class.'`. `'.$resultIteratorClass.'` provided.'));
1227
+        assert(is_a($className, AbstractTDBMObject::class, true), new TDBMInvalidArgumentException('$className should be a `'.AbstractTDBMObject::class.'`. `'.$className.'` provided.'));
1228 1228
         $primaryKeys = $this->_getPrimaryKeysFromObjectData($table, $primaryKeys);
1229 1229
         $hash = $this->getObjectHash($primaryKeys);
1230 1230
 
@@ -1281,7 +1281,7 @@  discard block
 block discarded – undo
1281 1281
      */
1282 1282
     public function findObject(string $mainTable, $filter, array $parameters, array $additionalTablesFetch, string $className, string $resultIteratorClass) : ?AbstractTDBMObject
1283 1283
     {
1284
-        assert(is_a($resultIteratorClass, ResultIterator::class, true), new TDBMInvalidArgumentException('$resultIteratorClass should be a `'. ResultIterator::class. '`. `' . $resultIteratorClass . '` provided.'));
1284
+        assert(is_a($resultIteratorClass, ResultIterator::class, true), new TDBMInvalidArgumentException('$resultIteratorClass should be a `'.ResultIterator::class.'`. `'.$resultIteratorClass.'` provided.'));
1285 1285
         $objects = $this->findObjects($mainTable, $filter, $parameters, null, $additionalTablesFetch, self::MODE_ARRAY, $className, $resultIteratorClass);
1286 1286
         return $this->getAtMostOneObjectOrFail($objects, $mainTable, $filter, $parameters);
1287 1287
     }
@@ -1303,18 +1303,18 @@  discard block
 block discarded – undo
1303 1303
         if ($count > 1) {
1304 1304
             $additionalErrorInfos = '';
1305 1305
             if (is_string($filter) && !empty($parameters)) {
1306
-                $additionalErrorInfos = ' for filter "' . $filter.'"';
1306
+                $additionalErrorInfos = ' for filter "'.$filter.'"';
1307 1307
                 foreach ($parameters as $fieldName => $parameter) {
1308 1308
                     if (is_array($parameter)) {
1309
-                        $value = '(' . implode(',', $parameter) . ')';
1309
+                        $value = '('.implode(',', $parameter).')';
1310 1310
                     } else {
1311 1311
                         $value = $parameter;
1312 1312
                     }
1313
-                    $additionalErrorInfos = str_replace(':' . $fieldName, var_export($value, true), $additionalErrorInfos);
1313
+                    $additionalErrorInfos = str_replace(':'.$fieldName, var_export($value, true), $additionalErrorInfos);
1314 1314
                 }
1315 1315
             }
1316 1316
             $additionalErrorInfos .= '.';
1317
-            throw new DuplicateRowException("Error while querying an object in table '$mainTable': More than 1 row have been returned, but we should have received at most one" . $additionalErrorInfos);
1317
+            throw new DuplicateRowException("Error while querying an object in table '$mainTable': More than 1 row have been returned, but we should have received at most one".$additionalErrorInfos);
1318 1318
         } elseif ($count === 0) {
1319 1319
             return null;
1320 1320
         }
@@ -1338,7 +1338,7 @@  discard block
 block discarded – undo
1338 1338
      */
1339 1339
     public function findObjectFromSql(string $mainTable, string $from, $filter, array $parameters, ?string $className, string $resultIteratorClass) : ?AbstractTDBMObject
1340 1340
     {
1341
-        assert(is_a($resultIteratorClass, ResultIterator::class, true), new TDBMInvalidArgumentException('$resultIteratorClass should be a `'. ResultIterator::class. '`. `' . $resultIteratorClass . '` provided.'));
1341
+        assert(is_a($resultIteratorClass, ResultIterator::class, true), new TDBMInvalidArgumentException('$resultIteratorClass should be a `'.ResultIterator::class.'`. `'.$resultIteratorClass.'` provided.'));
1342 1342
         $objects = $this->findObjectsFromSql($mainTable, $from, $filter, $parameters, null, self::MODE_ARRAY, $className, $resultIteratorClass);
1343 1343
         return $this->getAtMostOneObjectOrFail($objects, $mainTable, $filter, $parameters);
1344 1344
     }
@@ -1359,7 +1359,7 @@  discard block
 block discarded – undo
1359 1359
     public function findObjectsFromRawSql(string $mainTable, string $sql, array $parameters, ?int $mode, ?string $className, ?string $sqlCount, string $resultIteratorClass): ResultIterator
1360 1360
     {
1361 1361
         if (!is_a($resultIteratorClass, ResultIterator::class, true)) {
1362
-            throw new TDBMInvalidArgumentException('$resultIteratorClass should be a `'. ResultIterator::class. '`. `' . $resultIteratorClass . '` provided.');
1362
+            throw new TDBMInvalidArgumentException('$resultIteratorClass should be a `'.ResultIterator::class.'`. `'.$resultIteratorClass.'` provided.');
1363 1363
         }
1364 1364
         // $mainTable is not secured in MagicJoin, let's add a bit of security to avoid SQL injection.
1365 1365
         if (!preg_match('/^[a-zA-Z_][a-zA-Z0-9_]*$/', $mainTable)) {
@@ -1390,7 +1390,7 @@  discard block
 block discarded – undo
1390 1390
      */
1391 1391
     public function findObjectOrFail(string $mainTable, $filter, array $parameters, array $additionalTablesFetch, string $className, string $resultIteratorClass): AbstractTDBMObject
1392 1392
     {
1393
-        assert(is_a($resultIteratorClass, ResultIterator::class, true), new TDBMInvalidArgumentException('$resultIteratorClass should be a `'. ResultIterator::class. '`. `' . $resultIteratorClass . '` provided.'));
1393
+        assert(is_a($resultIteratorClass, ResultIterator::class, true), new TDBMInvalidArgumentException('$resultIteratorClass should be a `'.ResultIterator::class.'`. `'.$resultIteratorClass.'` provided.'));
1394 1394
         $bean = $this->findObject($mainTable, $filter, $parameters, $additionalTablesFetch, $className, $resultIteratorClass);
1395 1395
         if ($bean === null) {
1396 1396
             throw NoBeanFoundException::missFilterRecord($mainTable);
@@ -1500,7 +1500,7 @@  discard block
 block discarded – undo
1500 1500
         $table1 = $fks[0]->getForeignTableName();
1501 1501
         $table2 = $fks[1]->getForeignTableName();
1502 1502
 
1503
-        $beanTables = array_map(function (DbRow $dbRow) {
1503
+        $beanTables = array_map(function(DbRow $dbRow) {
1504 1504
             return $dbRow->_getDbTableName();
1505 1505
         }, $bean->_getDbRows());
1506 1506
 
Please login to merge, or discard this patch.
src/Utils/BeanDescriptor.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
      */
216 216
     public function getConstructorProperties(): array
217 217
     {
218
-        $constructorProperties = array_filter($this->beanPropertyDescriptors, static function (AbstractBeanPropertyDescriptor $property) {
218
+        $constructorProperties = array_filter($this->beanPropertyDescriptors, static function(AbstractBeanPropertyDescriptor $property) {
219 219
             return !$property instanceof InheritanceReferencePropertyDescriptor && $property->isCompulsory() && !$property->isReadOnly();
220 220
         });
221 221
 
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
     public function getPropertiesWithDefault(): array
231 231
     {
232 232
         $properties = $this->getPropertiesForTable($this->table);
233
-        $defaultProperties = array_filter($properties, function (AbstractBeanPropertyDescriptor $property) {
233
+        $defaultProperties = array_filter($properties, function(AbstractBeanPropertyDescriptor $property) {
234 234
             return $property->hasDefault();
235 235
         });
236 236
 
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
      */
245 245
     public function getExposedProperties(): array
246 246
     {
247
-        $exposedProperties = array_filter($this->beanPropertyDescriptors, function (AbstractBeanPropertyDescriptor $property) {
247
+        $exposedProperties = array_filter($this->beanPropertyDescriptors, function(AbstractBeanPropertyDescriptor $property) {
248 248
             return !$property instanceof InheritanceReferencePropertyDescriptor && $property->getTable()->getName() === $this->table->getName();
249 249
         });
250 250
 
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
         foreach ($beanPropertyDescriptors as $beanDescriptor) {
351 351
             $name = $beanDescriptor->getGetterName();
352 352
             if (isset($names[$name])) {
353
-                throw new TDBMException('Unsolvable name conflict while generating method name "' . $name . '"');
353
+                throw new TDBMException('Unsolvable name conflict while generating method name "'.$name.'"');
354 354
             } else {
355 355
                 $names[$name] = $beanDescriptor;
356 356
             }
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
             $assigns[] = $property->assignToDefaultCode()."\n";
400 400
         }
401 401
 
402
-        $body = $parentConstructorCode . implode('', $assigns);
402
+        $body = $parentConstructorCode.implode('', $assigns);
403 403
 
404 404
         $constructor->setBody($body);
405 405
 
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
         $this->descriptorsByMethodName[$name][] = $descriptor;
474 474
         $descriptors = $this->descriptorsByMethodName[$name];
475 475
         if (count($descriptors) > 1) {
476
-            $properties = array_filter($descriptors, function ($descriptor) {
476
+            $properties = array_filter($descriptors, function($descriptor) {
477 477
                 return $descriptor instanceof AbstractBeanPropertyDescriptor;
478 478
             });
479 479
             $renameProperties = count($properties) > 1;
@@ -524,7 +524,7 @@  discard block
 block discarded – undo
524 524
         foreach ($this->getExposedProperties() as $beanPropertyDescriptor) {
525 525
             $propertyCode = $beanPropertyDescriptor->getJsonSerializeCode();
526 526
             if (!empty($propertyCode)) {
527
-                $body .= PHP_EOL . $propertyCode;
527
+                $body .= PHP_EOL.$propertyCode;
528 528
             }
529 529
         }
530 530
 
@@ -532,11 +532,11 @@  discard block
 block discarded – undo
532 532
         foreach ($this->getMethodDescriptors() as $methodDescriptor) {
533 533
             $methodCode = $methodDescriptor->getJsonSerializeCode();
534 534
             if (!empty($methodCode)) {
535
-                $body .= PHP_EOL . $methodCode;
535
+                $body .= PHP_EOL.$methodCode;
536 536
             }
537 537
         }
538 538
 
539
-        $body .= PHP_EOL . 'return $array;';
539
+        $body .= PHP_EOL.'return $array;';
540 540
 
541 541
         $method->setBody($body);
542 542
 
@@ -632,10 +632,10 @@  discard block
 block discarded – undo
632 632
         /** @var AddInterface[] $addInterfaceAnnotations */
633 633
         $addInterfaceAnnotations = $this->annotationParser->getTableAnnotations($this->table)->findAnnotations(AddInterface::class);
634 634
 
635
-        $interfaces = [ JsonSerializable::class ];
635
+        $interfaces = [JsonSerializable::class];
636 636
         foreach ($addInterfaceAnnotations as $annotation) {
637 637
             /** @phpstan-var class-string $className */
638
-            $className =  $annotation->getName();
638
+            $className = $annotation->getName();
639 639
             $interfaces[] = $className;
640 640
         }
641 641
 
@@ -674,7 +674,7 @@  discard block
 block discarded – undo
674 674
                 }
675 675
             } elseif ($methodDescriptor instanceof PivotTableMethodsDescriptor) {
676 676
                 $pivotTableMethodsDescriptors[] = $methodDescriptor;
677
-                [ $getter, $adder, $remover, $has, $setter ] = $methodDescriptor->getCode();
677
+                [$getter, $adder, $remover, $has, $setter] = $methodDescriptor->getCode();
678 678
                 $methods = $this->codeGeneratorListener->onBaseBeanManyToManyGenerated($getter, $adder, $remover, $has, $setter, $methodDescriptor, $this, $this->configuration, $class);
679 679
                 foreach ($methods as $method) {
680 680
                     if ($method) {
@@ -804,7 +804,7 @@  discard block
 block discarded – undo
804 804
         $interfaces = [];
805 805
         foreach ($addInterfaceOnDaoAnnotations as $annotation) {
806 806
             /** @phpstan-var class-string $className */
807
-            $className =  $annotation->getName();
807
+            $className = $annotation->getName();
808 808
             $interfaces[] = $className;
809 809
         }
810 810
 
@@ -826,7 +826,7 @@  discard block
 block discarded – undo
826 826
 
827 827
         $constructorMethod = new MethodGenerator(
828 828
             '__construct',
829
-            [ new ParameterGenerator('tdbmService', TDBMService::class) ],
829
+            [new ParameterGenerator('tdbmService', TDBMService::class)],
830 830
             MethodGenerator::FLAG_PUBLIC,
831 831
             '$this->tdbmService = $tdbmService;',
832 832
             'Sets the TDBM service used by this DAO.'
@@ -838,7 +838,7 @@  discard block
 block discarded – undo
838 838
 
839 839
         $saveMethod = new MethodGenerator(
840 840
             'save',
841
-            [ new ParameterGenerator('obj', $beanClassName) ],
841
+            [new ParameterGenerator('obj', $beanClassName)],
842 842
             MethodGenerator::FLAG_PUBLIC,
843 843
             '$this->tdbmService->save($obj);',
844 844
             (new DocBlockGenerator(
@@ -886,7 +886,7 @@  discard block
 block discarded – undo
886 886
 
887 887
             foreach ($primaryKeyColumns as $primaryKeyColumn) {
888 888
                 if ($primaryKeyColumn === $lazyLoadingParameterName) {
889
-                    throw new TDBMException('Primary Column name `' . $lazyLoadingParameterName . '` is not allowed.');
889
+                    throw new TDBMException('Primary Column name `'.$lazyLoadingParameterName.'` is not allowed.');
890 890
                 }
891 891
                 $phpType = TDBMDaoGenerator::dbalTypeToPhpType($this->table->getColumn($primaryKeyColumn)->getType());
892 892
                 $parameters[] = new ParameterGenerator($primaryKeyColumn, $phpType);
@@ -902,7 +902,7 @@  discard block
 block discarded – undo
902 902
                 'getById',
903 903
                 $parameters,
904 904
                 MethodGenerator::FLAG_PUBLIC,
905
-                "return \$this->tdbmService->findObjectByPk('$tableName', [" . implode(', ', $primaryKeyFilter) . "], [], \$$lazyLoadingParameterName, \\$beanClassName::class, \\$resultIteratorClass::class);",
905
+                "return \$this->tdbmService->findObjectByPk('$tableName', [".implode(', ', $primaryKeyFilter)."], [], \$$lazyLoadingParameterName, \\$beanClassName::class, \\$resultIteratorClass::class);",
906 906
                 (new DocBlockGenerator(
907 907
                     "Get $beanClassWithoutNameSpace specified by its ID (its primary key).",
908 908
                     'If the primary key does not exist, an exception is thrown.',
@@ -1190,7 +1190,7 @@  discard block
 block discarded – undo
1190 1190
             $class->addUse(ResultIterator::class);
1191 1191
             $class->setExtendedClass(ResultIterator::class);
1192 1192
         } else {
1193
-            $class->addUse($this->resultIteratorNamespace . '\\' . $extends);
1193
+            $class->addUse($this->resultIteratorNamespace.'\\'.$extends);
1194 1194
             /** @var class-string $extends */
1195 1195
             $class->setExtendedClass($extends);
1196 1196
         }
@@ -1198,7 +1198,7 @@  discard block
 block discarded – undo
1198 1198
         $class->setDocBlock((new DocBlockGenerator(
1199 1199
             "The $baseClassName class will iterate over results of $beanClassWithoutNameSpace class.",
1200 1200
             null,
1201
-            [new Tag\MethodTag('getIterator', ['\\' . $beanClassName . '[]'])]
1201
+            [new Tag\MethodTag('getIterator', ['\\'.$beanClassName.'[]'])]
1202 1202
         ))->setWordWrap(false));
1203 1203
 
1204 1204
         $file = $this->codeGeneratorListener->onBaseResultIteratorGenerated($file, $this, $this->configuration);
@@ -1254,7 +1254,7 @@  discard block
 block discarded – undo
1254 1254
                 }
1255 1255
             }
1256 1256
         }
1257
-        usort($methods, static function (MethodGenerator $methodA, MethodGenerator $methodB) {
1257
+        usort($methods, static function(MethodGenerator $methodA, MethodGenerator $methodB) {
1258 1258
             return $methodA->getName() <=> $methodB->getName();
1259 1259
         });
1260 1260
 
@@ -1403,11 +1403,11 @@  discard block
 block discarded – undo
1403 1403
 
1404 1404
         if ($index->isUnique()) {
1405 1405
             $parameters[] = new ParameterGenerator('additionalTablesFetch', 'array', []);
1406
-            $params[] = new ParamTag('additionalTablesFetch', [ 'string[]' ], 'A list of additional tables to fetch (for performance improvement)');
1407
-            $params[] = new ReturnTag([ '\\'.$beanNamespace.'\\'.$beanClassName, 'null' ]);
1406
+            $params[] = new ParamTag('additionalTablesFetch', ['string[]'], 'A list of additional tables to fetch (for performance improvement)');
1407
+            $params[] = new ReturnTag(['\\'.$beanNamespace.'\\'.$beanClassName, 'null']);
1408 1408
             $method->setReturnType('?\\'.$beanNamespace.'\\'.$beanClassName);
1409 1409
 
1410
-            $docBlock = new DocBlockGenerator("Get a $beanClassName filtered by ".implode(', ', $commentArguments). '.', null, $params);
1410
+            $docBlock = new DocBlockGenerator("Get a $beanClassName filtered by ".implode(', ', $commentArguments).'.', null, $params);
1411 1411
             $docBlock->setWordWrap(false);
1412 1412
 
1413 1413
             $body = "\$filter = [
@@ -1416,12 +1416,12 @@  discard block
 block discarded – undo
1416 1416
 ";
1417 1417
         } else {
1418 1418
             $parameters[] = (new ParameterGenerator('orderBy'))->setDefaultValue(null);
1419
-            $params[] = new ParamTag('orderBy', [ 'mixed' ], 'The order string');
1419
+            $params[] = new ParamTag('orderBy', ['mixed'], 'The order string');
1420 1420
             $parameters[] = new ParameterGenerator('additionalTablesFetch', 'array', []);
1421
-            $params[] = new ParamTag('additionalTablesFetch', [ 'string[]' ], 'A list of additional tables to fetch (for performance improvement)');
1421
+            $params[] = new ParamTag('additionalTablesFetch', ['string[]'], 'A list of additional tables to fetch (for performance improvement)');
1422 1422
             $parameters[] = (new ParameterGenerator('mode', '?int'))->setDefaultValue(null);
1423
-            $params[] = new ParamTag('mode', [ 'int', 'null' ], 'Either TDBMService::MODE_ARRAY or TDBMService::MODE_CURSOR (for large datasets). Defaults to TDBMService::MODE_ARRAY.');
1424
-            $method->setReturnType($this->resultIteratorNamespace . '\\' . $this->getResultIteratorClassName());
1423
+            $params[] = new ParamTag('mode', ['int', 'null'], 'Either TDBMService::MODE_ARRAY or TDBMService::MODE_CURSOR (for large datasets). Defaults to TDBMService::MODE_ARRAY.');
1424
+            $method->setReturnType($this->resultIteratorNamespace.'\\'.$this->getResultIteratorClassName());
1425 1425
 
1426 1426
             $docBlock = new DocBlockGenerator("Get a list of $beanClassName filtered by ".implode(', ', $commentArguments).".", null, $params);
1427 1427
             $docBlock->setWordWrap(false);
@@ -1481,8 +1481,8 @@  discard block
 block discarded – undo
1481 1481
                     var_export($tdbmFk->getCacheKey(), true),
1482 1482
                     'null',
1483 1483
                     var_export($this->table->getName(), true),
1484
-                    '\\' . $this->beanNamespace . '\\' . $this->namingStrategy->getBeanClassName($foreignTableName) . '::class',
1485
-                    '\\' . $this->resultIteratorNamespace . '\\' . $this->namingStrategy->getResultIteratorClassName($foreignTableName) . '::class'
1484
+                    '\\'.$this->beanNamespace.'\\'.$this->namingStrategy->getBeanClassName($foreignTableName).'::class',
1485
+                    '\\'.$this->resultIteratorNamespace.'\\'.$this->namingStrategy->getResultIteratorClassName($foreignTableName).'::class'
1486 1486
                 );
1487 1487
             }
1488 1488
         }
@@ -1756,17 +1756,17 @@  discard block
 block discarded – undo
1756 1756
      * @param string $indent
1757 1757
      * @return string
1758 1758
      */
1759
-    private function psr2VarExport($var, string $indent=''): string
1759
+    private function psr2VarExport($var, string $indent = ''): string
1760 1760
     {
1761 1761
         if (is_array($var)) {
1762 1762
             $indexed = array_keys($var) === range(0, count($var) - 1);
1763 1763
             $r = [];
1764 1764
             foreach ($var as $key => $value) {
1765 1765
                 $r[] = "$indent    "
1766
-                    . ($indexed ? '' : $this->psr2VarExport($key) . ' => ')
1766
+                    . ($indexed ? '' : $this->psr2VarExport($key).' => ')
1767 1767
                     . $this->psr2VarExport($value, "$indent    ");
1768 1768
             }
1769
-            return "[\n" . implode(",\n", $r) . "\n" . $indent . ']';
1769
+            return "[\n".implode(",\n", $r)."\n".$indent.']';
1770 1770
         }
1771 1771
         return var_export($var, true);
1772 1772
     }
Please login to merge, or discard this patch.
src/Utils/ManyToManyRelationshipPathDescriptor.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
      */
47 47
     public function __construct(string $targetTable, string $pivotTable, array $joinForeignKeys, array $joinLocalKeys, array $whereKeys, string $resultIteratorClass)
48 48
     {
49
-        assert(is_a($resultIteratorClass, ResultIterator::class, true), new TDBMInvalidArgumentException('$resultIteratorClass should be a `'. ResultIterator::class. '`. `' . $resultIteratorClass . '` provided.'));
49
+        assert(is_a($resultIteratorClass, ResultIterator::class, true), new TDBMInvalidArgumentException('$resultIteratorClass should be a `'.ResultIterator::class.'`. `'.$resultIteratorClass.'` provided.'));
50 50
         $this->targetTable = $targetTable;
51 51
         $this->pivotTable = $pivotTable;
52 52
         $this->joinForeignKeys = $joinForeignKeys;
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 
58 58
     public static function generateModelKey(ForeignKeyConstraint $remoteFk, ForeignKeyConstraint $localFk): string
59 59
     {
60
-        return $remoteFk->getLocalTableName() . "." . implode("__", $localFk->getUnquotedLocalColumns());
60
+        return $remoteFk->getLocalTableName().".".implode("__", $localFk->getUnquotedLocalColumns());
61 61
     }
62 62
 
63 63
     public function getPivotName(): string
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
             );
92 92
         }
93 93
 
94
-        return $platform->quoteIdentifier($mainTable) . ' JOIN ' . $platform->quoteIdentifier($pivotTable) . ' ON ' . implode(' AND ', $join);
94
+        return $platform->quoteIdentifier($mainTable).' JOIN '.$platform->quoteIdentifier($pivotTable).' ON '.implode(' AND ', $join);
95 95
     }
96 96
 
97 97
     /**
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
     {
117 117
         $params = [];
118 118
         foreach ($primaryKeys as $key => $primaryKeyValue) {
119
-            $params['param' . $key] = $primaryKeyValue;
119
+            $params['param'.$key] = $primaryKeyValue;
120 120
         }
121 121
         return $params;
122 122
     }
Please login to merge, or discard this patch.