Passed
Push — main ( 52de70...4bac34 )
by Breno
02:11
created

ValidateOrFail   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 14
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A validateOrFail() 0 6 1
1
<?php
2
declare(strict_types=1);
3
4
namespace BrenoRoosevelt\Validation\Exception;
5
6
trait ValidateOrFail
7
{
8
    use Guard;
9
10
    /**
11
     * @throws ValidationExceptionInterface
12
     * @throws ValidationException
13
     */
14
    public function validateOrFail(
15
        mixed $input,
16
        array $context = [],
17
        ?ValidationExceptionInterface $validationException = null
18
    ): void {
19
        $this->guardRule($this, $input, $context, $validationException);
0 ignored issues
show
Bug introduced by
$this of type BrenoRoosevelt\Validation\Exception\ValidateOrFail is incompatible with the type BrenoRoosevelt\Validation\Rule expected by parameter $rule of BrenoRoosevelt\Validatio...dateOrFail::guardRule(). ( Ignorable by Annotation )

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

19
        $this->guardRule(/** @scrutinizer ignore-type */ $this, $input, $context, $validationException);
Loading history...
20
    }
21
}
22