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
03:50
created

Call::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 3
crap 2
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
use Respect\Validation\Rule;
15
16
/**
17
 * Executes a callable for the input and then validates its return.
18
 *
19
 * @author Alexandre Gomes Gaigalas <[email protected]>
20
 * @author Henrique Moody <[email protected]>
21
 *
22
 * @since 0.3.9
23
 */
24
final class Call extends AbstractRelated
25
{
26
    /**
27
     * Initializes the rule.
28
     *
29
     * @param callable $callable
30
     * @param Rule     $rule
31
     * @param bool     $mandatory
32
     */
33
    public function __construct(callable $callable, Rule $rule = null, bool $mandatory = true)
34
    {
35
        parent::__construct($callable, $rule, $mandatory);
36
    }
37
38
    /**
39
     * {@inheritdoc}
40
     */
41 6
    protected function getReferenceValue($input, $reference)
42
    {
43 6
        return call_user_func_array($reference, [&$input]);
44
    }
45
46
    /**
47
     * {@inheritdoc}
48
     */
49 6
    protected function hasReference($input, $reference): bool
50
    {
51 6
        return is_callable($reference);
52
    }
53
}
54