UnarySpecification::conditionIsSatisfiedBy()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Stratadox\Specification\Unary;
6
7
use Stratadox\Specification\Specifying;
8
use Stratadox\Specification\Contract\Satisfiable;
9
use Stratadox\Specification\Contract\Specifies;
10
11
abstract class UnarySpecification implements Specifies
12
{
13
    use Specifying;
14
15
    private $condition;
16
17
    public function __construct(Satisfiable $condition)
18
    {
19
        $this->condition = $condition;
20
    }
21
22
    protected function conditionIsSatisfiedBy($object) : bool
23
    {
24
        return $this->condition->isSatisfiedBy($object);
25
    }
26
27
    public function condition() : Satisfiable
28
    {
29
        return $this->condition;
30
    }
31
}
32