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

Completed
Pull Request — 0.13 (#745)
by Timur
12:56
created

GlobalVariables::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Overblog\GraphQLBundle\Definition;
6
7
final class GlobalVariables
8
{
9
    /** @var array */
10
    private $services;
11
12 147
    public function __construct(array $services = [])
13
    {
14 147
        $this->services = $services;
15 147
    }
16
17
    /**
18
     * @param string $name
19
     *
20
     * @return mixed
21
     */
22 139
    public function get(string $name)
23
    {
24 139
        if (!isset($this->services[$name])) {
25 1
            throw new \LogicException(\sprintf('Global variable %s could not be located. You should define it.', \json_encode($name)));
26
        }
27
28 138
        return $this->services[$name];
29
    }
30
31
    /**
32
     * @param string $name
33
     *
34
     * @return bool
35
     */
36
    public function has(string $name): bool
37
    {
38
        return isset($this->services[$name]);
39
    }
40
}
41