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 — master ( 73cd7f...5ec16c )
by Jérémiah
14s queued 10s
created

Argument   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 65
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 10
eloc 19
dl 0
loc 65
ccs 29
cts 29
cp 1
rs 10
c 0
b 0
f 0

9 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A count() 0 3 1
A offsetUnset() 0 3 1
A getArrayCopy() 0 3 1
A exchangeArray() 0 6 1
A offsetExists() 0 3 1
A offsetGet() 0 3 2
A offsetSet() 0 3 1
A getRawArguments() 0 12 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Overblog\GraphQLBundle\Definition;
6
7
class Argument implements ArgumentInterface
8
{
9
    /** @var array */
10
    private $rawArguments = [];
11
12 86
    public function __construct(?array $rawArguments = null)
13
    {
14 86
        $this->exchangeArray($rawArguments);
15 86
    }
16
17 86
    public function exchangeArray($array): array
18
    {
19 86
        $old = $this->rawArguments;
20 86
        $this->rawArguments = $array ?? [];
21
22 86
        return $old;
23
    }
24
25 30
    public function getArrayCopy(): array
26
    {
27 30
        return $this->rawArguments;
28
    }
29
30
    /**
31
     * @return array
32
     *
33
     * @deprecated This method is deprecated since 0.12 and will be removed in 0.13. You should use getArrayCopy method instead.
34
     */
35 1
    public function getRawArguments(): array
36
    {
37 1
        @\trigger_error(
38 1
            \sprintf(
39 1
                'This "%s" method is deprecated since 0.12 and will be removed in 0.13. You should use "%s::getArrayCopy" instead.',
40 1
                __METHOD__,
41 1
                __CLASS__
42
            ),
43 1
            \E_USER_DEPRECATED
44
        );
45
46 1
        return $this->getArrayCopy();
47
    }
48
49 50
    public function offsetExists($offset)
50
    {
51 50
        return \array_key_exists($offset, $this->rawArguments);
52
    }
53
54 48
    public function offsetGet($offset)
55
    {
56 48
        return $this->offsetExists($offset) ? $this->rawArguments[$offset] : null;
57
    }
58
59 1
    public function offsetSet($offset, $value): void
60
    {
61 1
        $this->rawArguments[$offset] = $value;
62 1
    }
63
64 1
    public function offsetUnset($offset): void
65
    {
66 1
        unset($this->rawArguments[$offset]);
67 1
    }
68
69 1
    public function count()
70
    {
71 1
        return \count($this->rawArguments);
72
    }
73
}
74