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
04:17 queued 52s
created

Call   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 57.14%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 30
ccs 4
cts 7
cp 0.5714
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getReferenceValue() 0 4 1
A hasReference() 0 4 1
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