AndSpecification   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 30
ccs 6
cts 6
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A isSatisfiedBy() 0 4 2
1
<?php
2
3
namespace RemiSan\Specification;
4
5
class AndSpecification extends AbstractSpecification implements Specification
6
{
7
    /** @var Specification */
8
    private $one;
9
10
    /** @var Specification */
11
    private $other;
12
13
    /**
14
     * Constructor.
15
     *
16
     * @param Specification $one
17
     * @param Specification $other
18
     */
19 18
    public function __construct(Specification $one, Specification $other)
20
    {
21 18
        $this->one = $one;
22 18
        $this->other = $other;
23 18
    }
24
25
    /**
26
     * @param $candidate
27
     *
28
     * @return bool
29
     */
30 12
    public function isSatisfiedBy($candidate)
31
    {
32 12
        return $this->one->isSatisfiedBy($candidate) && $this->other->isSatisfiedBy($candidate);
33
    }
34
}
35