Safe application is now a trait

2.x
Julien Rosset 2 years ago
parent 218f8b3af0
commit 5948f89fa2

@ -2,7 +2,6 @@
namespace jrosset\CliProgram; namespace jrosset\CliProgram;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\OutputInterface;
@ -11,7 +10,7 @@ use Throwable;
/** /**
* A “safe” application: runtime exception are treated by {@see SafeApplication::processRuntimeException()} * A “safe” application: runtime exception are treated by {@see SafeApplication::processRuntimeException()}
*/ */
class SafeApplication extends Application { trait SafeApplication {
/** /**
* @var int The exit code used when command failed with an exception * @var int The exit code used when command failed with an exception
* *

@ -0,0 +1,7 @@
<?php
use jrosset\CliProgram\SafeApplication;
class Application extends \Symfony\Component\Console\Application {
use SafeApplication;
}
Loading…
Cancel
Save