PHP Class Cilex\Application

Author: Mike van Riel ([email protected])
Inheritance: extends Pimple\Container
Show file Open project: cilex/cilex Class Usage Examples

Public Methods

Method Description
__construct ( string $name, string | null $version = null, array $values = [] ) Registers the autoloader and necessary components.
boot ( ) : void Boots the Application by calling boot on every provider added and then subscribe in order to add listeners.
command ( string | Command $nameOrCommand, callable | null $callable = null ) : Command Allows you to add a command as Command object or as a command name+callable
register ( Pimple\ServiceProviderInterface $provider, array $values = [] ) {@inheritDoc}
run ( Symfony\Component\Console\Input\InputInterface $input = null, Symfony\Component\Console\Output\OutputInterface $output = null ) : integer Executes this application.

Method Details

__construct() public method

Registers the autoloader and necessary components.
public __construct ( string $name, string | null $version = null, array $values = [] )
$name string Name for this application.
$version string | null Version number for this application.
$values array

boot() public method

Boots the Application by calling boot on every provider added and then subscribe in order to add listeners.
public boot ( ) : void
return void

command() public method

Allows you to add a command as Command object or as a command name+callable
public command ( string | Command $nameOrCommand, callable | null $callable = null ) : Command
$nameOrCommand string | Symfony\Component\Console\Command\Command
$callable callable | null Must be a callable if $nameOrCommand is the command's name
return Symfony\Component\Console\Command\Command The command instance that you can further configure

register() public method

{@inheritDoc}
public register ( Pimple\ServiceProviderInterface $provider, array $values = [] )
$provider Pimple\ServiceProviderInterface
$values array

run() public method

Executes this application.
public run ( Symfony\Component\Console\Input\InputInterface $input = null, Symfony\Component\Console\Output\OutputInterface $output = null ) : integer
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
return integer