Code Duplication    Length = 56-57 lines in 2 locations

src/Blocks/AndBlock.php 1 location

@@ 27-83 (lines=57) @@
24
/**
25
 * @package Limoncello\Validation
26
 */
27
final class AndBlock implements AndExpressionInterface
28
{
29
    /**
30
     * @var ExecutionBlockInterface
31
     */
32
    private $primary;
33
34
    /**
35
     * @var ExecutionBlockInterface
36
     */
37
    private $secondary;
38
39
    /**
40
     * @var array
41
     */
42
    private $properties;
43
44
45
    /**
46
     * @param ExecutionBlockInterface $primary
47
     * @param ExecutionBlockInterface $secondary
48
     * @param array                   $properties
49
     */
50
    public function __construct(
51
        ExecutionBlockInterface $primary,
52
        ExecutionBlockInterface $secondary,
53
        array $properties = []
54
    ) {
55
        $this->primary    = $primary;
56
        $this->secondary  = $secondary;
57
        $this->properties = $properties;
58
    }
59
60
    /**
61
     * @inheritdoc
62
     */
63
    public function getPrimary(): ExecutionBlockInterface
64
    {
65
        return $this->primary;
66
    }
67
68
    /**
69
     * @inheritdoc
70
     */
71
    public function getSecondary(): ExecutionBlockInterface
72
    {
73
        return $this->secondary;
74
    }
75
76
    /**
77
     * @inheritdoc
78
     */
79
    public function getProperties(): array
80
    {
81
        return $this->properties;
82
    }
83
}
84

src/Blocks/OrBlock.php 1 location

@@ 27-82 (lines=56) @@
24
/**
25
 * @package Limoncello\Validation
26
 */
27
final class OrBlock implements OrExpressionInterface
28
{
29
    /**
30
     * @var ExecutionBlockInterface
31
     */
32
    private $primary;
33
34
    /**
35
     * @var ExecutionBlockInterface
36
     */
37
    private $secondary;
38
39
    /**
40
     * @var array
41
     */
42
    private $properties;
43
44
    /**
45
     * @param ExecutionBlockInterface $primary
46
     * @param ExecutionBlockInterface $secondary
47
     * @param array                   $properties
48
     */
49
    public function __construct(
50
        ExecutionBlockInterface $primary,
51
        ExecutionBlockInterface $secondary,
52
        array $properties = []
53
    ) {
54
        $this->primary    = $primary;
55
        $this->secondary  = $secondary;
56
        $this->properties = $properties;
57
    }
58
59
    /**
60
     * @inheritdoc
61
     */
62
    public function getPrimary(): ExecutionBlockInterface
63
    {
64
        return $this->primary;
65
    }
66
67
    /**
68
     * @inheritdoc
69
     */
70
    public function getSecondary(): ExecutionBlockInterface
71
    {
72
        return $this->secondary;
73
    }
74
75
    /**
76
     * @inheritdoc
77
     */
78
    public function getProperties(): array
79
    {
80
        return $this->properties;
81
    }
82
}
83