CheckWrapper::isInterrupting()   A
last analyzed

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 Smoren\Validator\Structs;
6
7
use Smoren\Validator\Interfaces\CheckInterface;
8
use Smoren\Validator\Interfaces\CheckWrapperInterface;
9
10
final class CheckWrapper implements CheckWrapperInterface
11
{
12
    /**
13
     * @var CheckInterface
14
     */
15
    protected CheckInterface $check;
16
    /**
17
     * @var bool
18
     */
19
    protected bool $isInterrupting;
20
21
    /**
22
     * @param CheckInterface $check
23
     * @param bool $isInterrupting
24
     */
25 304
    public function __construct(CheckInterface $check, bool $isInterrupting)
26
    {
27 304
        $this->check = $check;
28 304
        $this->isInterrupting = $isInterrupting;
29
    }
30
31
    /**
32
     * {@inheritDoc}
33
     */
34 295
    public function getCheck(): CheckInterface
35
    {
36 295
        return $this->check;
37
    }
38
39
    /**
40
     * {@inheritDoc}
41
     */
42 164
    public function isInterrupting(): bool
43
    {
44 164
        return $this->isInterrupting;
45
    }
46
47
    /**
48
     * {@inheritDoc}
49
     */
50 6
    public function setInterrupting(bool $value = true): void
51
    {
52 6
        $this->isInterrupting = $value;
53
    }
54
}
55