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.

DnsCheckCommand   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 6

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 6
dl 0
loc 38
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 14 1
A doExecute() 0 17 3
1
<?php
2
3
namespace Kunstmaan\Skylab\Command;
4
5
use Symfony\Component\Console\Input\InputArgument;
6
7
class DnsCheckCommand extends AbstractCommand
8
{
9
    protected function configure()
10
    {
11
        $this
12
            ->addDefaults()
13
            ->setName('dnscheck')
14
            ->setDescription('Get the current DNS settings for all domains configured for this project')
15
            ->addArgument('project', InputArgument::OPTIONAL, 'The name of the Skylab project')
16
            ->setHelp(<<<EOT
17
The <info>nameservercheck</info> command get the current DNS settings for all domains configured for this project.
18
19
<info>php skylab.phar nameservercheck testproject</info>
20
EOT
21
            );
22
    }
23
24
    /**
25
     * @throws \RuntimeException
26
     */
27
    protected function doExecute()
28
    {
29
        $projectname = $this->dialogProvider->askFor("Please enter the name of the project", 'project');
30
        if ($this->fileSystemProvider->projectExists($projectname)) {
31
            $project = $this->projectConfigProvider->loadProjectConfig($projectname);
32
            $domains = array_merge(array($project['url']), $project['aliases']);
33
            $results = array();
34
            foreach ($domains as $domain) {
35
                $dnsSettings = $this->processProvider->executeCommand('dig +short ' . $domain);
36
                $results[] = array($domain, trim($dnsSettings)."\n");
37
            }
38
39
            $this->dialogProvider->renderTable(array('Project', 'DNS settings'), $results);
40
        } else {
41
            $this->dialogProvider->logError('Project not found');
42
        }
43
    }
44
}
45