OutputStyle   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 64
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 3
Bugs 1 Features 0
Metric Value
wmc 5
c 3
b 1
f 0
lcom 1
cbo 2
dl 0
loc 64
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A isQuiet() 0 4 1
A isVerbose() 0 4 1
A isVeryVerbose() 0 4 1
A isDebug() 0 4 1
1
<?php
2
3
use Symfony\Component\Console\Input\InputInterface;
4
use Symfony\Component\Console\Output\OutputInterface;
5
use Symfony\Component\Console\Style\SymfonyStyle;
6
7
/**
8
 * Class OutputStyle.
9
 *
10
 * Shameless copy/paste from Taylor Otwell's Laravel
11
 */
12
class OutputStyle extends SymfonyStyle
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
13
{
14
    /**
15
     * The output instance.
16
     *
17
     * @var \Symfony\Component\Console\Output\OutputInterface
18
     */
19
    private $output;
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
20
21
    /**
22
     * Create a new Console OutputStyle instance.
23
     *
24
     * @param \Symfony\Component\Console\Input\InputInterface   $input
25
     * @param \Symfony\Component\Console\Output\OutputInterface $output
26
     *
27
     * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
28
     */
29
    public function __construct(InputInterface $input, OutputInterface $output)
30
    {
31
        $this->output = $output;
32
33
        parent::__construct($input, $output);
34
    }
35
36
    /**
37
     * Returns whether verbosity is quiet (-q).
38
     *
39
     * @return bool
40
     */
41
    public function isQuiet()
42
    {
43
        return $this->output->isQuiet();
44
    }
45
46
    /**
47
     * Returns whether verbosity is verbose (-v).
48
     *
49
     * @return bool
50
     */
51
    public function isVerbose()
52
    {
53
        return $this->output->isVerbose();
54
    }
55
56
    /**
57
     * Returns whether verbosity is very verbose (-vv).
58
     *
59
     * @return bool
60
     */
61
    public function isVeryVerbose()
62
    {
63
        return $this->output->isVeryVerbose();
64
    }
65
66
    /**
67
     * Returns whether verbosity is debug (-vvv).
68
     *
69
     * @return bool
70
     */
71
    public function isDebug()
72
    {
73
        return $this->output->isDebug();
74
    }
75
}
76