Passed
Pull Request — master (#251)
by
unknown
08:40
created
src/Utils/ManyToManyRelationshipPathDescriptor.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 
49 49
     public static function generateModelKey(ForeignKeyConstraint $remoteFk, ForeignKeyConstraint $localFk): string
50 50
     {
51
-        return $remoteFk->getLocalTableName() . "." . implode("__", $localFk->getUnquotedLocalColumns());
51
+        return $remoteFk->getLocalTableName().".".implode("__", $localFk->getUnquotedLocalColumns());
52 52
     }
53 53
 
54 54
     public function getPivotName(): string
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
             $join[] = sprintf('%s.%s = %s.%s', $mainTable, $column, $pivotTable, $this->joinLocalKeys[$key]);
72 72
         }
73 73
 
74
-        return $mainTable . ' JOIN ' . $pivotTable . ' ON ' . implode(' AND ', $join);
74
+        return $mainTable.' JOIN '.$pivotTable.' ON '.implode(' AND ', $join);
75 75
     }
76 76
 
77 77
     public function getPivotWhere(): string
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
     {
92 92
         $params = [];
93 93
         foreach ($primaryKeys as $key => $primaryKeyValue) {
94
-            $params['param' . $key] = $primaryKeyValue;
94
+            $params['param'.$key] = $primaryKeyValue;
95 95
         }
96 96
         return $params;
97 97
     }
Please login to merge, or discard this patch.
src/Utils/BeanDescriptor.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
      */
215 215
     public function getConstructorProperties(): array
216 216
     {
217
-        $constructorProperties = array_filter($this->beanPropertyDescriptors, static function (AbstractBeanPropertyDescriptor $property) {
217
+        $constructorProperties = array_filter($this->beanPropertyDescriptors, static function(AbstractBeanPropertyDescriptor $property) {
218 218
             return !$property instanceof InheritanceReferencePropertyDescriptor && $property->isCompulsory() && !$property->isReadOnly();
219 219
         });
220 220
 
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
     public function getPropertiesWithDefault(): array
230 230
     {
231 231
         $properties = $this->getPropertiesForTable($this->table);
232
-        $defaultProperties = array_filter($properties, function (AbstractBeanPropertyDescriptor $property) {
232
+        $defaultProperties = array_filter($properties, function(AbstractBeanPropertyDescriptor $property) {
233 233
             return $property->hasDefault();
234 234
         });
235 235
 
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
      */
244 244
     public function getExposedProperties(): array
245 245
     {
246
-        $exposedProperties = array_filter($this->beanPropertyDescriptors, function (AbstractBeanPropertyDescriptor $property) {
246
+        $exposedProperties = array_filter($this->beanPropertyDescriptors, function(AbstractBeanPropertyDescriptor $property) {
247 247
             return !$property instanceof InheritanceReferencePropertyDescriptor && $property->getTable()->getName() === $this->table->getName();
248 248
         });
249 249
 
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
         foreach ($beanPropertyDescriptors as $beanDescriptor) {
350 350
             $name = $beanDescriptor->getGetterName();
351 351
             if (isset($names[$name])) {
352
-                throw new TDBMException('Unsolvable name conflict while generating method name "' . $name . '"');
352
+                throw new TDBMException('Unsolvable name conflict while generating method name "'.$name.'"');
353 353
             } else {
354 354
                 $names[$name] = $beanDescriptor;
355 355
             }
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
             $assigns[] = $property->assignToDefaultCode()."\n";
399 399
         }
400 400
 
401
-        $body = $parentConstructorCode . implode('', $assigns);
401
+        $body = $parentConstructorCode.implode('', $assigns);
402 402
 
403 403
         $constructor->setBody($body);
404 404
 
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
         $this->descriptorsByMethodName[$name][] = $descriptor;
473 473
         $descriptors = $this->descriptorsByMethodName[$name];
474 474
         if (count($descriptors) > 1) {
475
-            $properties = array_filter($descriptors, function ($descriptor) {
475
+            $properties = array_filter($descriptors, function($descriptor) {
476 476
                 return $descriptor instanceof AbstractBeanPropertyDescriptor;
477 477
             });
478 478
             $renameProperties = count($properties) > 1;
@@ -523,7 +523,7 @@  discard block
 block discarded – undo
523 523
         foreach ($this->getExposedProperties() as $beanPropertyDescriptor) {
524 524
             $propertyCode = $beanPropertyDescriptor->getJsonSerializeCode();
525 525
             if (!empty($propertyCode)) {
526
-                $body .= PHP_EOL . $propertyCode;
526
+                $body .= PHP_EOL.$propertyCode;
527 527
             }
528 528
         }
529 529
 
@@ -531,11 +531,11 @@  discard block
 block discarded – undo
531 531
         foreach ($this->getMethodDescriptors() as $methodDescriptor) {
532 532
             $methodCode = $methodDescriptor->getJsonSerializeCode();
533 533
             if (!empty($methodCode)) {
534
-                $body .= PHP_EOL . $methodCode;
534
+                $body .= PHP_EOL.$methodCode;
535 535
             }
536 536
         }
537 537
 
538
-        $body .= PHP_EOL . 'return $array;';
538
+        $body .= PHP_EOL.'return $array;';
539 539
 
540 540
         $method->setBody($body);
541 541
 
@@ -630,7 +630,7 @@  discard block
 block discarded – undo
630 630
         /** @var AddInterface[] $addInterfaceAnnotations */
631 631
         $addInterfaceAnnotations = $this->annotationParser->getTableAnnotations($this->table)->findAnnotations(AddInterface::class);
632 632
 
633
-        $interfaces = [ JsonSerializable::class ];
633
+        $interfaces = [JsonSerializable::class];
634 634
         foreach ($addInterfaceAnnotations as $annotation) {
635 635
             $interfaces[] = $annotation->getName();
636 636
         }
@@ -670,7 +670,7 @@  discard block
 block discarded – undo
670 670
                 }
671 671
             } elseif ($methodDescriptor instanceof PivotTableMethodsDescriptor) {
672 672
                 $pivotTableMethodsDescriptors[] = $methodDescriptor;
673
-                [ $getter, $adder, $remover, $has, $setter ] = $methodDescriptor->getCode();
673
+                [$getter, $adder, $remover, $has, $setter] = $methodDescriptor->getCode();
674 674
                 $methods = $this->codeGeneratorListener->onBaseBeanManyToManyGenerated($getter, $adder, $remover, $has, $setter, $methodDescriptor, $this, $this->configuration, $class);
675 675
                 foreach ($methods as $method) {
676 676
                     if ($method) {
@@ -818,7 +818,7 @@  discard block
 block discarded – undo
818 818
 
819 819
         $constructorMethod = new MethodGenerator(
820 820
             '__construct',
821
-            [ new ParameterGenerator('tdbmService', TDBMService::class) ],
821
+            [new ParameterGenerator('tdbmService', TDBMService::class)],
822 822
             MethodGenerator::FLAG_PUBLIC,
823 823
             '$this->tdbmService = $tdbmService;',
824 824
             'Sets the TDBM service used by this DAO.'
@@ -830,7 +830,7 @@  discard block
 block discarded – undo
830 830
 
831 831
         $saveMethod = new MethodGenerator(
832 832
             'save',
833
-            [ new ParameterGenerator('obj', $beanClassName) ],
833
+            [new ParameterGenerator('obj', $beanClassName)],
834 834
             MethodGenerator::FLAG_PUBLIC,
835 835
             '$this->tdbmService->save($obj);',
836 836
             (new DocBlockGenerator(
@@ -864,7 +864,7 @@  discard block
 block discarded – undo
864 864
             $findAllBody,
865 865
             (new DocBlockGenerator("Get all $beanClassWithoutNameSpace records."))->setWordWrap(false)
866 866
         );
867
-        $findAllMethod->setReturnType($this->resultIteratorNamespace . '\\' . $this->getResultIteratorClassName());
867
+        $findAllMethod->setReturnType($this->resultIteratorNamespace.'\\'.$this->getResultIteratorClassName());
868 868
         $findAllMethod = $this->codeGeneratorListener->onBaseDaoFindAllGenerated($findAllMethod, $this, $this->configuration, $class);
869 869
         if ($findAllMethod !== null) {
870 870
             $class->addMethodFromGenerator($findAllMethod);
@@ -878,7 +878,7 @@  discard block
 block discarded – undo
878 878
 
879 879
             foreach ($primaryKeyColumns as $primaryKeyColumn) {
880 880
                 if ($primaryKeyColumn === $lazyLoadingParameterName) {
881
-                    throw new TDBMException('Primary Column name `' . $lazyLoadingParameterName . '` is not allowed.');
881
+                    throw new TDBMException('Primary Column name `'.$lazyLoadingParameterName.'` is not allowed.');
882 882
                 }
883 883
                 $phpType = TDBMDaoGenerator::dbalTypeToPhpType($this->table->getColumn($primaryKeyColumn)->getType());
884 884
                 $parameters[] = new ParameterGenerator($primaryKeyColumn, $phpType);
@@ -894,7 +894,7 @@  discard block
 block discarded – undo
894 894
                 'getById',
895 895
                 $parameters,
896 896
                 MethodGenerator::FLAG_PUBLIC,
897
-                "return \$this->tdbmService->findObjectByPk('$tableName', [" . implode(', ', $primaryKeyFilter) . "], [], \$$lazyLoadingParameterName);",
897
+                "return \$this->tdbmService->findObjectByPk('$tableName', [".implode(', ', $primaryKeyFilter)."], [], \$$lazyLoadingParameterName);",
898 898
                 (new DocBlockGenerator(
899 899
                     "Get $beanClassWithoutNameSpace specified by its ID (its primary key).",
900 900
                     'If the primary key does not exist, an exception is thrown.',
@@ -971,7 +971,7 @@  discard block
 block discarded – undo
971 971
                 ]
972 972
             ))->setWordWrap(false)
973 973
         );
974
-        $findMethod->setReturnType($this->resultIteratorNamespace . '\\' . $this->getResultIteratorClassName());
974
+        $findMethod->setReturnType($this->resultIteratorNamespace.'\\'.$this->getResultIteratorClassName());
975 975
         $findMethod = $this->codeGeneratorListener->onBaseDaoFindGenerated($findMethod, $this, $this->configuration, $class);
976 976
         if ($findMethod !== null) {
977 977
             $class->addMethodFromGenerator($findMethod);
@@ -1013,7 +1013,7 @@  discard block
 block discarded – undo
1013 1013
                 ]
1014 1014
             ))->setWordWrap(false)
1015 1015
         );
1016
-        $findFromSqlMethod->setReturnType($this->resultIteratorNamespace . '\\' . $this->getResultIteratorClassName());
1016
+        $findFromSqlMethod->setReturnType($this->resultIteratorNamespace.'\\'.$this->getResultIteratorClassName());
1017 1017
         $findFromSqlMethod = $this->codeGeneratorListener->onBaseDaoFindFromSqlGenerated($findFromSqlMethod, $this, $this->configuration, $class);
1018 1018
         if ($findFromSqlMethod !== null) {
1019 1019
             $class->addMethodFromGenerator($findFromSqlMethod);
@@ -1048,7 +1048,7 @@  discard block
 block discarded – undo
1048 1048
                 ]
1049 1049
             ))->setWordWrap(false)
1050 1050
         );
1051
-        $findFromRawSqlMethod->setReturnType($this->resultIteratorNamespace . '\\' . $this->getResultIteratorClassName());
1051
+        $findFromRawSqlMethod->setReturnType($this->resultIteratorNamespace.'\\'.$this->getResultIteratorClassName());
1052 1052
         $findFromRawSqlMethod = $this->codeGeneratorListener->onBaseDaoFindFromRawSqlGenerated($findFromRawSqlMethod, $this, $this->configuration, $class);
1053 1053
         if ($findFromRawSqlMethod !== null) {
1054 1054
             $class->addMethodFromGenerator($findFromRawSqlMethod);
@@ -1182,7 +1182,7 @@  discard block
 block discarded – undo
1182 1182
         $class->setDocBlock((new DocBlockGenerator(
1183 1183
             "The $baseClassName class will iterate over results of $beanClassWithoutNameSpace class.",
1184 1184
             null,
1185
-            [new Tag\MethodTag('getIterator', ['\\' . $beanClassName . '[]'])]
1185
+            [new Tag\MethodTag('getIterator', ['\\'.$beanClassName.'[]'])]
1186 1186
         ))->setWordWrap(false));
1187 1187
 
1188 1188
         $file = $this->codeGeneratorListener->onBaseResultIteratorGenerated($file, $this, $this->configuration);
@@ -1238,7 +1238,7 @@  discard block
 block discarded – undo
1238 1238
                 }
1239 1239
             }
1240 1240
         }
1241
-        usort($methods, static function (MethodGenerator $methodA, MethodGenerator $methodB) {
1241
+        usort($methods, static function(MethodGenerator $methodA, MethodGenerator $methodB) {
1242 1242
             return $methodA->getName() <=> $methodB->getName();
1243 1243
         });
1244 1244
 
@@ -1387,11 +1387,11 @@  discard block
 block discarded – undo
1387 1387
 
1388 1388
         if ($index->isUnique()) {
1389 1389
             $parameters[] = new ParameterGenerator('additionalTablesFetch', 'array', []);
1390
-            $params[] = new ParamTag('additionalTablesFetch', [ 'string[]' ], 'A list of additional tables to fetch (for performance improvement)');
1391
-            $params[] = new ReturnTag([ '\\'.$beanNamespace.'\\'.$beanClassName, 'null' ]);
1390
+            $params[] = new ParamTag('additionalTablesFetch', ['string[]'], 'A list of additional tables to fetch (for performance improvement)');
1391
+            $params[] = new ReturnTag(['\\'.$beanNamespace.'\\'.$beanClassName, 'null']);
1392 1392
             $method->setReturnType('?\\'.$beanNamespace.'\\'.$beanClassName);
1393 1393
 
1394
-            $docBlock = new DocBlockGenerator("Get a $beanClassName filtered by ".implode(', ', $commentArguments). '.', null, $params);
1394
+            $docBlock = new DocBlockGenerator("Get a $beanClassName filtered by ".implode(', ', $commentArguments).'.', null, $params);
1395 1395
             $docBlock->setWordWrap(false);
1396 1396
 
1397 1397
             $body = "\$filter = [
@@ -1400,12 +1400,12 @@  discard block
 block discarded – undo
1400 1400
 ";
1401 1401
         } else {
1402 1402
             $parameters[] = (new ParameterGenerator('orderBy'))->setDefaultValue(null);
1403
-            $params[] = new ParamTag('orderBy', [ 'mixed' ], 'The order string');
1403
+            $params[] = new ParamTag('orderBy', ['mixed'], 'The order string');
1404 1404
             $parameters[] = new ParameterGenerator('additionalTablesFetch', 'array', []);
1405
-            $params[] = new ParamTag('additionalTablesFetch', [ 'string[]' ], 'A list of additional tables to fetch (for performance improvement)');
1405
+            $params[] = new ParamTag('additionalTablesFetch', ['string[]'], 'A list of additional tables to fetch (for performance improvement)');
1406 1406
             $parameters[] = (new ParameterGenerator('mode', '?int'))->setDefaultValue(null);
1407
-            $params[] = new ParamTag('mode', [ 'int', 'null' ], 'Either TDBMService::MODE_ARRAY or TDBMService::MODE_CURSOR (for large datasets). Defaults to TDBMService::MODE_ARRAY.');
1408
-            $method->setReturnType($this->resultIteratorNamespace . '\\' . $this->getResultIteratorClassName());
1407
+            $params[] = new ParamTag('mode', ['int', 'null'], 'Either TDBMService::MODE_ARRAY or TDBMService::MODE_CURSOR (for large datasets). Defaults to TDBMService::MODE_ARRAY.');
1408
+            $method->setReturnType($this->resultIteratorNamespace.'\\'.$this->getResultIteratorClassName());
1409 1409
 
1410 1410
             $docBlock = new DocBlockGenerator("Get a list of $beanClassName filtered by ".implode(', ', $commentArguments).".", null, $params);
1411 1411
             $docBlock->setWordWrap(false);
@@ -1722,17 +1722,17 @@  discard block
 block discarded – undo
1722 1722
      * @param string $indent
1723 1723
      * @return string
1724 1724
      */
1725
-    private function psr2VarExport($var, string $indent=''): string
1725
+    private function psr2VarExport($var, string $indent = ''): string
1726 1726
     {
1727 1727
         if (is_array($var)) {
1728 1728
             $indexed = array_keys($var) === range(0, count($var) - 1);
1729 1729
             $r = [];
1730 1730
             foreach ($var as $key => $value) {
1731 1731
                 $r[] = "$indent    "
1732
-                    . ($indexed ? '' : $this->psr2VarExport($key) . ' => ')
1732
+                    . ($indexed ? '' : $this->psr2VarExport($key).' => ')
1733 1733
                     . $this->psr2VarExport($value, "$indent    ");
1734 1734
             }
1735
-            return "[\n" . implode(",\n", $r) . "\n" . $indent . ']';
1735
+            return "[\n".implode(",\n", $r)."\n".$indent.']';
1736 1736
         }
1737 1737
         return var_export($var, true);
1738 1738
     }
Please login to merge, or discard this patch.
src/TDBMService.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
                 }
423 423
             }
424 424
 
425
-            return ['(' . implode(') AND (', $sqlParts) . ')', $parameters, $counter];
425
+            return ['('.implode(') AND (', $sqlParts).')', $parameters, $counter];
426 426
         } elseif ($filter_bag instanceof ResultIterator) {
427 427
             $subQuery = $filter_bag->_getSubQuery();
428 428
             return [$subQuery, [], $counter];
@@ -1000,7 +1000,7 @@  discard block
 block discarded – undo
1000 1000
 
1001 1001
         return $this->fromCache(
1002 1002
             $this->cachePrefix.'_linkbetweeninheritedtables_'.implode('__split__', $tables),
1003
-            function () use ($tables) {
1003
+            function() use ($tables) {
1004 1004
                 return $this->_getLinkBetweenInheritedTablesWithoutCache($tables);
1005 1005
             }
1006 1006
         );
@@ -1048,7 +1048,7 @@  discard block
 block discarded – undo
1048 1048
      */
1049 1049
     public function _getRelatedTablesByInheritance(string $table): array
1050 1050
     {
1051
-        return $this->fromCache($this->cachePrefix.'_relatedtables_'.$table, function () use ($table) {
1051
+        return $this->fromCache($this->cachePrefix.'_relatedtables_'.$table, function() use ($table) {
1052 1052
             return $this->_getRelatedTablesByInheritanceWithoutCache($table);
1053 1053
         });
1054 1054
     }
@@ -1137,7 +1137,7 @@  discard block
 block discarded – undo
1137 1137
     public function findObjects(string $mainTable, $filter = null, array $parameters = array(), $orderString = null, array $additionalTablesFetch = array(), ?int $mode = null, string $className = null, string $resultIteratorClass = ResultIterator::class): ResultIterator
1138 1138
     {
1139 1139
         if (!is_a($resultIteratorClass, ResultIterator::class, true)) {
1140
-            throw new TDBMInvalidArgumentException('$resultIteratorClass should be a `'. ResultIterator::class. '`. `' . $resultIteratorClass . '` provided.');
1140
+            throw new TDBMInvalidArgumentException('$resultIteratorClass should be a `'.ResultIterator::class.'`. `'.$resultIteratorClass.'` provided.');
1141 1141
         }
1142 1142
         // $mainTable is not secured in MagicJoin, let's add a bit of security to avoid SQL injection.
1143 1143
         if (!preg_match('/^[a-zA-Z_][a-zA-Z0-9_]*$/', $mainTable)) {
@@ -1174,7 +1174,7 @@  discard block
 block discarded – undo
1174 1174
     public function findObjectsFromSql(string $mainTable, string $from, $filter = null, array $parameters = array(), $orderString = null, ?int $mode = null, string $className = null, string $resultIteratorClass = ResultIterator::class): ResultIterator
1175 1175
     {
1176 1176
         if (!is_a($resultIteratorClass, ResultIterator::class, true)) {
1177
-            throw new TDBMInvalidArgumentException('$resultIteratorClass should be a `'. ResultIterator::class. '`. `' . $resultIteratorClass . '` provided.');
1177
+            throw new TDBMInvalidArgumentException('$resultIteratorClass should be a `'.ResultIterator::class.'`. `'.$resultIteratorClass.'` provided.');
1178 1178
         }
1179 1179
         // $mainTable is not secured in MagicJoin, let's add a bit of security to avoid SQL injection.
1180 1180
         if (!preg_match('/^[a-zA-Z_][a-zA-Z0-9_]*$/', $mainTable)) {
@@ -1291,18 +1291,18 @@  discard block
 block discarded – undo
1291 1291
         if ($count > 1) {
1292 1292
             $additionalErrorInfos = '';
1293 1293
             if (is_string($filter) && !empty($parameters)) {
1294
-                $additionalErrorInfos = ' for filter "' . $filter.'"';
1294
+                $additionalErrorInfos = ' for filter "'.$filter.'"';
1295 1295
                 foreach ($parameters as $fieldName => $parameter) {
1296 1296
                     if (is_array($parameter)) {
1297
-                        $value = '(' . implode(',', $parameter) . ')';
1297
+                        $value = '('.implode(',', $parameter).')';
1298 1298
                     } else {
1299 1299
                         $value = $parameter;
1300 1300
                     }
1301
-                    $additionalErrorInfos = str_replace(':' . $fieldName, var_export($value, true), $additionalErrorInfos);
1301
+                    $additionalErrorInfos = str_replace(':'.$fieldName, var_export($value, true), $additionalErrorInfos);
1302 1302
                 }
1303 1303
             }
1304 1304
             $additionalErrorInfos .= '.';
1305
-            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);
1305
+            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);
1306 1306
         } elseif ($count === 0) {
1307 1307
             return null;
1308 1308
         }
@@ -1345,7 +1345,7 @@  discard block
 block discarded – undo
1345 1345
     public function findObjectsFromRawSql(string $mainTable, string $sql, array $parameters = array(), ?int $mode = null, string $className = null, string $sqlCount = null, string $resultIteratorClass = ResultIterator::class): ResultIterator
1346 1346
     {
1347 1347
         if (!is_a($resultIteratorClass, ResultIterator::class, true)) {
1348
-            throw new TDBMInvalidArgumentException('$resultIteratorClass should be a `'. ResultIterator::class. '`. `' . $resultIteratorClass . '` provided.');
1348
+            throw new TDBMInvalidArgumentException('$resultIteratorClass should be a `'.ResultIterator::class.'`. `'.$resultIteratorClass.'` provided.');
1349 1349
         }
1350 1350
         // $mainTable is not secured in MagicJoin, let's add a bit of security to avoid SQL injection.
1351 1351
         if (!preg_match('/^[a-zA-Z_][a-zA-Z0-9_]*$/', $mainTable)) {
@@ -1475,7 +1475,7 @@  discard block
 block discarded – undo
1475 1475
         $table1 = $fks[0]->getForeignTableName();
1476 1476
         $table2 = $fks[1]->getForeignTableName();
1477 1477
 
1478
-        $beanTables = array_map(function (DbRow $dbRow) {
1478
+        $beanTables = array_map(function(DbRow $dbRow) {
1479 1479
             return $dbRow->_getDbTableName();
1480 1480
         }, $bean->_getDbRows());
1481 1481
 
Please login to merge, or discard this patch.
src/NoBeanFoundException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
      */
36 36
     public static function missPrimaryKeyRecord(string $tableName, array $primaryKeys, string $className, Exception $previous) : self
37 37
     {
38
-        $primaryKeysStringified = implode(' and ', array_map(function ($key, $value) {
38
+        $primaryKeysStringified = implode(' and ', array_map(function($key, $value) {
39 39
             return "'".$key."' = ".$value;
40 40
         }, array_keys($primaryKeys), $primaryKeys));
41 41
         $exception = new self("No result found for query on table '".$tableName."' for ".$primaryKeysStringified, 0, $previous);
Please login to merge, or discard this patch.
src/Utils/TDBMDaoGenerator.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -89,11 +89,11 @@  discard block
 block discarded – undo
89 89
 
90 90
         // Remove all beans and daos from junction tables
91 91
         $junctionTables = $this->configuration->getSchemaAnalyzer()->detectJunctionTables(true);
92
-        $junctionTableNames = array_map(function (Table $table) {
92
+        $junctionTableNames = array_map(function(Table $table) {
93 93
             return $table->getName();
94 94
         }, $junctionTables);
95 95
 
96
-        $tableList = array_filter($tableList, function (Table $table) use ($junctionTableNames) {
96
+        $tableList = array_filter($tableList, function(Table $table) use ($junctionTableNames) {
97 97
             return !in_array($table->getName(), $junctionTableNames, true);
98 98
         });
99 99
 
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
         $fileContent = $this->psr2Fix($fileContent);
175 175
         // Add the declare strict-types directive
176 176
         $commentEnd = strpos($fileContent, ' */') + 3;
177
-        $fileContent = substr($fileContent, 0, $commentEnd) . "\n\ndeclare(strict_types=1);" . substr($fileContent, $commentEnd + 1);
177
+        $fileContent = substr($fileContent, 0, $commentEnd)."\n\ndeclare(strict_types=1);".substr($fileContent, $commentEnd + 1);
178 178
 
179 179
         $this->dumpFile($possibleBaseFileName, $fileContent);
180 180
 
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
         $fileContent = $this->psr2Fix($fileContent);
237 237
         // Add the declare strict-types directive
238 238
         $commentEnd = strpos($fileContent, ' */') + 3;
239
-        $fileContent = substr($fileContent, 0, $commentEnd) . "\n\ndeclare(strict_types=1);" . substr($fileContent, $commentEnd + 1);
239
+        $fileContent = substr($fileContent, 0, $commentEnd)."\n\ndeclare(strict_types=1);".substr($fileContent, $commentEnd + 1);
240 240
 
241 241
         $this->dumpFile($possibleBaseFileName, $fileContent);
242 242
 
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
     private function psr2Fix(string $content): string
275 275
     {
276 276
         // Removes the extra blank line at the end (before: `\n\n`, after: `\n`)
277
-        return rtrim($content, PHP_EOL) . PHP_EOL;
277
+        return rtrim($content, PHP_EOL).PHP_EOL;
278 278
     }
279 279
 
280 280
     /**
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
         $resultIteratorClassName = $beanDescriptor->getResultIteratorClassName();
286 286
         $resultIteratorBaseClassName = $beanDescriptor->getBaseResultIteratorClassName();
287 287
         $resultIteratorNamespace = $this->configuration->getResultIteratorNamespace();
288
-        $resultIteratorBaseNamespace = $resultIteratorNamespace . '\\Generated';
288
+        $resultIteratorBaseNamespace = $resultIteratorNamespace.'\\Generated';
289 289
         $beanClassWithoutNameSpace = $beanDescriptor->getBeanClassName();
290 290
         $file = $beanDescriptor->generateResultIteratorPhpCode();
291 291
         if ($file === null) {
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
 
295 295
         $fileContent = $this->psr2Fix($file->generate());
296 296
         $commentEnd = strpos($fileContent, ' */') + 3;
297
-        $fileContent = substr($fileContent, 0, $commentEnd) . "\n\ndeclare(strict_types=1);" . substr($fileContent, $commentEnd + 1);
297
+        $fileContent = substr($fileContent, 0, $commentEnd)."\n\ndeclare(strict_types=1);".substr($fileContent, $commentEnd + 1);
298 298
 
299 299
         $baseResultIteratorFilePath = $this->configuration->getPathFinder()->getPath($resultIteratorBaseNamespace.'\\'.$resultIteratorBaseClassName)->getPathname();
300 300
         $this->dumpFile($baseResultIteratorFilePath, $fileContent);
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
 
360 360
         $constructorMethod = new MethodGenerator(
361 361
             '__construct',
362
-            [ new ParameterGenerator('container', ContainerInterface::class) ],
362
+            [new ParameterGenerator('container', ContainerInterface::class)],
363 363
             MethodGenerator::FLAG_PUBLIC,
364 364
             '$this->container = $container;'
365 365
         );
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
 
376 376
             $daoInstanceProperty = new PropertyGenerator($daoInstanceName);
377 377
             $daoInstanceProperty->setVisibility(AbstractMemberGenerator::VISIBILITY_PRIVATE);
378
-            $daoInstanceProperty->setDocBlock(new DocBlockGenerator(null, null, [new VarTag(null, ['\\' . $daoNamespace . '\\' . $daoClassName, 'null'])]));
378
+            $daoInstanceProperty->setDocBlock(new DocBlockGenerator(null, null, [new VarTag(null, ['\\'.$daoNamespace.'\\'.$daoClassName, 'null'])]));
379 379
             $class->addPropertyFromGenerator($daoInstanceProperty);
380 380
 
381 381
             $fullClassNameVarExport = var_export($daoNamespace.'\\'.$daoClassName, true);
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
 BODY;
389 389
 
390 390
             $getterMethod = new MethodGenerator(
391
-                'get' . $daoClassName,
391
+                'get'.$daoClassName,
392 392
                 [],
393 393
                 MethodGenerator::FLAG_PUBLIC,
394 394
                 $getterBody
@@ -400,10 +400,10 @@  discard block
 block discarded – undo
400 400
             }
401 401
 
402 402
             $setterMethod = new MethodGenerator(
403
-                'set' . $daoClassName,
404
-                [new ParameterGenerator($daoInstanceName, '\\' . $daoNamespace . '\\' . $daoClassName)],
403
+                'set'.$daoClassName,
404
+                [new ParameterGenerator($daoInstanceName, '\\'.$daoNamespace.'\\'.$daoClassName)],
405 405
                 MethodGenerator::FLAG_PUBLIC,
406
-                '$this->' . $daoInstanceName . ' = $' . $daoInstanceName . ';'
406
+                '$this->'.$daoInstanceName.' = $'.$daoInstanceName.';'
407 407
             );
408 408
             $setterMethod->setReturnType('void');
409 409
             $setterMethod = $this->configuration->getCodeGeneratorListener()->onDaoFactorySetterGenerated($setterMethod, $beanDescriptor, $this->configuration, $class);
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
             $fileContent = $this->psr2Fix($fileContent);
424 424
             // Add the declare strict-types directive
425 425
             $commentEnd = strpos($fileContent, ' */') + 3;
426
-            $fileContent = substr($fileContent, 0, $commentEnd) . "\n\ndeclare(strict_types=1);" . substr($fileContent, $commentEnd + 1);
426
+            $fileContent = substr($fileContent, 0, $commentEnd)."\n\ndeclare(strict_types=1);".substr($fileContent, $commentEnd + 1);
427 427
 
428 428
             $this->dumpFile($possibleFileName, $fileContent);
429 429
         }
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
         $map = [
531 531
             Type::TARRAY => 'array',
532 532
             Type::SIMPLE_ARRAY => 'array',
533
-            'json' => 'array',  // 'json' is supported from Doctrine DBAL 2.6 only.
533
+            'json' => 'array', // 'json' is supported from Doctrine DBAL 2.6 only.
534 534
             Type::JSON_ARRAY => 'array',
535 535
             Type::BIGINT => 'string',
536 536
             Type::BOOLEAN => 'bool',
Please login to merge, or discard this patch.