for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace PhpUnitGen\Console;
use Psr\Container\ContainerInterface;
use Symfony\Component\Console\Application as AbstractApplication;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
/**
* Class Application.
*
* @author Paul Thébaud <[email protected]>.
* @copyright 2017-2018 Paul Thébaud <[email protected]>.
* @license https://opensource.org/licenses/MIT The MIT license.
* @link https://github.com/paul-thebaud/phpunit-generator
* @since Class available since Release 2.0.0.
*/
class Application extends AbstractApplication
{
* Application constructor.
* @param ContainerInterface $container A container to manage dependencies.
public function __construct(ContainerInterface $container)
parent::__construct('phpunitgen', '2.0.0');
$this->add(new GenerateTestsCommand($container));
}
* {@inheritdoc}
public function doRun(InputInterface $input, OutputInterface $output)
if (! $output->isQuiet()) {
$output->writeln(sprintf(
"phpunitgen %s by Paul Thébaud.\n\n",
$this->getVersion()
));
if ($input->hasParameterOption('--version') ||
$input->hasParameterOption('-V')) {
exit;
exit
In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.
parent::doRun($input, $output);
In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.