Passed
Pull Request — master (#248)
by Kevin
08:12 queued 04:32
created
src/Utils/ObjectBeanPropertyDescriptor.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
      */
88 88
     public function getPhpType(): string
89 89
     {
90
-        return '\\' . $this->beanNamespace . '\\' . $this->getClassName();
90
+        return '\\'.$this->beanNamespace.'\\'.$this->getClassName();
91 91
     }
92 92
 
93 93
     /**
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
         $referencedBeanName = $this->namingStrategy->getBeanClassName($this->foreignKey->getForeignTableName());
161 161
 
162 162
         $getter = new MethodGenerator($getterName);
163
-        $getter->setDocBlock(new DocBlockGenerator('Returns the ' . $referencedBeanName . ' object bound to this object via the ' . implode(' and ', $this->foreignKey->getUnquotedLocalColumns()) . ' column.'));
163
+        $getter->setDocBlock(new DocBlockGenerator('Returns the '.$referencedBeanName.' object bound to this object via the '.implode(' and ', $this->foreignKey->getUnquotedLocalColumns()).' column.'));
164 164
 
165 165
         /*$types = [ $referencedBeanName ];
166 166
         if ($isNullable) {
@@ -168,10 +168,10 @@  discard block
 block discarded – undo
168 168
         }
169 169
         $getter->getDocBlock()->setTag(new ReturnTag($types));*/
170 170
 
171
-        $getter->setReturnType(($isNullable ? '?' : '') . $this->beanNamespace . '\\' . $referencedBeanName);
171
+        $getter->setReturnType(($isNullable ? '?' : '').$this->beanNamespace.'\\'.$referencedBeanName);
172 172
         $tdbmFk = ForeignKey::createFromFk($this->foreignKey);
173 173
 
174
-        $getter->setBody('return $this->getRef(' . var_export($tdbmFk->getCacheKey(), true) . ', ' . var_export($tableName, true) . ');');
174
+        $getter->setBody('return $this->getRef('.var_export($tdbmFk->getCacheKey(), true).', '.var_export($tableName, true).');');
175 175
 
176 176
         if ($this->isGetterProtected()) {
177 177
             $getter->setVisibility(AbstractMemberGenerator::VISIBILITY_PROTECTED);
@@ -179,13 +179,13 @@  discard block
 block discarded – undo
179 179
 
180 180
         if (!$this->isReadOnly()) {
181 181
             $setter = new MethodGenerator($setterName);
182
-            $setter->setDocBlock(new DocBlockGenerator('The setter for the ' . $referencedBeanName . ' object bound to this object via the ' . implode(' and ', $this->foreignKey->getUnquotedLocalColumns()) . ' column.'));
182
+            $setter->setDocBlock(new DocBlockGenerator('The setter for the '.$referencedBeanName.' object bound to this object via the '.implode(' and ', $this->foreignKey->getUnquotedLocalColumns()).' column.'));
183 183
 
184
-            $setter->setParameter(new ParameterGenerator('object', ($isNullable ? '?' : '') . $this->beanNamespace . '\\' . $referencedBeanName));
184
+            $setter->setParameter(new ParameterGenerator('object', ($isNullable ? '?' : '').$this->beanNamespace.'\\'.$referencedBeanName));
185 185
 
186 186
             $setter->setReturnType('void');
187 187
 
188
-            $setter->setBody('$this->setRef(' . var_export($tdbmFk->getCacheKey(), true) . ', $object, ' . var_export($tableName, true) . ');');
188
+            $setter->setBody('$this->setRef('.var_export($tdbmFk->getCacheKey(), true).', $object, '.var_export($tableName, true).');');
189 189
 
190 190
             if ($this->isSetterProtected()) {
191 191
                 $setter->setVisibility(AbstractMemberGenerator::VISIBILITY_PROTECTED);
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
             /** @var Annotation\JsonFormat|null $jsonFormat */
225 225
             $jsonFormat = $this->findAnnotation(Annotation\JsonFormat::class);
226 226
             if ($jsonFormat !== null) {
227
-                $method = $jsonFormat->method ?? 'get' . ucfirst($jsonFormat->property);
227
+                $method = $jsonFormat->method ?? 'get'.ucfirst($jsonFormat->property);
228 228
                 $format = "$method()";
229 229
             } else {
230 230
                 $stopRecursion = $this->findAnnotation(Annotation\JsonRecursive::class) ? '' : 'true';
@@ -280,10 +280,10 @@  discard block
 block discarded – undo
280 280
             } elseif ($descriptor instanceof ScalarBeanPropertyDescriptor) {
281 281
                 $rows[] = "'$indexName' => $propertyAccess->$columnGetterName()";
282 282
             } else {
283
-                throw new TDBMException('PropertyDescriptor of class `' . get_class($descriptor) . '` cannot be serialized.');
283
+                throw new TDBMException('PropertyDescriptor of class `'.get_class($descriptor).'` cannot be serialized.');
284 284
             }
285 285
         }
286
-        return '[' . implode(', ', $rows) . ']';
286
+        return '['.implode(', ', $rows).']';
287 287
     }
288 288
 
289 289
     private function getBeanPropertyDescriptor(string $column): AbstractBeanPropertyDescriptor
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
                 return $descriptor;
297 297
             }
298 298
         }
299
-        throw new TDBMException('PropertyDescriptor for `'.$this->table->getName().'`.`' . $column . '` not found in `' . $this->foreignBeanDescriptor->getTable()->getName() . '`');
299
+        throw new TDBMException('PropertyDescriptor for `'.$this->table->getName().'`.`'.$column.'` not found in `'.$this->foreignBeanDescriptor->getTable()->getName().'`');
300 300
     }
301 301
 
302 302
     /**
Please login to merge, or discard this patch.
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.