GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 99078a...9605c1 )
by Oanh
02:49
created

VerbosityString   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 91.67%
Metric Value
wmc 7
lcom 0
cbo 1
dl 0
loc 48
ccs 22
cts 24
cp 0.9167
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
B __toString() 0 29 6
1
<?php
2
/* (c) Anton Medvedev <[email protected]>
3
 *
4
 * For the full copyright and license information, please view the LICENSE
5
 * file that was distributed with this source code.
6
 */
7
8
namespace Deployer\Console\Output;
9
10
use Symfony\Component\Console\Output\OutputInterface;
11
12
class VerbosityString
13
{
14
    /**
15
     * @var OutputInterface
16
     */
17
    private $output;
18
19
    /**
20
     * @param OutputInterface $output
21
     */
22 7
    public function __construct(OutputInterface $output)
23
    {
24 7
        $this->output = $output;
25 7
    }
26
27
    /**
28
     * @return string
29
     */
30 7
    public function __toString()
31
    {
32 7
        switch ($this->output->getVerbosity()) {
33 7
            case OutputInterface::VERBOSITY_NORMAL:
34 3
                $verbosity = '';
35 3
                break;
36
37 4
            case OutputInterface::VERBOSITY_VERBOSE:
38 1
                $verbosity = '-v';
39 1
                break;
40
41 3
            case OutputInterface::VERBOSITY_VERY_VERBOSE:
42 1
                $verbosity = '-vv';
43 1
                break;
44
45 2
            case OutputInterface::VERBOSITY_DEBUG:
46 1
                $verbosity = '-vvv';
47 1
                break;
48
49 1
            case OutputInterface::VERBOSITY_QUIET:
50 1
                $verbosity = '-q';
51 1
                break;
52
53
            default:
54
                $verbosity = '';
55 7
        }
56
57 7
        return $verbosity;
58
    }
59
}
60