| Total Complexity | 5 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 11 | trait HasStrategy |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var null|AbstractStrategy |
||
| 15 | */ |
||
| 16 | protected $strategy = null; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @return AbstractStrategy|null |
||
| 20 | */ |
||
| 21 | public function getStrategy(): ?AbstractStrategy |
||
| 22 | { |
||
| 23 | return $this->strategy; |
||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @param AbstractStrategy|string $strategy |
||
| 28 | * @return self |
||
| 29 | */ |
||
| 30 | public function setStrategy($strategy): self |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @param string $class |
||
| 41 | * @return AbstractStrategy |
||
| 42 | */ |
||
| 43 | protected function newStrategy($class): AbstractStrategy |
||
| 51 |