Total Complexity | 3 |
Total Lines | 33 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | class Context implements ContextInterface |
||
12 | { |
||
13 | /** @var StrategyInterface */ |
||
14 | private StrategyInterface $strategy; |
||
15 | |||
16 | /** |
||
17 | * Context constructor. |
||
18 | * |
||
19 | * @param StrategyInterface $strategy |
||
20 | */ |
||
21 | public function __construct(StrategyInterface $strategy) |
||
24 | } |
||
25 | |||
26 | /** |
||
27 | * @param StrategyInterface $strategy |
||
28 | * @return ContextInterface |
||
29 | */ |
||
30 | public function changeStrategy(StrategyInterface $strategy): ContextInterface |
||
31 | { |
||
32 | $this->strategy = $strategy; |
||
33 | |||
34 | return $this; |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * @param TermsInterface $val |
||
39 | * @return int|float |
||
40 | */ |
||
41 | public function execute(TermsInterface $val): int|float |
||
44 | } |
||
45 | } |
||
46 |