OrSpecification::isSatisfiedBy()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 2
CRAP Score 2

Importance

Changes 0
Metric Value
dl 4
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 2
eloc 2
nc 2
nop 1
crap 2
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