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.

SetPermissionsCommand   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 8

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 8
dl 0
loc 41
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 15 1
A doExecute() 0 15 2
1
<?php
2
namespace Kunstmaan\Skylab\Command;
3
4
use Kunstmaan\Skylab\Skeleton\BaseSkeleton;
5
use RuntimeException;
6
use Symfony\Component\Console\Input\InputArgument;
7
8
/**
9
 * SetPermissionsCommand
10
 */
11
class SetPermissionsCommand extends AbstractCommand
12
{
13
14
    /**
15
     * Configures the current command.
16
     */
17
    protected function configure()
18
    {
19
        $this
20
            ->addDefaults()
21
            ->setName('permissions')
22
            ->setDescription('Set the permissions of a Skylab project')
23
            ->addArgument('name', InputArgument::REQUIRED, 'The name of the project')
24
            ->setHelp(<<<EOT
25
The <info>permissions</info> command will fix the permissions of a project.
26
27
<info>php skylab.phar permissions testproject</info>
28
29
EOT
30
            );
31
    }
32
33
    /**
34
     * @throws \RuntimeException
35
     */
36
    protected function doExecute()
37
    {
38
        $projectname = $this->input->getArgument('name');
39
40
        if (!$this->fileSystemProvider->projectExists($projectname)) {
41
            $this->dialogProvider->logError("The $projectname project does not exist.", false);
42
        }
43
44
        $this->dialogProvider->logStep("Setting permissions on project $projectname");
45
46
        /** @var BaseSkeleton $baseSkeleton */
47
        $baseSkeleton = $this->skeletonProvider->findSkeleton("base");
48
        $project = $this->projectConfigProvider->loadProjectConfig($projectname);
49
        $baseSkeleton->setPermissions($project, true);
50
    }
51
}
52