OrSpecification::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 5
Ratio 100 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 5
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php
2
3
namespace Tanigami\Specification;
4
5 View Code Duplication
class OrSpecification extends Specification
6
{
7
    /**
8
     * @var Specification
9
     */
10
    private $one;
11
12
    /**
13
     * @var Specification
14
     */
15
    private $other;
16
17
    /**
18
     * @param Specification $one
19
     * @param Specification $other
20
     */
21 1
    public function __construct(Specification $one, Specification $other)
22
    {
23 1
        $this->one   = $one;
24 1
        $this->other = $other;
25 1
    }
26
27
    /**
28
     * {@inheritdoc}
29
     */
30 1
    public function isSatisfiedBy($object): bool
31
    {
32 1
        return $this->one->isSatisfiedBy($object) || $this->other->isSatisfiedBy($object);
33
    }
34
}
35