1 | <?php |
||
2 | |||
0 ignored issues
–
show
Coding Style
introduced
by
![]() |
|||
3 | namespace Db3v4l\Command; |
||
4 | |||
5 | use Symfony\Component\Console\Command\Command; |
||
0 ignored issues
–
show
The type
Symfony\Component\Console\Command\Command was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||
6 | use Symfony\Component\Console\Output\OutputInterface; |
||
0 ignored issues
–
show
The type
Symfony\Component\Console\Output\OutputInterface was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||
7 | use Symfony\Component\Console\Output\ConsoleOutputInterface; |
||
0 ignored issues
–
show
The type
Symfony\Component\Consol...\ConsoleOutputInterface was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||
8 | |||
9 | abstract class BaseCommand extends Command |
||
0 ignored issues
–
show
|
|||
10 | { |
||
11 | /** @var OutputInterface $output */ |
||
0 ignored issues
–
show
|
|||
12 | protected $output; |
||
13 | /** @var OutputInterface $errorOutput */ |
||
0 ignored issues
–
show
|
|||
14 | protected $errorOutput; |
||
15 | protected $verbosity = OutputInterface::VERBOSITY_NORMAL; |
||
16 | |||
17 | /** |
||
18 | * Small tricks to allow us to lower verbosity between NORMAL and QUIET and have a decent writeln API, even with old SF versions |
||
19 | * @param $message |
||
0 ignored issues
–
show
|
|||
20 | * @param int $verbosity |
||
0 ignored issues
–
show
|
|||
21 | * @param int $type |
||
0 ignored issues
–
show
|
|||
22 | */ |
||
0 ignored issues
–
show
|
|||
23 | protected function writeln($message, $verbosity = OutputInterface::VERBOSITY_NORMAL, $type = OutputInterface::OUTPUT_NORMAL) |
||
24 | { |
||
25 | if ($this->verbosity >= $verbosity) { |
||
26 | $this->output->writeln($message, $type); |
||
27 | } |
||
28 | } |
||
29 | /** |
||
0 ignored issues
–
show
|
|||
30 | * @param string|array $message The message as an array of lines or a single string |
||
0 ignored issues
–
show
|
|||
31 | * @param int $verbosity |
||
0 ignored issues
–
show
|
|||
32 | * @param int $type |
||
0 ignored issues
–
show
|
|||
33 | */ |
||
0 ignored issues
–
show
|
|||
34 | protected function writeErrorln($message, $verbosity = OutputInterface::VERBOSITY_QUIET, $type = OutputInterface::OUTPUT_NORMAL) |
||
35 | { |
||
36 | if ($this->verbosity >= $verbosity) { |
||
37 | |||
38 | // When verbosity is set to quiet, SF swallows the error message in the writeln call |
||
39 | // (unlike for other verbosity levels, which are left for us to handle...) |
||
40 | // We resort to a hackish workaround to _always_ print errors to stderr, even in quiet mode. |
||
41 | // If the end user does not want any error echoed, she can just 2>/dev/null |
||
42 | if ($this->errorOutput->getVerbosity() == OutputInterface::VERBOSITY_QUIET) { |
||
43 | $this->errorOutput->setVerbosity(OutputInterface::VERBOSITY_NORMAL); |
||
44 | $this->errorOutput->writeln($message, $type); |
||
45 | $this->errorOutput->setVerbosity(OutputInterface::VERBOSITY_QUIET); |
||
46 | } |
||
47 | else |
||
0 ignored issues
–
show
|
|||
48 | { |
||
49 | $this->errorOutput->writeln($message, $type); |
||
50 | } |
||
51 | } |
||
52 | } |
||
53 | |||
54 | protected function setOutput(OutputInterface $output) |
||
0 ignored issues
–
show
|
|||
55 | { |
||
56 | $this->output = $output; |
||
57 | $this->errorOutput = $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output; |
||
58 | } |
||
59 | |||
60 | protected function setVerbosity($verbosity) |
||
0 ignored issues
–
show
|
|||
61 | { |
||
62 | $this->verbosity = $verbosity; |
||
63 | } |
||
64 | } |
||
65 |