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

IsGreaterThan   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A validate() 0 12 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Marcosh\PhpValidationDSL\Basic;
6
7
use Marcosh\PhpValidationDSL\Basic\IsAsAsserted;
8
use Marcosh\PhpValidationDSL\Result\ValidationResult;
9
use Marcosh\PhpValidationDSL\Translator\Translator;
10
use Marcosh\PhpValidationDSL\Validation;
11
12
final class IsGreaterThan extends Compare implements Validation
13
{
14
    public const MESSAGE = 'is-greater-than.not-greater-than';
15
16
    /**
17
     * @template T
18
     * @psalm-param T $data
19
     * @param mixed $data
20
     * @param array $context
21
     * @return ValidationResult
22
     */
23
    public function validate($data, array $context = []): ValidationResult
24
    {
25
        return $this->validateAssertion(
26
            /**
27
             * @psalm-param T $bound
28
             * @psalm-param T $data
29
             */
30
            function ($bound, $data): bool {
31
                return $data > $bound;
32
            },
33
            $data,
34
            $context
35
        );
36
    }
37
}
38