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 — 0.14 (#840)
by Jérémiah
02:25
created

Argument::count()   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 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Overblog\GraphQLBundle\Definition;
6
7
use function array_key_exists;
8
use function count;
9
10
class Argument implements ArgumentInterface
11
{
12
    private array $rawArguments = [];
13
14 110
    public function __construct(array $rawArguments = null)
15
    {
16 110
        $this->exchangeArray($rawArguments);
17 110
    }
18
19 110
    public function exchangeArray(array $array = null): array
20
    {
21 110
        $old = $this->rawArguments;
22 110
        $this->rawArguments = $array ?? [];
23
24 110
        return $old;
25
    }
26
27 48
    public function getArrayCopy(): array
28
    {
29 48
        return $this->rawArguments;
30
    }
31
32
    /**
33
     * @param int|string $offset
34
     */
35 60
    public function offsetExists($offset): bool
36
    {
37 60
        return array_key_exists($offset, $this->rawArguments);
38
    }
39
40
    /**
41
     * @param int|string $offset
42
     *
43
     * @return mixed|null
44
     */
45 58
    public function offsetGet($offset)
46
    {
47 58
        return $this->offsetExists($offset) ? $this->rawArguments[$offset] : null;
48
    }
49
50
    /**
51
     * @param int|string $offset
52
     * @param mixed      $value
53
     */
54 1
    public function offsetSet($offset, $value): void
55
    {
56 1
        $this->rawArguments[$offset] = $value;
57 1
    }
58
59
    /**
60
     * @param int|string $offset
61
     */
62 1
    public function offsetUnset($offset): void
63
    {
64 1
        unset($this->rawArguments[$offset]);
65 1
    }
66
67 1
    public function count(): int
68
    {
69 1
        return count($this->rawArguments);
70
    }
71
72 3
    public function __get(string $name)
73
    {
74 3
        return $this->rawArguments[$name] ?? null;
75
    }
76
}
77