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
Push — 0.13 ( ff6287...cab464 )
by Jérémiah
16s queued 11s
created

GlobalVariables   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
eloc 7
dl 0
loc 32
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A has() 0 3 1
A __construct() 0 3 1
A get() 0 7 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 116
    public function __construct(array $services = [])
13
    {
14 116
        $this->services = $services;
15 116
    }
16
17
    /**
18
     * @param string $name
19
     *
20
     * @return mixed
21
     */
22 108
    public function get(string $name)
23
    {
24 108
        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 107
        return $this->services[$name];
29
    }
30
31
    /**
32
     * @param string $name
33
     *
34
     * @return bool
35
     */
36 1
    public function has(string $name): bool
37
    {
38 1
        return isset($this->services[$name]);
39
    }
40
}
41