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.

UsesProviders::setup()   B
last analyzed

Complexity

Conditions 5
Paths 9

Size

Total Lines 31
Code Lines 24

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 31
rs 8.439
c 0
b 0
f 0
cc 5
eloc 24
nc 9
nop 4
1
<?php
2
3
namespace Kunstmaan\Skylab\Provider;
4
5
use Cilex\Application;
6
use Symfony\Component\Console\Input\InputInterface;
7
use Symfony\Component\Console\Output\OutputInterface;
8
9
trait UsesProviders
10
{
11
12
    /**
13
     * @var FileSystemProvider
14
     */
15
    protected $fileSystemProvider;
16
17
    /**
18
     * @var ProjectConfigProvider
19
     */
20
    protected $projectConfigProvider;
21
22
    /**
23
     * @var SkeletonProvider
24
     */
25
    protected $skeletonProvider;
26
27
    /**
28
     * @var ProcessProvider
29
     */
30
    protected $processProvider;
31
32
    /**
33
     * @var PermissionsProvider
34
     */
35
    protected $permissionsProvider;
36
37
    /**
38
     * @var DialogProvider
39
     */
40
    protected $dialogProvider;
41
42
    /**
43
     * @var RemoteProvider
44
     */
45
    protected $remoteProvider;
46
47
    /**
48
     * @var OutputInterface
49
     */
50
    protected $output;
51
52
    /**
53
     * @var InputInterface
54
     */
55
    protected $input;
56
57
    /**
58
     * @var Application
59
     */
60
    protected $app;
61
62
    /**
63
     * @var \Twig_Environment
64
     */
65
    protected $twig;
66
67
    /**
68
     * @var bool
69
     */
70
    protected $noInteraction = false;
71
72
    /**
73
     * @param Application     $app
74
     * @param InputInterface  $input
0 ignored issues
show
Documentation introduced by
Should the type for parameter $input not be null|InputInterface?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
75
     * @param OutputInterface $output
0 ignored issues
show
Documentation introduced by
Should the type for parameter $output not be null|OutputInterface?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
76
     * @param bool            $setupClassVars
77
     */
78
    public function setup(Application $app, InputInterface $input = null, OutputInterface $output = null, $setupClassVars = false)
79
    {
80
        $providers = array(
81
            'filesystem' => 'fileSystemProvider',
82
            'projectconfig' => 'projectConfigProvider',
83
            'skeleton' => 'skeletonProvider',
84
            'process' => 'processProvider',
85
            'permission' => 'permissionsProvider',
86
            'dialog' => 'dialogProvider',
87
            'remote' => 'remoteProvider',
88
        );
89
        foreach ($providers as $service => $variable) {
90
            $this->$variable = $app[$service];
91
            if ($setupClassVars) {
92
                $this->$variable->setup($app, $input, $output);
93
            }
94
        }
95
        $this->output = $output;
96
        $this->input = $input;
97
        $this->app = $app;
98
        $this->twig = $app["twig"];
99
100
        if ($input) {
101
            $this->noInteraction = (bool) $input->getOption("no-interaction");
102
            $app["no-interaction"] = true;
103
        } elseif ($app["no-interaction"]) {
104
            $this->noInteraction = $app["no-interaction"];
105
        } else {
106
            $this->noInteraction = false;
107
        }
108
    }
109
110
}
111