@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | } |
417 | 417 | } |
418 | 418 | |
419 | - return ['(' . implode(') AND (', $sqlParts) . ')', $parameters, $counter]; |
|
419 | + return ['('.implode(') AND (', $sqlParts).')', $parameters, $counter]; |
|
420 | 420 | } elseif ($filter_bag instanceof AbstractTDBMObject) { |
421 | 421 | $sqlParts = []; |
422 | 422 | $parameters = []; |
@@ -990,7 +990,7 @@ discard block |
||
990 | 990 | |
991 | 991 | return $this->fromCache( |
992 | 992 | $this->cachePrefix.'_linkbetweeninheritedtables_'.implode('__split__', $tables), |
993 | - function () use ($tables) { |
|
993 | + function() use ($tables) { |
|
994 | 994 | return $this->_getLinkBetweenInheritedTablesWithoutCache($tables); |
995 | 995 | } |
996 | 996 | ); |
@@ -1038,7 +1038,7 @@ discard block |
||
1038 | 1038 | */ |
1039 | 1039 | public function _getRelatedTablesByInheritance(string $table): array |
1040 | 1040 | { |
1041 | - return $this->fromCache($this->cachePrefix.'_relatedtables_'.$table, function () use ($table) { |
|
1041 | + return $this->fromCache($this->cachePrefix.'_relatedtables_'.$table, function() use ($table) { |
|
1042 | 1042 | return $this->_getRelatedTablesByInheritanceWithoutCache($table); |
1043 | 1043 | }); |
1044 | 1044 | } |
@@ -1233,7 +1233,7 @@ discard block |
||
1233 | 1233 | try { |
1234 | 1234 | return $this->findObjectOrFail($table, $primaryKeys, [], $additionalTablesFetch, $className); |
1235 | 1235 | } catch (NoBeanFoundException $exception) { |
1236 | - $primaryKeysStringified = implode(' and ', array_map(function ($key, $value) { |
|
1236 | + $primaryKeysStringified = implode(' and ', array_map(function($key, $value) { |
|
1237 | 1237 | return "'".$key."' = ".$value; |
1238 | 1238 | }, array_keys($primaryKeys), $primaryKeys)); |
1239 | 1239 | throw new NoBeanFoundException("No result found for query on table '".$table."' for ".$primaryKeysStringified, 0, $exception); |
@@ -1276,18 +1276,18 @@ discard block |
||
1276 | 1276 | if ($count > 1) { |
1277 | 1277 | $additionalErrorInfos = ''; |
1278 | 1278 | if (is_string($filter) && !empty($parameters)) { |
1279 | - $additionalErrorInfos = ' for filter "' . $filter.'"'; |
|
1279 | + $additionalErrorInfos = ' for filter "'.$filter.'"'; |
|
1280 | 1280 | foreach ($parameters as $fieldName => $parameter) { |
1281 | 1281 | if (is_array($parameter)) { |
1282 | - $value = '(' . implode(',', $parameter) . ')'; |
|
1282 | + $value = '('.implode(',', $parameter).')'; |
|
1283 | 1283 | } else { |
1284 | 1284 | $value = $parameter; |
1285 | 1285 | } |
1286 | - $additionalErrorInfos = str_replace(':' . $fieldName, var_export($value, true), $additionalErrorInfos); |
|
1286 | + $additionalErrorInfos = str_replace(':'.$fieldName, var_export($value, true), $additionalErrorInfos); |
|
1287 | 1287 | } |
1288 | 1288 | } |
1289 | 1289 | $additionalErrorInfos .= '.'; |
1290 | - 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); |
|
1290 | + 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); |
|
1291 | 1291 | } elseif ($count === 0) { |
1292 | 1292 | return null; |
1293 | 1293 | } |
@@ -1456,7 +1456,7 @@ discard block |
||
1456 | 1456 | $table1 = $fks[0]->getForeignTableName(); |
1457 | 1457 | $table2 = $fks[1]->getForeignTableName(); |
1458 | 1458 | |
1459 | - $beanTables = array_map(function (DbRow $dbRow) { |
|
1459 | + $beanTables = array_map(function(DbRow $dbRow) { |
|
1460 | 1460 | return $dbRow->_getDbTableName(); |
1461 | 1461 | }, $bean->_getDbRows()); |
1462 | 1462 |
@@ -262,7 +262,7 @@ |
||
262 | 262 | */ |
263 | 263 | public function jsonSerialize() |
264 | 264 | { |
265 | - return array_map(function (AbstractTDBMObject $item) { |
|
265 | + return array_map(function(AbstractTDBMObject $item) { |
|
266 | 266 | return $item->jsonSerialize(); |
267 | 267 | }, $this->toArray()); |
268 | 268 | } |
@@ -48,7 +48,7 @@ |
||
48 | 48 | $sql = 'SELECT DISTINCT '.implode(', ', $columnsList).' FROM MAGICJOIN('.$this->mainTable.')'; |
49 | 49 | |
50 | 50 | $pkColumnNames = $this->tdbmService->getPrimaryKeyColumns($this->mainTable); |
51 | - $pkColumnNames = array_map(function ($pkColumn) { |
|
51 | + $pkColumnNames = array_map(function($pkColumn) { |
|
52 | 52 | return $this->tdbmService->getConnection()->quoteIdentifier($this->mainTable).'.'.$this->tdbmService->getConnection()->quoteIdentifier($pkColumn); |
53 | 53 | }, $pkColumnNames); |
54 | 54 |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | */ |
202 | 202 | public function getConstructorProperties(): array |
203 | 203 | { |
204 | - $constructorProperties = array_filter($this->beanPropertyDescriptors, function (AbstractBeanPropertyDescriptor $property) { |
|
204 | + $constructorProperties = array_filter($this->beanPropertyDescriptors, function(AbstractBeanPropertyDescriptor $property) { |
|
205 | 205 | return !$property instanceof InheritanceReferencePropertyDescriptor && $property->isCompulsory(); |
206 | 206 | }); |
207 | 207 | |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | public function getPropertiesWithDefault(): array |
217 | 217 | { |
218 | 218 | $properties = $this->getPropertiesForTable($this->table); |
219 | - $defaultProperties = array_filter($properties, function (AbstractBeanPropertyDescriptor $property) { |
|
219 | + $defaultProperties = array_filter($properties, function(AbstractBeanPropertyDescriptor $property) { |
|
220 | 220 | return $property->hasDefault(); |
221 | 221 | }); |
222 | 222 | |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | */ |
231 | 231 | public function getExposedProperties(): array |
232 | 232 | { |
233 | - $exposedProperties = array_filter($this->beanPropertyDescriptors, function (AbstractBeanPropertyDescriptor $property) { |
|
233 | + $exposedProperties = array_filter($this->beanPropertyDescriptors, function(AbstractBeanPropertyDescriptor $property) { |
|
234 | 234 | return !$property instanceof InheritanceReferencePropertyDescriptor && $property->getTable()->getName() === $this->table->getName(); |
235 | 235 | }); |
236 | 236 | |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | foreach ($beanPropertyDescriptors as $beanDescriptor) { |
337 | 337 | $name = $beanDescriptor->getGetterName(); |
338 | 338 | if (isset($names[$name])) { |
339 | - throw new TDBMException('Unsolvable name conflict while generating method name "' . $name . '"'); |
|
339 | + throw new TDBMException('Unsolvable name conflict while generating method name "'.$name.'"'); |
|
340 | 340 | } else { |
341 | 341 | $names[$name] = $beanDescriptor; |
342 | 342 | } |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | $assigns[] = $property->assignToDefaultCode()."\n"; |
386 | 386 | } |
387 | 387 | |
388 | - $body = $parentConstructorCode . implode('', $assigns); |
|
388 | + $body = $parentConstructorCode.implode('', $assigns); |
|
389 | 389 | |
390 | 390 | $constructor->setBody($body); |
391 | 391 | |
@@ -502,7 +502,7 @@ discard block |
||
502 | 502 | foreach ($this->getExposedProperties() as $beanPropertyDescriptor) { |
503 | 503 | $propertyCode = $beanPropertyDescriptor->getJsonSerializeCode(); |
504 | 504 | if (!empty($propertyCode)) { |
505 | - $body .= PHP_EOL . $propertyCode; |
|
505 | + $body .= PHP_EOL.$propertyCode; |
|
506 | 506 | } |
507 | 507 | } |
508 | 508 | |
@@ -510,11 +510,11 @@ discard block |
||
510 | 510 | foreach ($this->getMethodDescriptors() as $methodDescriptor) { |
511 | 511 | $methodCode = $methodDescriptor->getJsonSerializeCode(); |
512 | 512 | if (!empty($methodCode)) { |
513 | - $body .= PHP_EOL . $methodCode; |
|
513 | + $body .= PHP_EOL.$methodCode; |
|
514 | 514 | } |
515 | 515 | } |
516 | 516 | |
517 | - $body .= PHP_EOL . 'return $array;'; |
|
517 | + $body .= PHP_EOL.'return $array;'; |
|
518 | 518 | |
519 | 519 | $method->setBody($body); |
520 | 520 | |
@@ -609,7 +609,7 @@ discard block |
||
609 | 609 | /** @var AddInterface[] $addInterfaceAnnotations */ |
610 | 610 | $addInterfaceAnnotations = $this->annotationParser->getTableAnnotations($this->table)->findAnnotations(AddInterface::class); |
611 | 611 | |
612 | - $interfaces = [ JsonSerializable::class ]; |
|
612 | + $interfaces = [JsonSerializable::class]; |
|
613 | 613 | foreach ($addInterfaceAnnotations as $annotation) { |
614 | 614 | $interfaces[] = $annotation->getName(); |
615 | 615 | } |
@@ -649,7 +649,7 @@ discard block |
||
649 | 649 | } |
650 | 650 | } elseif ($methodDescriptor instanceof PivotTableMethodsDescriptor) { |
651 | 651 | $pivotTableMethodsDescriptors[] = $methodDescriptor; |
652 | - [ $getter, $adder, $remover, $has, $setter ] = $methodDescriptor->getCode(); |
|
652 | + [$getter, $adder, $remover, $has, $setter] = $methodDescriptor->getCode(); |
|
653 | 653 | $methods = $this->codeGeneratorListener->onBaseBeanManyToManyGenerated($getter, $adder, $remover, $has, $setter, $methodDescriptor, $this, $this->configuration, $class); |
654 | 654 | foreach ($methods as $method) { |
655 | 655 | if ($method) { |
@@ -797,7 +797,7 @@ discard block |
||
797 | 797 | |
798 | 798 | $constructorMethod = new MethodGenerator( |
799 | 799 | '__construct', |
800 | - [ new ParameterGenerator('tdbmService', TDBMService::class) ], |
|
800 | + [new ParameterGenerator('tdbmService', TDBMService::class)], |
|
801 | 801 | MethodGenerator::FLAG_PUBLIC, |
802 | 802 | '$this->tdbmService = $tdbmService;', |
803 | 803 | 'Sets the TDBM service used by this DAO.' |
@@ -809,7 +809,7 @@ discard block |
||
809 | 809 | |
810 | 810 | $saveMethod = new MethodGenerator( |
811 | 811 | 'save', |
812 | - [ new ParameterGenerator('obj', $beanClassName) ], |
|
812 | + [new ParameterGenerator('obj', $beanClassName)], |
|
813 | 813 | MethodGenerator::FLAG_PUBLIC, |
814 | 814 | '$this->tdbmService->save($obj);', |
815 | 815 | (new DocBlockGenerator( |
@@ -845,7 +845,7 @@ discard block |
||
845 | 845 | "Get all $beanClassWithoutNameSpace records.", |
846 | 846 | null, |
847 | 847 | [ |
848 | - new ReturnTag([ '\\'.$beanClassName.'[]', '\\'.ResultIterator::class ]) |
|
848 | + new ReturnTag(['\\'.$beanClassName.'[]', '\\'.ResultIterator::class]) |
|
849 | 849 | ] |
850 | 850 | ))->setWordWrap(false) |
851 | 851 | ); |
@@ -863,7 +863,7 @@ discard block |
||
863 | 863 | |
864 | 864 | foreach ($primaryKeyColumns as $primaryKeyColumn) { |
865 | 865 | if ($primaryKeyColumn === $lazyLoadingParameterName) { |
866 | - throw new TDBMException('Primary Column name `' . $lazyLoadingParameterName . '` is not allowed.'); |
|
866 | + throw new TDBMException('Primary Column name `'.$lazyLoadingParameterName.'` is not allowed.'); |
|
867 | 867 | } |
868 | 868 | $phpType = TDBMDaoGenerator::dbalTypeToPhpType($this->table->getColumn($primaryKeyColumn)->getType()); |
869 | 869 | $parameters[] = new ParameterGenerator($primaryKeyColumn, $phpType); |
@@ -879,7 +879,7 @@ discard block |
||
879 | 879 | 'getById', |
880 | 880 | $parameters, |
881 | 881 | MethodGenerator::FLAG_PUBLIC, |
882 | - "return \$this->tdbmService->findObjectByPk('$tableName', [" . implode(', ', $primaryKeyFilter) . "], [], \$$lazyLoadingParameterName);", |
|
882 | + "return \$this->tdbmService->findObjectByPk('$tableName', [".implode(', ', $primaryKeyFilter)."], [], \$$lazyLoadingParameterName);", |
|
883 | 883 | (new DocBlockGenerator( |
884 | 884 | "Get $beanClassWithoutNameSpace specified by its ID (its primary key).", |
885 | 885 | 'If the primary key does not exist, an exception is thrown.', |
@@ -953,7 +953,7 @@ discard block |
||
953 | 953 | new ParamTag('orderBy', ['mixed'], 'The order string'), |
954 | 954 | new ParamTag('additionalTablesFetch', ['string[]'], 'A list of additional tables to fetch (for performance improvement)'), |
955 | 955 | new ParamTag('mode', ['int', 'null'], 'Either TDBMService::MODE_ARRAY or TDBMService::MODE_CURSOR (for large datasets). Defaults to TDBMService::MODE_ARRAY.'), |
956 | - new ReturnTag(['\\' . $beanClassName . '[]', '\\'.ResultIterator::class]) |
|
956 | + new ReturnTag(['\\'.$beanClassName.'[]', '\\'.ResultIterator::class]) |
|
957 | 957 | ] |
958 | 958 | ))->setWordWrap(false) |
959 | 959 | ); |
@@ -996,7 +996,7 @@ discard block |
||
996 | 996 | new ParamTag('orderBy', ['mixed'], 'The order string'), |
997 | 997 | new ParamTag('additionalTablesFetch', ['string[]'], 'A list of additional tables to fetch (for performance improvement)'), |
998 | 998 | new ParamTag('mode', ['int', 'null'], 'Either TDBMService::MODE_ARRAY or TDBMService::MODE_CURSOR (for large datasets). Defaults to TDBMService::MODE_ARRAY.'), |
999 | - new ReturnTag(['\\'.$beanClassName . '[]', '\\'.ResultIterator::class]) |
|
999 | + new ReturnTag(['\\'.$beanClassName.'[]', '\\'.ResultIterator::class]) |
|
1000 | 1000 | ] |
1001 | 1001 | ))->setWordWrap(false) |
1002 | 1002 | ); |
@@ -1032,7 +1032,7 @@ discard block |
||
1032 | 1032 | new ParamTag('parameters', ['mixed[]'], 'The parameters associated with the query'), |
1033 | 1033 | new ParamTag('countSql', ['string', 'null'], 'The sql query that provides total count of rows (automatically computed if not provided)'), |
1034 | 1034 | new ParamTag('mode', ['int', 'null'], 'Either TDBMService::MODE_ARRAY or TDBMService::MODE_CURSOR (for large datasets). Defaults to TDBMService::MODE_ARRAY.'), |
1035 | - new ReturnTag(['\\'.$beanClassName . '[]', '\\'.ResultIterator::class]) |
|
1035 | + new ReturnTag(['\\'.$beanClassName.'[]', '\\'.ResultIterator::class]) |
|
1036 | 1036 | ] |
1037 | 1037 | ))->setWordWrap(false) |
1038 | 1038 | ); |
@@ -1186,7 +1186,7 @@ discard block |
||
1186 | 1186 | } |
1187 | 1187 | } |
1188 | 1188 | } |
1189 | - usort($methods, static function (MethodGenerator $methodA, MethodGenerator $methodB) { |
|
1189 | + usort($methods, static function(MethodGenerator $methodA, MethodGenerator $methodB) { |
|
1190 | 1190 | return $methodA->getName() <=> $methodB->getName(); |
1191 | 1191 | }); |
1192 | 1192 | |
@@ -1335,11 +1335,11 @@ discard block |
||
1335 | 1335 | |
1336 | 1336 | if ($index->isUnique()) { |
1337 | 1337 | $parameters[] = new ParameterGenerator('additionalTablesFetch', 'array', []); |
1338 | - $params[] = new ParamTag('additionalTablesFetch', [ 'string[]' ], 'A list of additional tables to fetch (for performance improvement)'); |
|
1339 | - $params[] = new ReturnTag([ '\\'.$beanNamespace.'\\'.$beanClassName, 'null' ]); |
|
1338 | + $params[] = new ParamTag('additionalTablesFetch', ['string[]'], 'A list of additional tables to fetch (for performance improvement)'); |
|
1339 | + $params[] = new ReturnTag(['\\'.$beanNamespace.'\\'.$beanClassName, 'null']); |
|
1340 | 1340 | $method->setReturnType('?\\'.$beanNamespace.'\\'.$beanClassName); |
1341 | 1341 | |
1342 | - $docBlock = new DocBlockGenerator("Get a $beanClassName filtered by ".implode(', ', $commentArguments). '.', null, $params); |
|
1342 | + $docBlock = new DocBlockGenerator("Get a $beanClassName filtered by ".implode(', ', $commentArguments).'.', null, $params); |
|
1343 | 1343 | $docBlock->setWordWrap(false); |
1344 | 1344 | |
1345 | 1345 | $body = "\$filter = [ |
@@ -1348,12 +1348,12 @@ discard block |
||
1348 | 1348 | "; |
1349 | 1349 | } else { |
1350 | 1350 | $parameters[] = (new ParameterGenerator('orderBy'))->setDefaultValue(null); |
1351 | - $params[] = new ParamTag('orderBy', [ 'mixed' ], 'The order string'); |
|
1351 | + $params[] = new ParamTag('orderBy', ['mixed'], 'The order string'); |
|
1352 | 1352 | $parameters[] = new ParameterGenerator('additionalTablesFetch', 'array', []); |
1353 | - $params[] = new ParamTag('additionalTablesFetch', [ 'string[]' ], 'A list of additional tables to fetch (for performance improvement)'); |
|
1353 | + $params[] = new ParamTag('additionalTablesFetch', ['string[]'], 'A list of additional tables to fetch (for performance improvement)'); |
|
1354 | 1354 | $parameters[] = (new ParameterGenerator('mode', '?int'))->setDefaultValue(null); |
1355 | - $params[] = new ParamTag('mode', [ 'int', 'null' ], 'Either TDBMService::MODE_ARRAY or TDBMService::MODE_CURSOR (for large datasets). Defaults to TDBMService::MODE_ARRAY.'); |
|
1356 | - $params[] = new ReturnTag([ '\\'.$beanNamespace.'\\'.$beanClassName.'[]', '\\'.ResultIterator::class ]); |
|
1355 | + $params[] = new ParamTag('mode', ['int', 'null'], 'Either TDBMService::MODE_ARRAY or TDBMService::MODE_CURSOR (for large datasets). Defaults to TDBMService::MODE_ARRAY.'); |
|
1356 | + $params[] = new ReturnTag(['\\'.$beanNamespace.'\\'.$beanClassName.'[]', '\\'.ResultIterator::class]); |
|
1357 | 1357 | $method->setReturnType('\\'.ResultIterator::class); |
1358 | 1358 | |
1359 | 1359 | $docBlock = new DocBlockGenerator("Get a list of $beanClassName filtered by ".implode(', ', $commentArguments).".", null, $params); |
@@ -1651,17 +1651,17 @@ discard block |
||
1651 | 1651 | * @param string $indent |
1652 | 1652 | * @return string |
1653 | 1653 | */ |
1654 | - private function psr2VarExport($var, string $indent=''): string |
|
1654 | + private function psr2VarExport($var, string $indent = ''): string |
|
1655 | 1655 | { |
1656 | 1656 | if (is_array($var)) { |
1657 | 1657 | $indexed = array_keys($var) === range(0, count($var) - 1); |
1658 | 1658 | $r = []; |
1659 | 1659 | foreach ($var as $key => $value) { |
1660 | 1660 | $r[] = "$indent " |
1661 | - . ($indexed ? '' : $this->psr2VarExport($key) . ' => ') |
|
1661 | + . ($indexed ? '' : $this->psr2VarExport($key).' => ') |
|
1662 | 1662 | . $this->psr2VarExport($value, "$indent "); |
1663 | 1663 | } |
1664 | - return "[\n" . implode(",\n", $r) . "\n" . $indent . ']'; |
|
1664 | + return "[\n".implode(",\n", $r)."\n".$indent.']'; |
|
1665 | 1665 | } |
1666 | 1666 | return var_export($var, true); |
1667 | 1667 | } |
@@ -85,11 +85,11 @@ discard block |
||
85 | 85 | |
86 | 86 | // Remove all beans and daos from junction tables |
87 | 87 | $junctionTables = $this->configuration->getSchemaAnalyzer()->detectJunctionTables(true); |
88 | - $junctionTableNames = array_map(function (Table $table) { |
|
88 | + $junctionTableNames = array_map(function(Table $table) { |
|
89 | 89 | return $table->getName(); |
90 | 90 | }, $junctionTables); |
91 | 91 | |
92 | - $tableList = array_filter($tableList, function (Table $table) use ($junctionTableNames) { |
|
92 | + $tableList = array_filter($tableList, function(Table $table) use ($junctionTableNames) { |
|
93 | 93 | return !in_array($table->getName(), $junctionTableNames, true); |
94 | 94 | }); |
95 | 95 | |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | $fileContent = $this->psr2Fix($fileContent); |
164 | 164 | // Add the declare strict-types directive |
165 | 165 | $commentEnd = strpos($fileContent, ' */') + 3; |
166 | - $fileContent = substr($fileContent, 0, $commentEnd) . "\n\ndeclare(strict_types=1);" . substr($fileContent, $commentEnd + 1); |
|
166 | + $fileContent = substr($fileContent, 0, $commentEnd)."\n\ndeclare(strict_types=1);".substr($fileContent, $commentEnd + 1); |
|
167 | 167 | |
168 | 168 | $this->dumpFile($possibleBaseFileName, $fileContent); |
169 | 169 | |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | $fileContent = $this->psr2Fix($fileContent); |
226 | 226 | // Add the declare strict-types directive |
227 | 227 | $commentEnd = strpos($fileContent, ' */') + 3; |
228 | - $fileContent = substr($fileContent, 0, $commentEnd) . "\n\ndeclare(strict_types=1);" . substr($fileContent, $commentEnd + 1); |
|
228 | + $fileContent = substr($fileContent, 0, $commentEnd)."\n\ndeclare(strict_types=1);".substr($fileContent, $commentEnd + 1); |
|
229 | 229 | |
230 | 230 | $this->dumpFile($possibleBaseFileName, $fileContent); |
231 | 231 | |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | |
310 | 310 | $constructorMethod = new MethodGenerator( |
311 | 311 | '__construct', |
312 | - [ new ParameterGenerator('container', ContainerInterface::class) ], |
|
312 | + [new ParameterGenerator('container', ContainerInterface::class)], |
|
313 | 313 | MethodGenerator::FLAG_PUBLIC, |
314 | 314 | '$this->container = $container;' |
315 | 315 | ); |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | |
326 | 326 | $daoInstanceProperty = new PropertyGenerator($daoInstanceName); |
327 | 327 | $daoInstanceProperty->setVisibility(AbstractMemberGenerator::VISIBILITY_PRIVATE); |
328 | - $daoInstanceProperty->setDocBlock(new DocBlockGenerator(null, null, [new VarTag(null, ['\\' . $daoNamespace . '\\' . $daoClassName, 'null'])])); |
|
328 | + $daoInstanceProperty->setDocBlock(new DocBlockGenerator(null, null, [new VarTag(null, ['\\'.$daoNamespace.'\\'.$daoClassName, 'null'])])); |
|
329 | 329 | $class->addPropertyFromGenerator($daoInstanceProperty); |
330 | 330 | |
331 | 331 | $fullClassNameVarExport = var_export($daoNamespace.'\\'.$daoClassName, true); |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | BODY; |
339 | 339 | |
340 | 340 | $getterMethod = new MethodGenerator( |
341 | - 'get' . $daoClassName, |
|
341 | + 'get'.$daoClassName, |
|
342 | 342 | [], |
343 | 343 | MethodGenerator::FLAG_PUBLIC, |
344 | 344 | $getterBody |
@@ -350,10 +350,10 @@ discard block |
||
350 | 350 | } |
351 | 351 | |
352 | 352 | $setterMethod = new MethodGenerator( |
353 | - 'set' . $daoClassName, |
|
354 | - [new ParameterGenerator($daoInstanceName, '\\' . $daoNamespace . '\\' . $daoClassName)], |
|
353 | + 'set'.$daoClassName, |
|
354 | + [new ParameterGenerator($daoInstanceName, '\\'.$daoNamespace.'\\'.$daoClassName)], |
|
355 | 355 | MethodGenerator::FLAG_PUBLIC, |
356 | - '$this->' . $daoInstanceName . ' = $' . $daoInstanceName . ';' |
|
356 | + '$this->'.$daoInstanceName.' = $'.$daoInstanceName.';' |
|
357 | 357 | ); |
358 | 358 | $setterMethod->setReturnType('void'); |
359 | 359 | $setterMethod = $this->configuration->getCodeGeneratorListener()->onDaoFactorySetterGenerated($setterMethod, $beanDescriptor, $this->configuration, $class); |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | $fileContent = $this->psr2Fix($fileContent); |
374 | 374 | // Add the declare strict-types directive |
375 | 375 | $commentEnd = strpos($fileContent, ' */') + 3; |
376 | - $fileContent = substr($fileContent, 0, $commentEnd) . "\n\ndeclare(strict_types=1);" . substr($fileContent, $commentEnd + 1); |
|
376 | + $fileContent = substr($fileContent, 0, $commentEnd)."\n\ndeclare(strict_types=1);".substr($fileContent, $commentEnd + 1); |
|
377 | 377 | |
378 | 378 | $this->dumpFile($possibleFileName, $fileContent); |
379 | 379 | } |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | $map = [ |
477 | 477 | Type::TARRAY => 'array', |
478 | 478 | Type::SIMPLE_ARRAY => 'array', |
479 | - 'json' => 'array', // 'json' is supported from Doctrine DBAL 2.6 only. |
|
479 | + 'json' => 'array', // 'json' is supported from Doctrine DBAL 2.6 only. |
|
480 | 480 | Type::JSON_ARRAY => 'array', |
481 | 481 | Type::BIGINT => 'string', |
482 | 482 | Type::BOOLEAN => 'bool', |
@@ -51,9 +51,9 @@ |
||
51 | 51 | $this->registry[$table->getName()] = new BeanDescriptor( |
52 | 52 | $table, |
53 | 53 | $this->configuration->getBeanNamespace(), |
54 | - $this->configuration->getBeanNamespace() . '\\Generated', |
|
54 | + $this->configuration->getBeanNamespace().'\\Generated', |
|
55 | 55 | $this->configuration->getDaoNamespace(), |
56 | - $this->configuration->getDaoNamespace() . '\\Generated', |
|
56 | + $this->configuration->getDaoNamespace().'\\Generated', |
|
57 | 57 | $this->configuration->getSchemaAnalyzer(), |
58 | 58 | $this->schema, |
59 | 59 | $this->tdbmSchemaAnalyzer, |
@@ -87,7 +87,7 @@ discard block |
||
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 |
||
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,23 +168,23 @@ discard block |
||
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); |
178 | 178 | } |
179 | 179 | |
180 | 180 | $setter = new MethodGenerator($setterName); |
181 | - $setter->setDocBlock(new DocBlockGenerator('The setter for the ' . $referencedBeanName . ' object bound to this object via the ' . implode(' and ', $this->foreignKey->getUnquotedLocalColumns()) . ' column.')); |
|
181 | + $setter->setDocBlock(new DocBlockGenerator('The setter for the '.$referencedBeanName.' object bound to this object via the '.implode(' and ', $this->foreignKey->getUnquotedLocalColumns()).' column.')); |
|
182 | 182 | |
183 | - $setter->setParameter(new ParameterGenerator('object', ($isNullable ? '?' : '') . $this->beanNamespace . '\\' . $referencedBeanName)); |
|
183 | + $setter->setParameter(new ParameterGenerator('object', ($isNullable ? '?' : '').$this->beanNamespace.'\\'.$referencedBeanName)); |
|
184 | 184 | |
185 | 185 | $setter->setReturnType('void'); |
186 | 186 | |
187 | - $setter->setBody('$this->setRef(' . var_export($tdbmFk->getCacheKey(), true) . ', $object, ' . var_export($tableName, true) . ');'); |
|
187 | + $setter->setBody('$this->setRef('.var_export($tdbmFk->getCacheKey(), true).', $object, '.var_export($tableName, true).');'); |
|
188 | 188 | |
189 | 189 | if ($this->isSetterProtected()) { |
190 | 190 | $setter->setVisibility(AbstractMemberGenerator::VISIBILITY_PROTECTED); |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | /** @var Annotation\JsonFormat|null $jsonFormat */ |
221 | 221 | $jsonFormat = $this->findAnnotation(Annotation\JsonFormat::class); |
222 | 222 | if ($jsonFormat !== null) { |
223 | - $method = $jsonFormat->method ?? 'get' . ucfirst($jsonFormat->property); |
|
223 | + $method = $jsonFormat->method ?? 'get'.ucfirst($jsonFormat->property); |
|
224 | 224 | $format = "$method()"; |
225 | 225 | } else { |
226 | 226 | $stopRecursion = $this->findAnnotation(Annotation\JsonRecursive::class) ? '' : 'true'; |
@@ -268,10 +268,10 @@ discard block |
||
268 | 268 | $columnGetterName = $descriptor->getGetterName(); |
269 | 269 | $rows[] = "'$indexName' => $propertyAccess->$columnGetterName()"; |
270 | 270 | } else { |
271 | - throw new TDBMException('PropertyDescriptor of class `' . get_class($descriptor) . '` cannot be serialized.'); |
|
271 | + throw new TDBMException('PropertyDescriptor of class `'.get_class($descriptor).'` cannot be serialized.'); |
|
272 | 272 | } |
273 | 273 | } |
274 | - return '[' . implode(', ', $rows) . ']'; |
|
274 | + return '['.implode(', ', $rows).']'; |
|
275 | 275 | } |
276 | 276 | |
277 | 277 | private function getBeanPropertyDescriptor(string $column): AbstractBeanPropertyDescriptor |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | return $descriptor; |
282 | 282 | } |
283 | 283 | } |
284 | - throw new TDBMException('PropertyDescriptor for `'.$this->table->getName().'`.`' . $column . '` not found in `' . $this->foreignBeanDescriptor->getTable()->getName() . '`'); |
|
284 | + throw new TDBMException('PropertyDescriptor for `'.$this->table->getName().'`.`'.$column.'` not found in `'.$this->foreignBeanDescriptor->getTable()->getName().'`'); |
|
285 | 285 | } |
286 | 286 | |
287 | 287 | /** |
@@ -40,7 +40,7 @@ |
||
40 | 40 | $alteredConf = new AlteredConfiguration($this->configuration); |
41 | 41 | |
42 | 42 | |
43 | - $loggers = [ new ConsoleLogger($output) ]; |
|
43 | + $loggers = [new ConsoleLogger($output)]; |
|
44 | 44 | |
45 | 45 | $logger = $alteredConf->getLogger(); |
46 | 46 | if ($logger) { |
@@ -252,7 +252,7 @@ |
||
252 | 252 | */ |
253 | 253 | public function jsonSerialize($stopRecursion = false) |
254 | 254 | { |
255 | - return array_map(function (AbstractTDBMObject $item) use ($stopRecursion) { |
|
255 | + return array_map(function(AbstractTDBMObject $item) use ($stopRecursion) { |
|
256 | 256 | return $item->jsonSerialize($stopRecursion); |
257 | 257 | }, $this->toArray()); |
258 | 258 | } |