Security update for permissions_by_term
[yaffs-website] / vendor / behat / behat / src / Behat / Testwork / Exception / Cli / VerbosityController.php
1 <?php
2
3 /*
4  * This file is part of the Behat.
5  * (c) Konstantin Kudryashov <ever.zet@gmail.com>
6  *
7  * For the full copyright and license information, please view the LICENSE
8  * file that was distributed with this source code.
9  */
10
11 namespace Behat\Testwork\Exception\Cli;
12
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;
18
19 /**
20  * Controls exception default verbosity level.
21  *
22  * @author Konstantin Kudryashov <ever.zet@gmail.com>
23  */
24 final class VerbosityController implements Controller
25 {
26     /**
27      * @var ExceptionPresenter
28      */
29     private $exceptionPresenter;
30
31     /**
32      * Initializes controller.
33      *
34      * @param ExceptionPresenter $exceptionPresenter
35      */
36     public function __construct(ExceptionPresenter $exceptionPresenter)
37     {
38         $this->exceptionPresenter = $exceptionPresenter;
39     }
40
41     /**
42      * Configures command to be executable by the controller.
43      *
44      * @param Command $command
45      */
46     public function configure(Command $command)
47     {
48     }
49
50     /**
51      * Executes controller.
52      *
53      * @param InputInterface  $input
54      * @param OutputInterface $output
55      *
56      * @return null|integer
57      */
58     public function execute(InputInterface $input, OutputInterface $output)
59     {
60         if ($output->getVerbosity() !== OutputInterface::VERBOSITY_NORMAL) {
61             $this->exceptionPresenter->setDefaultVerbosity($output->getVerbosity());
62         }
63     }
64 }