for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace AbterPhp\Framework\Console\Commands\AbterPhp;
use AbterPhp\Framework\Console\Commands\Oauth2\GenerateKeys;
use Opulence\Console\Commands\Command;
use Opulence\Console\Responses\IResponse;
class Setup extends Command
{
const NAME = 'abterphp:setup';
const DESCRIPTION = 'Setup Abterphp';
/** @var array */
protected $subCommands = [
/** @see GenerateKeys::doExecute() */
GenerateKeys::NAME,
];
/**
* @inheritdoc
*/
protected function define()
$this->setName(static::NAME)
->setDescription(static::DESCRIPTION);
}
* @param string $subCommand
public function addSubCommand(string $subCommand)
$this->subCommands[] = $subCommand;
protected function doExecute(IResponse $response)
foreach ($this->subCommands as $subCommand) {
try {
$this->commandCollection->call($subCommand, $response);
} catch (\Exception $e) {
$response->writeln(sprintf('<error>%s@execute failed</error>', $subCommand));
$response->writeln(sprintf('<fatal>%s</fatal>', $e->getMessage()));