GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Errors::validate()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 2
dl 0
loc 13
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Marcosh\PhpValidationDSL\Basic;
6
7
use Marcosh\PhpValidationDSL\Result\ValidationResult;
8
use Marcosh\PhpValidationDSL\Validation;
9
10
final class Errors extends ComposingAssertion implements Validation
11
{
12
    public const MESSAGE = 'errors.invalid-data';
13
14
    /**
15
     * @template T
16
     * @psalm-param T $data
17
     * @param mixed $data
18
     * @param array $context
19
     * @return ValidationResult
20
     */
21
    public function validate($data, array $context = []): ValidationResult
22
    {
23
        $alwaysFalse =
24
            /**
25
             * @param mixed $data
26
             * @psalm-param T $data
27
             * @return false
28
             */
29
            function ($data): bool {
0 ignored issues
show
Unused Code introduced by
The parameter $data is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

29
            function (/** @scrutinizer ignore-unused */ $data): bool {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
30
                return false;
31
            };
32
33
        return $this->validateAssertion($alwaysFalse, $data, $context);
34
    }
35
}
36