Test Failed
Pull Request — master (#244)
by Dmitriy
02:50
created

BeforeValidationTrait::shouldSkipOnError()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
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 41
    public function shouldSkipOnEmpty(): bool
13
    {
14 41
        return $this->skipOnEmpty;
15
    }
16
17 38
    public function shouldSkipOnError(): bool
18
    {
19 38
        return $this->skipOnError;
20
    }
21
22
    /**
23
     * @psalm-return Closure(mixed, ValidationContext):bool|null
24
     *
25
     * @return Closure|null
26
     */
27 37
    public function getWhen(): ?Closure
28
    {
29 37
        return $this->when;
30
    }
31
}
32