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

BeforeValidationTrait::initSkipOnEmptyProperties()   A

Complexity

Conditions 4
Paths 4

Size

Total Lines 16
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 4.0218

Importance

Changes 0
Metric Value
eloc 8
c 0
b 0
f 0
dl 0
loc 16
ccs 8
cts 9
cp 0.8889
rs 10
cc 4
nc 4
nop 2
crap 4.0218
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