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.
Passed
Push — master ( 18f918...aa8b7f )
by Marco
01:25
created

ComposingAssertion   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 17
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A withFormatter() 0 3 1
A validate() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Marcosh\PhpValidationDSL\Basic;
6
7
use Marcosh\PhpValidationDSL\Result\ValidationResult;
8
9
abstract class ComposingAssertion
10
{
11
    /**
12
     * @var IsAsAsserted
13
     */
14
    protected $isAsAsserted;
15
16
    abstract public function __construct(?callable $errorFormatter = null);
17
18
    public static function withFormatter(callable $errorFormatter): self
19
    {
20
        return new static($errorFormatter);
21
    }
22
23
    public function validate($data, array $context = []): ValidationResult
24
    {
25
        return $this->isAsAsserted->validate($data, $context);
26
    }
27
}
28