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::get()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 7
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 2
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