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.

ConfigUnsetCommand   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 4
Bugs 1 Features 0
Metric Value
wmc 3
c 4
b 1
f 0
lcom 2
cbo 4
dl 0
loc 36
ccs 16
cts 16
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 14 1
A execute() 0 12 2
1
<?php
2
3
/*
4
 * This file is part of the slack-cli package.
5
 *
6
 * (c) Cas Leentfaar <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace CL\SlackCli\Command;
13
14
use Symfony\Component\Console\Input\InputArgument;
15
use Symfony\Component\Console\Input\InputInterface;
16
use Symfony\Component\Console\Output\OutputInterface;
17
18
/**
19
 * @author Cas Leentfaar <[email protected]>
20
 */
21
class ConfigUnsetCommand extends AbstractCommand
22
{
23
    /**
24
     * {@inheritDoc}
25
     */
26 1
    protected function configure()
27
    {
28 1
        parent::configure();
29
30 1
        $this->setName('config:unset');
31 1
        $this->setDescription('Removes the given setting from the configuration');
32 1
        $this->addArgument('setting', InputArgument::REQUIRED, 'The setting to remove');
33 1
        $this->setHelp(<<<EOT
34
The <info>config:unset</info> command lets you remove a given setting (and it's value) in the global configuration.
35
36
To list all stored settings and values, use the <info>config.list</info> command.
37
EOT
38 1
        );
39 1
    }
40
41
    /**
42
     * {@inheritdoc}
43
     */
44 1
    public function execute(InputInterface $input, OutputInterface $output)
45
    {
46 1
        $setting = $this->input->getArgument('setting');
47
48 1
        if (!$this->getConfig()->has($setting)) {
49 1
            $this->writeComment(sprintf('No changes made; there is no setting defined with the name `%s`', $setting));
50 1
        } else {
51 1
            $this->getConfigSource()->removeConfigSetting($setting);
52
53 1
            $this->writeOk(sprintf('Setting with name <info>`%s`</info> has been removed from the configuration!', $setting));
54
        }
55 1
    }
56
}
57