Class CommandFactory
This is a factory for creating Command instances.
This factory can be replaced or extended if you need to customize building your command objects.
Namespace: Cake\Console
Method Summary
-
__construct() public
Constructor
-
create() public
The factory method for creating Command instances.
-
hasConstructorDependencies() protected
Check whether a command needs other constructor dependencies than this factory.
Those commands are auto-wired by the container.
Method Detail
__construct() ¶ public
__construct(Cake\Container\ContainerInterface|null $container = null)
Constructor
Parameters
-
Cake\Container\ContainerInterface|null$container optional The container to use if available.
create() ¶ public
create(class-string<Cake\Console\CommandInterface> $className): Cake\Console\CommandInterface
The factory method for creating Command instances.
Parameters
-
class-string<Cake\Console\CommandInterface>$className
Returns
Cake\Console\CommandInterfacehasConstructorDependencies() ¶ protected
hasConstructorDependencies(class-string<Cake\Console\CommandInterface> $className): bool
Check whether a command needs other constructor dependencies than this factory.
Those commands are auto-wired by the container.
Parameters
-
class-string<Cake\Console\CommandInterface>$className Command class name.
Returns
bool