Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Passed
Pull Request — master (#277)
by Jérémiah
22:38 queued 19:05
created

LazyConfig::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
crap 1
1
<?php
2
3
namespace Overblog\GraphQLBundle\Definition;
4
5
final class LazyConfig
6
{
7
    /** @var \Closure */
8
    private $loader;
9
10
    /** @var GlobalVariables */
11
    private $globalVariables;
12
13
    /**
14
     * @var callable
15
     */
16
    private $onPostLoad = [];
17
18 79
    private function __construct(\Closure $loader, GlobalVariables $globalVariables = null)
19
    {
20 79
        $this->loader = $loader;
21 79
        $this->globalVariables = $globalVariables ?: new GlobalVariables();
22 79
    }
23
24 79
    public static function create(\Closure $loader, GlobalVariables $globalVariables = null)
25
    {
26 79
        return new self($loader, $globalVariables);
27
    }
28
29
    /**
30
     * @return array
31
     */
32 77
    public function load()
33
    {
34 77
        $loader = $this->loader;
35 77
        $config = $loader($this->globalVariables);
36 77
        foreach ($this->onPostLoad as $postLoader) {
0 ignored issues
show
Bug introduced by
The expression $this->onPostLoad of type callable is not traversable.
Loading history...
37 77
            $config = $postLoader($config);
38
        }
39
40 77
        return $config;
41
    }
42
43 77
    public function addPostLoader(callable $postLoader)
44
    {
45 77
        $this->onPostLoad[] = $postLoader;
46 77
    }
47
}
48