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.

InitCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 30
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A execute() 0 16 2
1
<?php
2
3
namespace Inspector\Application\Commands;
4
5
use Inspector\Application;
6
use Inspector\Application\Command;
7
use Illuminate\Filesystem\Filesystem;
8
use Symfony\Component\Console\Input\InputInterface;
9
use Symfony\Component\Console\Output\OutputInterface;
10
11
class InitCommand extends Command
12
{
13
14
    protected $name = 'init';
15
16
    protected $description = 'Initializes & generates an config file';
17
18
    /**
19
     * @param InputInterface $input
20
     * @param OutputInterface $output
21
     * @return int|null|void
22
     * @throws \Exception
23
     */
24
    protected function execute(InputInterface $input, OutputInterface $output)
25
    {
26
        /** @var FileSystem $fileSystem */
27
        $fileSystem = $this->getContainer()->make('filesystem');
28
29
        $sourceFile = __DIR__ . '/../../../' . Application::APP_DEFAULT_CONFIG . '.dist';
30
        $destinationFile = getcwd() . '/' . Application::APP_DEFAULT_CONFIG;
31
32
        if ($fileSystem->exists($destinationFile)) {
33
            throw new \Exception('Config file has already been initialized.');
34
        }
35
36
        $fileSystem->copy($sourceFile, $destinationFile);
37
38
        $output->writeln('<comment>Config file generated at:</comment> ' . $destinationFile);
39
    }
40
}
41