CheckWrapper   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 43
ccs 9
cts 9
cp 1
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getCheck() 0 3 1
A isInterrupting() 0 3 1
A __construct() 0 4 1
A setInterrupting() 0 3 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