StrategyAwareTrait::setStrategy()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php declare(strict_types=1);
2
3
namespace League\Route\Strategy;
4
5
trait StrategyAwareTrait
6
{
7
    /**
8
     * @var StrategyInterface
9
     */
10
    protected $strategy;
11
12
    /**
13
     * {@inheritdoc}
14
     */
15 51
    public function setStrategy(StrategyInterface $strategy): StrategyAwareInterface
16
    {
17 51
        $this->strategy = $strategy;
18
19 51
        return $this;
20
    }
21
22
    /**
23
     * {@inheritdoc}
24
     */
25 54
    public function getStrategy(): ?StrategyInterface
26
    {
27 54
        return $this->strategy;
28
    }
29
}
30