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.

RemoveKeyCommand   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 26
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A execute() 0 5 1
A __construct() 0 5 1
A configure() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Damax\Bundle\ApiAuthBundle\Command\Storage;
6
7
use Damax\Bundle\ApiAuthBundle\Key\Storage\Writer as Storage;
8
use Symfony\Component\Console\Command\Command;
9
use Symfony\Component\Console\Input\InputArgument;
10
use Symfony\Component\Console\Input\InputInterface;
11
use Symfony\Component\Console\Output\OutputInterface;
12
use Symfony\Component\Console\Style\SymfonyStyle;
13
14
final class RemoveKeyCommand extends Command
15
{
16
    protected static $defaultName = 'damax:api-auth:storage:remove-key';
17
18
    private $storage;
19
20
    public function __construct(Storage $storage)
21
    {
22
        parent::__construct();
23
24
        $this->storage = $storage;
25
    }
26
27
    protected function configure()
28
    {
29
        $this
30
            ->setDescription('Remove api key from storage.')
31
            ->addArgument('key', InputArgument::REQUIRED, 'Api key.')
32
        ;
33
    }
34
35
    protected function execute(InputInterface $input, OutputInterface $output)
36
    {
37
        $this->storage->remove($input->getArgument('key'));
38
39
        (new SymfonyStyle($input, $output))->success('Done');
40
    }
41
}
42