Passed
Pull Request — master (#331)
by Sergei
02:46
created

SkipOnErrorTrait::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
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 1
b 0
f 0
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
trait SkipOnErrorTrait
8
{
9 1
    public function skipOnError(bool $value): static
10
    {
11 1
        $new = clone $this;
12 1
        $new->skipOnError = $value;
0 ignored issues
show
Bug Best Practice introduced by
The property skipOnError does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
13 1
        return $new;
14
    }
15
16 117
    public function shouldSkipOnError(): bool
17
    {
18 117
        return $this->skipOnError;
19
    }
20
}
21