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.
Completed
Push — master ( dc9597...e55f0d )
by Marco
03:36
created

IsLessThan::validate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 2
dl 0
loc 12
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\Translator\Translator;
9
use Marcosh\PhpValidationDSL\Validation;
10
11
final class IsLessThan extends Compare implements Validation
12
{
13
    public const MESSAGE = 'is-less-than.not-less-than';
14
15
    /**
16
     * @template T
17
     * @psalm-param T $data
18
     * @param mixed $data
19
     * @param array $context
20
     * @return ValidationResult
21
     */
22
    public function validate($data, array $context = []): ValidationResult
23
    {
24
        return $this->validateAssertion(
25
            /**
26
             * @psalm-param T $bound
27
             * @psalm-param T $data
28
             */
29
            function ($bound, $data): bool {
30
                return $data < $bound;
31
            },
32
            $data,
33
            $context
34
        );
35
    }
36
}
37