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.
Test Failed
Push — master ( 09a43c...4f79d5 )
by Anton
03:00
created

DiceCommand   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 53.85%

Importance

Changes 0
Metric Value
dl 0
loc 25
ccs 7
cts 13
cp 0.5385
rs 10
c 0
b 0
f 0
wmc 4
lcom 0
cbo 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A configure() 0 4 1
A execute() 0 9 2
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;
9
10
use Symfony\Component\Console\Command\Command;
11
use Symfony\Component\Console\Input\InputArgument;
12
use Symfony\Component\Console\Input\InputInterface as Input;
13
use Symfony\Component\Console\Output\OutputInterface as Output;
14
15
class DiceCommand extends Command
16
{
17
    private $deployer;
18
19 6
    public function __construct()
20
    {
21 6
        parent::__construct('roll:dice');
22 6
        $this->setDescription('Roll any number of dice');
23 6
    }
24
25 6
    protected function configure()
26
    {
27 6
        $this->addArgument('number', InputArgument::OPTIONAL, 'Number of dice', 2);
28 6
    }
29
30
    protected function execute(Input $input, Output $output)
31
    {
32
        $number = intval($input->getArgument('number'));
33
        while ($number-- > 0) {
34
            $output->write(["⚀", "⚁", "⚂", "⚃", "⚄", "⚅"][rand(0, 5)]);
35
        }
36
        $output->write("\n");
37
        return 0;
38
    }
39
}
40