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

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 6
ccs 4
cts 4
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
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