@@ -207,7 +207,7 @@ |
||
| 207 | 207 | if (strlen($alias) <= 30) { // Older oracle version had a limit of 30 characters for identifiers |
| 208 | 208 | return $alias; |
| 209 | 209 | } |
| 210 | - return substr($columnName, 0, 20) . crc32($tableName.'____'.$columnName); |
|
| 210 | + return substr($columnName, 0, 20).crc32($tableName.'____'.$columnName); |
|
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | abstract protected function compute(): void; |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | */ |
| 85 | 85 | public static function createResultIterator(QueryFactory $queryFactory, array $parameters, ObjectStorageInterface $objectStorage, ?string $className, TDBMService $tdbmService, MagicQuery $magicQuery, int $mode, LoggerInterface $logger): self |
| 86 | 86 | { |
| 87 | - $iterator = new static(); |
|
| 87 | + $iterator = new static(); |
|
| 88 | 88 | if ($mode !== TDBMService::MODE_CURSOR && $mode !== TDBMService::MODE_ARRAY) { |
| 89 | 89 | throw new TDBMException("Unknown fetch mode: '".$mode."'"); |
| 90 | 90 | } |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | */ |
| 282 | 282 | public function jsonSerialize($stopRecursion = false) |
| 283 | 283 | { |
| 284 | - return array_map(function (AbstractTDBMObject $item) use ($stopRecursion) { |
|
| 284 | + return array_map(function(AbstractTDBMObject $item) use ($stopRecursion) { |
|
| 285 | 285 | return $item->jsonSerialize($stopRecursion); |
| 286 | 286 | }, $this->toArray()); |
| 287 | 287 | } |
@@ -142,7 +142,7 @@ |
||
| 142 | 142 | public function getIncomingForeignKeys(string $tableName): array |
| 143 | 143 | { |
| 144 | 144 | $junctionTables = $this->schemaAnalyzer->detectJunctionTables(true); |
| 145 | - $junctionTableNames = array_map(function (Table $table) { |
|
| 145 | + $junctionTableNames = array_map(function(Table $table) { |
|
| 146 | 146 | return $table->getName(); |
| 147 | 147 | }, $junctionTables); |
| 148 | 148 | $childrenRelationships = $this->schemaAnalyzer->getChildrenRelationships($tableName); |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | |
| 50 | 50 | $fromLock = (bool) $input->getOption('from-lock'); |
| 51 | 51 | |
| 52 | - $loggers = [ new ConsoleLogger($output) ]; |
|
| 52 | + $loggers = [new ConsoleLogger($output)]; |
|
| 53 | 53 | |
| 54 | 54 | $logger = $alteredConf->getLogger(); |
| 55 | 55 | if ($logger) { |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | { |
| 9 | 9 | public static function getValidVariableName(string $variableName): string |
| 10 | 10 | { |
| 11 | - $valid = preg_replace_callback('/^(\d+)/', static function (array $match) { |
|
| 11 | + $valid = preg_replace_callback('/^(\d+)/', static function(array $match) { |
|
| 12 | 12 | $f = new \NumberFormatter('en', \NumberFormatter::SPELLOUT); |
| 13 | 13 | $number = $f->format((int) $match[0]); |
| 14 | 14 | return preg_replace('/[^a-z]+/i', '_', $number); |
@@ -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 | } |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | */ |
| 68 | 68 | public function getParamAnnotation(): ParamTag |
| 69 | 69 | { |
| 70 | - return new ParamTag($this->getSafeVariableName(), [ $this->getPhpType() ]); |
|
| 70 | + return new ParamTag($this->getSafeVariableName(), [$this->getPhpType()]); |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | public function getVariableName(): string |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | public function getSafeVariableName(): string |
| 79 | 79 | { |
| 80 | - return '$' . StringUtils::getValidVariableName(ltrim($this->getVariableName(), '$')); |
|
| 80 | + return '$'.StringUtils::getValidVariableName(ltrim($this->getVariableName(), '$')); |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | public function getSetterName(): string |
@@ -89,11 +89,11 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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', |
@@ -19,12 +19,12 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | private const LEVELS = array( |
| 21 | 21 | LogLevel::EMERGENCY, // 0 |
| 22 | - LogLevel::ALERT, // 1 |
|
| 23 | - LogLevel::CRITICAL, // 2 |
|
| 24 | - LogLevel::ERROR, // 3 |
|
| 25 | - LogLevel::WARNING, // 4 |
|
| 26 | - LogLevel::NOTICE, // 5 |
|
| 27 | - LogLevel::INFO, // 6 |
|
| 22 | + LogLevel::ALERT, // 1 |
|
| 23 | + LogLevel::CRITICAL, // 2 |
|
| 24 | + LogLevel::ERROR, // 3 |
|
| 25 | + LogLevel::WARNING, // 4 |
|
| 26 | + LogLevel::NOTICE, // 5 |
|
| 27 | + LogLevel::INFO, // 6 |
|
| 28 | 28 | LogLevel::DEBUG // 7 |
| 29 | 29 | ); |
| 30 | 30 | |