@@ -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) |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | */ |
| 83 | 83 | public static function createResultIterator(QueryFactory $queryFactory, array $parameters, ObjectStorageInterface $objectStorage, ?string $className, TDBMService $tdbmService, MagicQuery $magicQuery, int $mode, LoggerInterface $logger): self |
| 84 | 84 | { |
| 85 | - $iterator = new static(); |
|
| 85 | + $iterator = new static(); |
|
| 86 | 86 | if ($mode !== TDBMService::MODE_CURSOR && $mode !== TDBMService::MODE_ARRAY) { |
| 87 | 87 | throw new TDBMException("Unknown fetch mode: '".$mode."'"); |
| 88 | 88 | } |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | */ |
| 274 | 274 | public function jsonSerialize($stopRecursion = false): mixed |
| 275 | 275 | { |
| 276 | - return array_map(function (AbstractTDBMObject $item) use ($stopRecursion) { |
|
| 276 | + return array_map(function(AbstractTDBMObject $item) use ($stopRecursion) { |
|
| 277 | 277 | return $item->jsonSerialize($stopRecursion); |
| 278 | 278 | }, $this->toArray()); |
| 279 | 279 | } |
@@ -274,7 +274,7 @@ |
||
| 274 | 274 | */ |
| 275 | 275 | public function jsonSerialize(): mixed |
| 276 | 276 | { |
| 277 | - return array_map(function (AbstractTDBMObject $item) { |
|
| 277 | + return array_map(function(AbstractTDBMObject $item) { |
|
| 278 | 278 | return $item->jsonSerialize(); |
| 279 | 279 | }, $this->toArray()); |
| 280 | 280 | } |