|
@@ -89,11 +89,11 @@ discard block |
|
|
block discarded – undo |
|
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 |
|
|
block discarded – undo |
|
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 |
|
|
block discarded – undo |
|
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 |
|
|
block discarded – undo |
|
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 |
|
|
block discarded – undo |
|
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 |
|
|
block discarded – undo |
|
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 |
|
|
block discarded – undo |
|
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 |
|
|
block discarded – undo |
|
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 |
|
|
block discarded – undo |
|
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 |
|
|
block discarded – undo |
|
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 |
|
|
block discarded – undo |
|
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 |
|
|
block discarded – undo |
|
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', |