Passed
Push — main ( 6afe0c...47aea4 )
by Breno
01:54
created

Stop   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 14
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setStopOnFailure() 0 5 1
A stopOnFailure() 0 3 1
1
<?php
2
declare(strict_types=1);
3
4
namespace BrenoRoosevelt\Validation;
5
6
trait Stop
7
{
8
    protected int $stopOnFailure = StopSign::DONT_STOP;
9
10
    public function setStopOnFailure(int $stopSign): static
11
    {
12
        $instance = clone $this;
13
        $instance->stopOnFailure = $stopSign;
14
        return $instance;
15
    }
16
17
    public function stopOnFailure(): int
18
    {
19
        return $this->stopOnFailure;
20
    }
21
}
22