refactoring of makers
This commit is contained in:
parent
ae652b5059
commit
aaaa307651
|
@ -13,11 +13,11 @@ use Symfony\Component\Console\Input\InputArgument;
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
use function Symfony\Component\String\u;
|
use function Symfony\Component\String\u;
|
||||||
|
|
||||||
class MakeEntityFactory extends AbstractMaker
|
class MakeFactory extends AbstractMaker
|
||||||
{
|
{
|
||||||
public static function getCommandName(): string
|
public static function getCommandName(): string
|
||||||
{
|
{
|
||||||
return 'make:entity-factory';
|
return 'make:factory';
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getCommandDescription(): string
|
public static function getCommandDescription(): string
|
||||||
|
@ -28,16 +28,16 @@ class MakeEntityFactory extends AbstractMaker
|
||||||
public function configureCommand(Command $command, InputConfiguration $inputConf)
|
public function configureCommand(Command $command, InputConfiguration $inputConf)
|
||||||
{
|
{
|
||||||
$command
|
$command
|
||||||
->addArgument(
|
|
||||||
'entity-class',
|
|
||||||
InputArgument::OPTIONAL,
|
|
||||||
'Define the entity (e.g. <fg=yellow>MyEntity</>)'
|
|
||||||
)
|
|
||||||
->addArgument(
|
->addArgument(
|
||||||
'factory-class',
|
'factory-class',
|
||||||
InputArgument::OPTIONAL,
|
InputArgument::OPTIONAL,
|
||||||
'Choose a name for your factory (e.g. <fg=yellow>MyEntityFactory</>)'
|
'Choose a name for your factory (e.g. <fg=yellow>MyEntityFactory</>)'
|
||||||
)
|
)
|
||||||
|
->addArgument(
|
||||||
|
'entity-class',
|
||||||
|
InputArgument::OPTIONAL,
|
||||||
|
'Define the entity (e.g. <fg=yellow>MyEntity</>)'
|
||||||
|
)
|
||||||
->setHelp('')
|
->setHelp('')
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ class MakeEntityFactory extends AbstractMaker
|
||||||
|
|
||||||
$factoryPath = $generator->generateController(
|
$factoryPath = $generator->generateController(
|
||||||
$factoryDetails->getFullName(),
|
$factoryDetails->getFullName(),
|
||||||
__DIR__.'/../Resources/maker/entity/EntityFactory.tpl.php',
|
__DIR__.'/../Resources/maker/factory/Factory.tpl.php',
|
||||||
$options
|
$options
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue