@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | // Let's add the ORDER BY if any |
| 140 | 140 | if (isset($parsedSql['0']['ORDER'])) { |
| 141 | 141 | $orderByBuilder = new OrderByBuilder(); |
| 142 | - $processedSql .= " " . $orderByBuilder->build($parsedSql['0']['ORDER']); |
|
| 142 | + $processedSql .= " ".$orderByBuilder->build($parsedSql['0']['ORDER']); |
|
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | return [$processedSql, $sqlCount ?? $processedSqlCount, $columnDescriptors]; |
@@ -152,8 +152,8 @@ discard block |
||
| 152 | 152 | { |
| 153 | 153 | $selectBuilder = new SelectStatementBuilder(); |
| 154 | 154 | |
| 155 | - return implode(' UNION ', array_map(function ($clause) use ($selectBuilder) { |
|
| 156 | - return '(' . $selectBuilder->build($clause) . ')'; |
|
| 155 | + return implode(' UNION ', array_map(function($clause) use ($selectBuilder) { |
|
| 156 | + return '('.$selectBuilder->build($clause).')'; |
|
| 157 | 157 | }, $parsed['UNION'])); |
| 158 | 158 | } |
| 159 | 159 | |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | $alias = AbstractQueryFactory::getColumnAlias($tableName, $columnName); |
| 236 | 236 | $astColumn = [ |
| 237 | 237 | 'expr_type' => 'colref', |
| 238 | - 'base_expr' => $connection->quoteIdentifier($tableName) . '.' . $connection->quoteIdentifier($columnName), |
|
| 238 | + 'base_expr' => $connection->quoteIdentifier($tableName).'.'.$connection->quoteIdentifier($columnName), |
|
| 239 | 239 | 'no_quotes' => [ |
| 240 | 240 | 'delim' => '.', |
| 241 | 241 | 'parts' => [ |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | return $this->generateWrappedSqlCount($parsedSql); |
| 324 | 324 | } |
| 325 | 325 | |
| 326 | - $countSubExpr = array_map(function (array $item) { |
|
| 326 | + $countSubExpr = array_map(function(array $item) { |
|
| 327 | 327 | unset($item['alias']); |
| 328 | 328 | return $item; |
| 329 | 329 | }, $parsedSql['SELECT']); |
@@ -96,8 +96,8 @@ discard block |
||
| 96 | 96 | $schemaLockFileDumper = new SchemaLockFileDumper($connection, new ArrayCache(), Configuration::getDefaultLockFilePath()); |
| 97 | 97 | $tdbmSchemaAnalyzer = new TDBMSchemaAnalyzer($connection, new ArrayCache(), $schemaAnalyzer, $schemaLockFileDumper); |
| 98 | 98 | $tdbmDaoGenerator = new TDBMDaoGenerator(self::createConfiguration(), $tdbmSchemaAnalyzer); |
| 99 | - $rootPath = __DIR__ . '/../'; |
|
| 100 | - self::recursiveDelete(__DIR__. '/../../src/Test/Dao/'); |
|
| 99 | + $rootPath = __DIR__.'/../'; |
|
| 100 | + self::recursiveDelete(__DIR__.'/../../src/Test/Dao/'); |
|
| 101 | 101 | |
| 102 | 102 | $tdbmDaoGenerator->generateAllDaosAndBeans(); |
| 103 | 103 | } |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | if (is_file($str)) { |
| 114 | 114 | return @unlink($str); |
| 115 | 115 | } elseif (is_dir($str)) { |
| 116 | - $scan = glob(rtrim($str, '/') . '/*'); |
|
| 116 | + $scan = glob(rtrim($str, '/').'/*'); |
|
| 117 | 117 | foreach ($scan as $index => $path) { |
| 118 | 118 | self::recursiveDelete($path); |
| 119 | 119 | } |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | */ |
| 218 | 218 | public function getConstructorProperties(): array |
| 219 | 219 | { |
| 220 | - $constructorProperties = array_filter($this->beanPropertyDescriptors, static function (AbstractBeanPropertyDescriptor $property) { |
|
| 220 | + $constructorProperties = array_filter($this->beanPropertyDescriptors, static function(AbstractBeanPropertyDescriptor $property) { |
|
| 221 | 221 | return !$property instanceof InheritanceReferencePropertyDescriptor && $property->isCompulsory() && !$property->isReadOnly(); |
| 222 | 222 | }); |
| 223 | 223 | |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | public function getPropertiesWithDefault(): array |
| 233 | 233 | { |
| 234 | 234 | $properties = $this->getPropertiesForTable($this->table); |
| 235 | - $defaultProperties = array_filter($properties, function (AbstractBeanPropertyDescriptor $property) { |
|
| 235 | + $defaultProperties = array_filter($properties, function(AbstractBeanPropertyDescriptor $property) { |
|
| 236 | 236 | return $property->hasDefault(); |
| 237 | 237 | }); |
| 238 | 238 | |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | */ |
| 247 | 247 | public function getExposedProperties(): array |
| 248 | 248 | { |
| 249 | - $exposedProperties = array_filter($this->beanPropertyDescriptors, function (AbstractBeanPropertyDescriptor $property) { |
|
| 249 | + $exposedProperties = array_filter($this->beanPropertyDescriptors, function(AbstractBeanPropertyDescriptor $property) { |
|
| 250 | 250 | return !$property instanceof InheritanceReferencePropertyDescriptor && $property->getTable()->getName() === $this->table->getName(); |
| 251 | 251 | }); |
| 252 | 252 | |
@@ -352,7 +352,7 @@ discard block |
||
| 352 | 352 | foreach ($beanPropertyDescriptors as $beanDescriptor) { |
| 353 | 353 | $name = $beanDescriptor->getGetterName(); |
| 354 | 354 | if (isset($names[$name])) { |
| 355 | - throw new TDBMException('Unsolvable name conflict while generating method name "' . $name . '"'); |
|
| 355 | + throw new TDBMException('Unsolvable name conflict while generating method name "'.$name.'"'); |
|
| 356 | 356 | } else { |
| 357 | 357 | $names[$name] = $beanDescriptor; |
| 358 | 358 | } |
@@ -401,7 +401,7 @@ discard block |
||
| 401 | 401 | $assigns[] = $property->assignToDefaultCode()."\n"; |
| 402 | 402 | } |
| 403 | 403 | |
| 404 | - $body = $parentConstructorCode . implode('', $assigns); |
|
| 404 | + $body = $parentConstructorCode.implode('', $assigns); |
|
| 405 | 405 | |
| 406 | 406 | $constructor->setBody($body); |
| 407 | 407 | |
@@ -475,7 +475,7 @@ discard block |
||
| 475 | 475 | $this->descriptorsByMethodName[$name][] = $descriptor; |
| 476 | 476 | $descriptors = $this->descriptorsByMethodName[$name]; |
| 477 | 477 | if (count($descriptors) > 1) { |
| 478 | - $properties = array_filter($descriptors, function ($descriptor) { |
|
| 478 | + $properties = array_filter($descriptors, function($descriptor) { |
|
| 479 | 479 | return $descriptor instanceof AbstractBeanPropertyDescriptor; |
| 480 | 480 | }); |
| 481 | 481 | $renameProperties = count($properties) > 1; |
@@ -533,7 +533,7 @@ discard block |
||
| 533 | 533 | foreach ($this->getExposedProperties() as $beanPropertyDescriptor) { |
| 534 | 534 | $propertyCode = $beanPropertyDescriptor->getJsonSerializeCode(); |
| 535 | 535 | if (!empty($propertyCode)) { |
| 536 | - $body .= PHP_EOL . $propertyCode; |
|
| 536 | + $body .= PHP_EOL.$propertyCode; |
|
| 537 | 537 | } |
| 538 | 538 | } |
| 539 | 539 | |
@@ -541,11 +541,11 @@ discard block |
||
| 541 | 541 | foreach ($this->getMethodDescriptors() as $methodDescriptor) { |
| 542 | 542 | $methodCode = $methodDescriptor->getJsonSerializeCode(); |
| 543 | 543 | if (!empty($methodCode)) { |
| 544 | - $body .= PHP_EOL . $methodCode; |
|
| 544 | + $body .= PHP_EOL.$methodCode; |
|
| 545 | 545 | } |
| 546 | 546 | } |
| 547 | 547 | |
| 548 | - $body .= PHP_EOL . 'return $array;'; |
|
| 548 | + $body .= PHP_EOL.'return $array;'; |
|
| 549 | 549 | |
| 550 | 550 | $method->setBody($body); |
| 551 | 551 | |
@@ -641,10 +641,10 @@ discard block |
||
| 641 | 641 | /** @var AddInterface[] $addInterfaceAnnotations */ |
| 642 | 642 | $addInterfaceAnnotations = $this->annotationParser->getTableAnnotations($this->table)->findAnnotations(AddInterface::class); |
| 643 | 643 | |
| 644 | - $interfaces = [ JsonSerializable::class ]; |
|
| 644 | + $interfaces = [JsonSerializable::class]; |
|
| 645 | 645 | foreach ($addInterfaceAnnotations as $annotation) { |
| 646 | 646 | /** @phpstan-var class-string $className */ |
| 647 | - $className = $annotation->getName(); |
|
| 647 | + $className = $annotation->getName(); |
|
| 648 | 648 | $interfaces[] = $className; |
| 649 | 649 | } |
| 650 | 650 | |
@@ -683,7 +683,7 @@ discard block |
||
| 683 | 683 | } |
| 684 | 684 | } elseif ($methodDescriptor instanceof PivotTableMethodsDescriptor) { |
| 685 | 685 | $pivotTableMethodsDescriptors[] = $methodDescriptor; |
| 686 | - [ $getter, $adder, $remover, $has, $setter ] = $methodDescriptor->getCode(); |
|
| 686 | + [$getter, $adder, $remover, $has, $setter] = $methodDescriptor->getCode(); |
|
| 687 | 687 | $methods = $this->codeGeneratorListener->onBaseBeanManyToManyGenerated($getter, $adder, $remover, $has, $setter, $methodDescriptor, $this, $this->configuration, $class); |
| 688 | 688 | foreach ($methods as $method) { |
| 689 | 689 | if ($method) { |
@@ -813,7 +813,7 @@ discard block |
||
| 813 | 813 | $interfaces = []; |
| 814 | 814 | foreach ($addInterfaceOnDaoAnnotations as $annotation) { |
| 815 | 815 | /** @phpstan-var class-string $className */ |
| 816 | - $className = $annotation->getName(); |
|
| 816 | + $className = $annotation->getName(); |
|
| 817 | 817 | $interfaces[] = $className; |
| 818 | 818 | } |
| 819 | 819 | |
@@ -835,7 +835,7 @@ discard block |
||
| 835 | 835 | |
| 836 | 836 | $constructorMethod = new MethodGenerator( |
| 837 | 837 | '__construct', |
| 838 | - [ new ParameterGenerator('tdbmService', TDBMService::class) ], |
|
| 838 | + [new ParameterGenerator('tdbmService', TDBMService::class)], |
|
| 839 | 839 | MethodGenerator::FLAG_PUBLIC, |
| 840 | 840 | '$this->tdbmService = $tdbmService;', |
| 841 | 841 | 'Sets the TDBM service used by this DAO.' |
@@ -847,7 +847,7 @@ discard block |
||
| 847 | 847 | |
| 848 | 848 | $saveMethod = new MethodGenerator( |
| 849 | 849 | 'save', |
| 850 | - [ new ParameterGenerator('obj', $beanClassName) ], |
|
| 850 | + [new ParameterGenerator('obj', $beanClassName)], |
|
| 851 | 851 | MethodGenerator::FLAG_PUBLIC, |
| 852 | 852 | '$this->tdbmService->save($obj);', |
| 853 | 853 | (new DocBlockGenerator( |
@@ -895,7 +895,7 @@ discard block |
||
| 895 | 895 | |
| 896 | 896 | foreach ($primaryKeyColumns as $primaryKeyColumn) { |
| 897 | 897 | if ($primaryKeyColumn === $lazyLoadingParameterName) { |
| 898 | - throw new TDBMException('Primary Column name `' . $lazyLoadingParameterName . '` is not allowed.'); |
|
| 898 | + throw new TDBMException('Primary Column name `'.$lazyLoadingParameterName.'` is not allowed.'); |
|
| 899 | 899 | } |
| 900 | 900 | $phpType = TDBMDaoGenerator::dbalTypeToPhpType($this->table->getColumn($primaryKeyColumn)->getType()); |
| 901 | 901 | $parameters[] = new ParameterGenerator($primaryKeyColumn, $phpType); |
@@ -911,7 +911,7 @@ discard block |
||
| 911 | 911 | 'getById', |
| 912 | 912 | $parameters, |
| 913 | 913 | MethodGenerator::FLAG_PUBLIC, |
| 914 | - "return \$this->tdbmService->findObjectByPk('$tableName', [" . implode(', ', $primaryKeyFilter) . "], [], \$$lazyLoadingParameterName, \\$beanClassName::class, \\$resultIteratorClass::class);", |
|
| 914 | + "return \$this->tdbmService->findObjectByPk('$tableName', [".implode(', ', $primaryKeyFilter)."], [], \$$lazyLoadingParameterName, \\$beanClassName::class, \\$resultIteratorClass::class);", |
|
| 915 | 915 | (new DocBlockGenerator( |
| 916 | 916 | "Get $beanClassWithoutNameSpace specified by its ID (its primary key).", |
| 917 | 917 | 'If the primary key does not exist, an exception is thrown.', |
@@ -1199,7 +1199,7 @@ discard block |
||
| 1199 | 1199 | $class->addUse(ResultIterator::class); |
| 1200 | 1200 | $class->setExtendedClass(ResultIterator::class); |
| 1201 | 1201 | } else { |
| 1202 | - $class->addUse($this->resultIteratorNamespace . '\\' . $extends); |
|
| 1202 | + $class->addUse($this->resultIteratorNamespace.'\\'.$extends); |
|
| 1203 | 1203 | /** @var class-string $extends */ |
| 1204 | 1204 | $class->setExtendedClass($extends); |
| 1205 | 1205 | } |
@@ -1207,7 +1207,7 @@ discard block |
||
| 1207 | 1207 | $class->setDocBlock((new DocBlockGenerator( |
| 1208 | 1208 | "The $baseClassName class will iterate over results of $beanClassWithoutNameSpace class.", |
| 1209 | 1209 | null, |
| 1210 | - [new Tag\MethodTag('getIterator', ['\\' . $beanClassName . '[]']), new Tag\MethodTag('toArray', ['\\' . $beanClassName . '[]'])] |
|
| 1210 | + [new Tag\MethodTag('getIterator', ['\\'.$beanClassName.'[]']), new Tag\MethodTag('toArray', ['\\'.$beanClassName.'[]'])] |
|
| 1211 | 1211 | ))->setWordWrap(false)); |
| 1212 | 1212 | |
| 1213 | 1213 | $file = $this->codeGeneratorListener->onBaseResultIteratorGenerated($file, $this, $this->configuration); |
@@ -1263,7 +1263,7 @@ discard block |
||
| 1263 | 1263 | } |
| 1264 | 1264 | } |
| 1265 | 1265 | } |
| 1266 | - usort($methods, static function (MethodGenerator $methodA, MethodGenerator $methodB) { |
|
| 1266 | + usort($methods, static function(MethodGenerator $methodA, MethodGenerator $methodB) { |
|
| 1267 | 1267 | return $methodA->getName() <=> $methodB->getName(); |
| 1268 | 1268 | }); |
| 1269 | 1269 | |
@@ -1412,11 +1412,11 @@ discard block |
||
| 1412 | 1412 | |
| 1413 | 1413 | if ($index->isUnique()) { |
| 1414 | 1414 | $parameters[] = new ParameterGenerator('additionalTablesFetch', 'array', []); |
| 1415 | - $params[] = new ParamTag('additionalTablesFetch', [ 'string[]' ], 'A list of additional tables to fetch (for performance improvement)'); |
|
| 1416 | - $params[] = new ReturnTag([ '\\'.$beanNamespace.'\\'.$beanClassName, 'null' ]); |
|
| 1415 | + $params[] = new ParamTag('additionalTablesFetch', ['string[]'], 'A list of additional tables to fetch (for performance improvement)'); |
|
| 1416 | + $params[] = new ReturnTag(['\\'.$beanNamespace.'\\'.$beanClassName, 'null']); |
|
| 1417 | 1417 | $method->setReturnType('?\\'.$beanNamespace.'\\'.$beanClassName); |
| 1418 | 1418 | |
| 1419 | - $docBlock = new DocBlockGenerator("Get a $beanClassName filtered by ".implode(', ', $commentArguments). '.', null, $params); |
|
| 1419 | + $docBlock = new DocBlockGenerator("Get a $beanClassName filtered by ".implode(', ', $commentArguments).'.', null, $params); |
|
| 1420 | 1420 | $docBlock->setWordWrap(false); |
| 1421 | 1421 | |
| 1422 | 1422 | $body = "\$filter = [ |
@@ -1425,12 +1425,12 @@ discard block |
||
| 1425 | 1425 | "; |
| 1426 | 1426 | } else { |
| 1427 | 1427 | $parameters[] = (new ParameterGenerator('orderBy'))->setDefaultValue(null); |
| 1428 | - $params[] = new ParamTag('orderBy', [ 'mixed' ], 'The order string'); |
|
| 1428 | + $params[] = new ParamTag('orderBy', ['mixed'], 'The order string'); |
|
| 1429 | 1429 | $parameters[] = new ParameterGenerator('additionalTablesFetch', 'array', []); |
| 1430 | - $params[] = new ParamTag('additionalTablesFetch', [ 'string[]' ], 'A list of additional tables to fetch (for performance improvement)'); |
|
| 1430 | + $params[] = new ParamTag('additionalTablesFetch', ['string[]'], 'A list of additional tables to fetch (for performance improvement)'); |
|
| 1431 | 1431 | $parameters[] = (new ParameterGenerator('mode', '?int'))->setDefaultValue(null); |
| 1432 | - $params[] = new ParamTag('mode', [ 'int', 'null' ], 'Either TDBMService::MODE_ARRAY or TDBMService::MODE_CURSOR (for large datasets). Defaults to TDBMService::MODE_ARRAY.'); |
|
| 1433 | - $method->setReturnType($this->resultIteratorNamespace . '\\' . $this->getResultIteratorClassName()); |
|
| 1432 | + $params[] = new ParamTag('mode', ['int', 'null'], 'Either TDBMService::MODE_ARRAY or TDBMService::MODE_CURSOR (for large datasets). Defaults to TDBMService::MODE_ARRAY.'); |
|
| 1433 | + $method->setReturnType($this->resultIteratorNamespace.'\\'.$this->getResultIteratorClassName()); |
|
| 1434 | 1434 | |
| 1435 | 1435 | $docBlock = new DocBlockGenerator("Get a list of $beanClassName filtered by ".implode(', ', $commentArguments).".", null, $params); |
| 1436 | 1436 | $docBlock->setWordWrap(false); |
@@ -1490,8 +1490,8 @@ discard block |
||
| 1490 | 1490 | var_export($tdbmFk->getCacheKey(), true), |
| 1491 | 1491 | 'null', |
| 1492 | 1492 | var_export($this->table->getName(), true), |
| 1493 | - '\\' . $this->beanNamespace . '\\' . $this->namingStrategy->getBeanClassName($foreignTableName) . '::class', |
|
| 1494 | - '\\' . $this->resultIteratorNamespace . '\\' . $this->namingStrategy->getResultIteratorClassName($foreignTableName) . '::class' |
|
| 1493 | + '\\'.$this->beanNamespace.'\\'.$this->namingStrategy->getBeanClassName($foreignTableName).'::class', |
|
| 1494 | + '\\'.$this->resultIteratorNamespace.'\\'.$this->namingStrategy->getResultIteratorClassName($foreignTableName).'::class' |
|
| 1495 | 1495 | ); |
| 1496 | 1496 | } |
| 1497 | 1497 | } |
@@ -1772,10 +1772,10 @@ discard block |
||
| 1772 | 1772 | $r = []; |
| 1773 | 1773 | foreach ($var as $key => $value) { |
| 1774 | 1774 | $r[] = "$indent " |
| 1775 | - . ($indexed ? '' : $this->psr2VarExport($key) . ' => ') |
|
| 1775 | + . ($indexed ? '' : $this->psr2VarExport($key).' => ') |
|
| 1776 | 1776 | . $this->psr2VarExport($value, "$indent "); |
| 1777 | 1777 | } |
| 1778 | - return "[\n" . implode(",\n", $r) . "\n" . $indent . ']'; |
|
| 1778 | + return "[\n".implode(",\n", $r)."\n".$indent.']'; |
|
| 1779 | 1779 | } |
| 1780 | 1780 | return var_export($var, true); |
| 1781 | 1781 | } |
@@ -136,7 +136,7 @@ |
||
| 136 | 136 | if ($this->fetchStarted && $this->tdbmService->getConnection()->getDatabasePlatform() instanceof MySqlPlatform) { |
| 137 | 137 | // Optimisation: we don't need a separate "count" SQL request in MySQL. |
| 138 | 138 | assert($this->result instanceof Result); |
| 139 | - $this->count = (int)$this->result->rowCount(); |
|
| 139 | + $this->count = (int) $this->result->rowCount(); |
|
| 140 | 140 | return $this->count; |
| 141 | 141 | } |
| 142 | 142 | return $this->getRowCountViaSqlQuery(); |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | $foreignColumns = [$foreignColumns]; |
| 119 | 119 | } |
| 120 | 120 | } |
| 121 | - $options = array_diff_key($constraintDesc, ['column' => 0,'columns' => 0,'references' => 0]); |
|
| 121 | + $options = array_diff_key($constraintDesc, ['column' => 0, 'columns' => 0, 'references' => 0]); |
|
| 122 | 122 | $table->addForeignKeyConstraint($foreignTable, $localColumns, $foreignColumns, $options, $name); |
| 123 | 123 | } |
| 124 | 124 | |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | $name = implode('_', $columns); |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | - $options = array_diff_key($indexDesc, ['column' => 0,'columns' => 0]); |
|
| 156 | + $options = array_diff_key($indexDesc, ['column' => 0, 'columns' => 0]); |
|
| 157 | 157 | if (isset($indexDesc['unique']) && $indexDesc['unique'] === true) { |
| 158 | 158 | $table->addUniqueIndex($columns, $name, [], $options); |
| 159 | 159 | } else { |
@@ -93,11 +93,11 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | // Remove all beans and daos from junction tables |
| 95 | 95 | $junctionTables = $this->configuration->getSchemaAnalyzer()->detectJunctionTables(true); |
| 96 | - $junctionTableNames = array_map(function (Table $table) { |
|
| 96 | + $junctionTableNames = array_map(function(Table $table) { |
|
| 97 | 97 | return $table->getName(); |
| 98 | 98 | }, $junctionTables); |
| 99 | 99 | |
| 100 | - $tableList = array_filter($tableList, function (Table $table) use ($junctionTableNames) { |
|
| 100 | + $tableList = array_filter($tableList, function(Table $table) use ($junctionTableNames) { |
|
| 101 | 101 | return !in_array($table->getName(), $junctionTableNames, true); |
| 102 | 102 | }); |
| 103 | 103 | |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | $fileContent = $this->psr2Fix($fileContent); |
| 179 | 179 | // Add the declare strict-types directive |
| 180 | 180 | $commentEnd = strpos($fileContent, ' */') + 3; |
| 181 | - $fileContent = substr($fileContent, 0, $commentEnd) . "\n\ndeclare(strict_types=1);" . substr($fileContent, $commentEnd + 1); |
|
| 181 | + $fileContent = substr($fileContent, 0, $commentEnd)."\n\ndeclare(strict_types=1);".substr($fileContent, $commentEnd + 1); |
|
| 182 | 182 | |
| 183 | 183 | $this->dumpFile($possibleBaseFileName, $fileContent); |
| 184 | 184 | |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | $fileContent = $this->psr2Fix($fileContent); |
| 241 | 241 | // Add the declare strict-types directive |
| 242 | 242 | $commentEnd = strpos($fileContent, ' */') + 3; |
| 243 | - $fileContent = substr($fileContent, 0, $commentEnd) . "\n\ndeclare(strict_types=1);" . substr($fileContent, $commentEnd + 1); |
|
| 243 | + $fileContent = substr($fileContent, 0, $commentEnd)."\n\ndeclare(strict_types=1);".substr($fileContent, $commentEnd + 1); |
|
| 244 | 244 | |
| 245 | 245 | $this->dumpFile($possibleBaseFileName, $fileContent); |
| 246 | 246 | |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | private function psr2Fix(string $content): string |
| 279 | 279 | { |
| 280 | 280 | // Removes the extra blank line at the end (before: `\n\n`, after: `\n`) |
| 281 | - return rtrim($content, PHP_EOL) . PHP_EOL; |
|
| 281 | + return rtrim($content, PHP_EOL).PHP_EOL; |
|
| 282 | 282 | } |
| 283 | 283 | |
| 284 | 284 | /** |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | $resultIteratorClassName = $beanDescriptor->getResultIteratorClassName(); |
| 290 | 290 | $resultIteratorBaseClassName = $beanDescriptor->getBaseResultIteratorClassName(); |
| 291 | 291 | $resultIteratorNamespace = $this->configuration->getResultIteratorNamespace(); |
| 292 | - $resultIteratorBaseNamespace = $resultIteratorNamespace . '\\Generated'; |
|
| 292 | + $resultIteratorBaseNamespace = $resultIteratorNamespace.'\\Generated'; |
|
| 293 | 293 | $beanClassWithoutNameSpace = $beanDescriptor->getBeanClassName(); |
| 294 | 294 | $file = $beanDescriptor->generateResultIteratorPhpCode(); |
| 295 | 295 | if ($file === null) { |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | |
| 299 | 299 | $fileContent = $this->psr2Fix($file->generate()); |
| 300 | 300 | $commentEnd = strpos($fileContent, ' */') + 3; |
| 301 | - $fileContent = substr($fileContent, 0, $commentEnd) . "\n\ndeclare(strict_types=1);" . substr($fileContent, $commentEnd + 1); |
|
| 301 | + $fileContent = substr($fileContent, 0, $commentEnd)."\n\ndeclare(strict_types=1);".substr($fileContent, $commentEnd + 1); |
|
| 302 | 302 | |
| 303 | 303 | $baseResultIteratorFilePath = $this->configuration->getPathFinder()->getPath($resultIteratorBaseNamespace.'\\'.$resultIteratorBaseClassName)->getPathname(); |
| 304 | 304 | $this->dumpFile($baseResultIteratorFilePath, $fileContent); |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | |
| 364 | 364 | $constructorMethod = new MethodGenerator( |
| 365 | 365 | '__construct', |
| 366 | - [ new ParameterGenerator('container', ContainerInterface::class) ], |
|
| 366 | + [new ParameterGenerator('container', ContainerInterface::class)], |
|
| 367 | 367 | MethodGenerator::FLAG_PUBLIC, |
| 368 | 368 | '$this->container = $container;' |
| 369 | 369 | ); |
@@ -379,7 +379,7 @@ discard block |
||
| 379 | 379 | |
| 380 | 380 | $daoInstanceProperty = new PropertyGenerator($daoInstanceName); |
| 381 | 381 | $daoInstanceProperty->setVisibility(AbstractMemberGenerator::VISIBILITY_PRIVATE); |
| 382 | - $daoInstanceProperty->setDocBlock(new DocBlockGenerator(null, null, [new VarTag(null, ['\\' . $daoNamespace . '\\' . $daoClassName, 'null'])])); |
|
| 382 | + $daoInstanceProperty->setDocBlock(new DocBlockGenerator(null, null, [new VarTag(null, ['\\'.$daoNamespace.'\\'.$daoClassName, 'null'])])); |
|
| 383 | 383 | $class->addPropertyFromGenerator($daoInstanceProperty); |
| 384 | 384 | |
| 385 | 385 | $fullClassNameVarExport = var_export($daoNamespace.'\\'.$daoClassName, true); |
@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | BODY; |
| 393 | 393 | |
| 394 | 394 | $getterMethod = new MethodGenerator( |
| 395 | - 'get' . $daoClassName, |
|
| 395 | + 'get'.$daoClassName, |
|
| 396 | 396 | [], |
| 397 | 397 | MethodGenerator::FLAG_PUBLIC, |
| 398 | 398 | $getterBody |
@@ -404,10 +404,10 @@ discard block |
||
| 404 | 404 | } |
| 405 | 405 | |
| 406 | 406 | $setterMethod = new MethodGenerator( |
| 407 | - 'set' . $daoClassName, |
|
| 408 | - [new ParameterGenerator($daoInstanceName, '\\' . $daoNamespace . '\\' . $daoClassName)], |
|
| 407 | + 'set'.$daoClassName, |
|
| 408 | + [new ParameterGenerator($daoInstanceName, '\\'.$daoNamespace.'\\'.$daoClassName)], |
|
| 409 | 409 | MethodGenerator::FLAG_PUBLIC, |
| 410 | - '$this->' . $daoInstanceName . ' = $' . $daoInstanceName . ';' |
|
| 410 | + '$this->'.$daoInstanceName.' = $'.$daoInstanceName.';' |
|
| 411 | 411 | ); |
| 412 | 412 | $setterMethod->setReturnType('void'); |
| 413 | 413 | $setterMethod = $this->configuration->getCodeGeneratorListener()->onDaoFactorySetterGenerated($setterMethod, $beanDescriptor, $this->configuration, $class); |
@@ -427,7 +427,7 @@ discard block |
||
| 427 | 427 | $fileContent = $this->psr2Fix($fileContent); |
| 428 | 428 | // Add the declare strict-types directive |
| 429 | 429 | $commentEnd = strpos($fileContent, ' */') + 3; |
| 430 | - $fileContent = substr($fileContent, 0, $commentEnd) . "\n\ndeclare(strict_types=1);" . substr($fileContent, $commentEnd + 1); |
|
| 430 | + $fileContent = substr($fileContent, 0, $commentEnd)."\n\ndeclare(strict_types=1);".substr($fileContent, $commentEnd + 1); |
|
| 431 | 431 | |
| 432 | 432 | $this->dumpFile($possibleFileName, $fileContent); |
| 433 | 433 | } |
@@ -206,7 +206,7 @@ |
||
| 206 | 206 | |
| 207 | 207 | $db->table('users') |
| 208 | 208 | ->addAnnotation('AddTrait', ['name' => TestUserTrait::class], false) |
| 209 | - ->addAnnotation('AddTrait', ['name' => TestOtherUserTrait::class, 'modifiers' => ['\\' . TestOtherUserTrait::class . '::method1 insteadof \\' . TestUserTrait::class, '\\' . TestUserTrait::class . '::method1 as method1renamed']], false) |
|
| 209 | + ->addAnnotation('AddTrait', ['name' => TestOtherUserTrait::class, 'modifiers' => ['\\'.TestOtherUserTrait::class.'::method1 insteadof \\'.TestUserTrait::class, '\\'.TestUserTrait::class.'::method1 as method1renamed']], false) |
|
| 210 | 210 | ->addAnnotation('AddTraitOnDao', ['name' => TestUserDaoTrait::class], false) |
| 211 | 211 | ->implementsInterface(TestUserInterface::class) |
| 212 | 212 | ->implementsInterfaceOnDao(TestUserDaoInterface::class) |