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 — master (#678)
by Henrique
06:13 queued 02:59
created

Key::__construct()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 3

Importance

Changes 0
Metric Value
dl 0
loc 7
c 0
b 0
f 0
ccs 5
cts 5
cp 1
rs 9.4285
cc 3
eloc 4
nc 2
nop 3
crap 3
1
<?php
2
3
/*
4
 * This file is part of Respect/Validation.
5
 *
6
 * (c) Alexandre Gomes Gaigalas <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the "LICENSE.md"
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Respect\Validation\Rules;
13
14
/**
15
 * Validates an array key.
16
 *
17
 * @author Alexandre Gomes Gaigalas <[email protected]>
18
 * @author Henrique Moody <[email protected]>
19
 *
20
 * @since 0.3.9
21
 */
22
final class Key extends AbstractRelated
23
{
24
    /**
25
     * {@inheritdoc}
26
     */
27 8
    protected function getReferenceValue($input, $reference)
28
    {
29 8
        return $input[$reference];
30
    }
31
32
    /**
33
     * {@inheritdoc}
34
     */
35 32
    protected function hasReference($input, $reference): bool
36
    {
37 32
        if (is_array($input)) {
38 28
            return array_key_exists($reference, $input);
39
        }
40
41 4
        return isset($input[$reference]);
42
    }
43
}
44