Passed
Pull Request — master (#300)
by Alexander
06:13 queued 03:06
created

BeforeValidationTrait::skipOnEmptyCallback()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 4
c 0
b 0
f 0
dl 0
loc 7
ccs 5
cts 5
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Validator\Rule\Trait;
6
7
use Closure;
8
use Yiisoft\Validator\ValidationContext;
9
10
trait BeforeValidationTrait
11
{
12 93
    public function shouldSkipOnError(): bool
13
    {
14 93
        return $this->skipOnError;
15
    }
16
17
    /**
18
     * @psalm-return Closure(mixed, ValidationContext):bool|null
19
     *
20
     * @return Closure|null
21
     */
22 92
    public function getWhen(): ?Closure
23
    {
24 92
        return $this->when;
25
    }
26
}
27