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:11
created

Call   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 25%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 35
ccs 2
cts 8
cp 0.25
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A validate() 0 7 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
use Respect\Validation\Result;
16
17
/**
18
 * Executes a callable for the input and then validates its return.
19
 *
20
 * @author Alexandre Gomes Gaigalas <[email protected]>
21
 * @author Henrique Moody <[email protected]>
22
 *
23
 * @since 0.3.9
24
 */
25
final class Call implements Rule
26
{
27
    /**
28
     * @var callable
29
     */
30
    private $callable;
31
32
    /**
33
     * @var Rule
34
     */
35
    private $rule;
36
37
    /**
38
     * Initializes the rule.
39
     *
40
     * @param callable $callable
41
     * @param Rule     $rule
42
     */
43
    public function __construct(callable $callable, Rule $rule)
44
    {
45
        $this->callable = $callable;
46
        $this->rule = $rule;
47
    }
48
49
    /**
50
     * {@inheritdoc}
51
     */
52 6
    public function validate($input): Result
53
    {
54 6
        $return = call_user_func($callable, $input);
0 ignored issues
show
Bug introduced by
The variable $callable does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
55
        $returnResult = $this->rule->validate($return);
56
57
        return new Result($referenceValueResult->isValid(), $input, $this, [], $returnResult);
0 ignored issues
show
Bug introduced by
The variable $referenceValueResult does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
58
    }
59
}
60