4 * This file is part of the Behat.
5 * (c) Konstantin Kudryashov <ever.zet@gmail.com>
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
11 namespace Behat\Testwork\Exception\Cli;
13 use Behat\Testwork\Cli\Controller;
14 use Behat\Testwork\Exception\ExceptionPresenter;
15 use Symfony\Component\Console\Command\Command;
16 use Symfony\Component\Console\Input\InputInterface;
17 use Symfony\Component\Console\Output\OutputInterface;
20 * Controls exception default verbosity level.
22 * @author Konstantin Kudryashov <ever.zet@gmail.com>
24 final class VerbosityController implements Controller
27 * @var ExceptionPresenter
29 private $exceptionPresenter;
32 * Initializes controller.
34 * @param ExceptionPresenter $exceptionPresenter
36 public function __construct(ExceptionPresenter $exceptionPresenter)
38 $this->exceptionPresenter = $exceptionPresenter;
42 * Configures command to be executable by the controller.
44 * @param Command $command
46 public function configure(Command $command)
51 * Executes controller.
53 * @param InputInterface $input
54 * @param OutputInterface $output
56 * @return null|integer
58 public function execute(InputInterface $input, OutputInterface $output)
60 if ($output->getVerbosity() !== OutputInterface::VERBOSITY_NORMAL) {
61 $this->exceptionPresenter->setDefaultVerbosity($output->getVerbosity());