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::doExecute()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 15
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 8
nc 2
nop 0
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