| Total Complexity | 5 |
| Total Lines | 53 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 11 | abstract class AbstractStage implements StageInterface |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var Command |
||
| 15 | */ |
||
| 16 | protected $command; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @param Command $methodCall |
||
| 20 | * @return Command |
||
| 21 | */ |
||
| 22 | 5 | public function __invoke(Command $command): Command |
|
| 23 | { |
||
| 24 | 5 | $this->setCommand($command); |
|
| 25 | 5 | $this->processCommand(); |
|
| 26 | 5 | return $command; |
|
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @return void |
||
| 31 | */ |
||
| 32 | abstract public function processCommand(); |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @return Command |
||
| 36 | */ |
||
| 37 | 5 | public function getCommand(): Command |
|
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @param Command $command |
||
| 44 | */ |
||
| 45 | 5 | public function setCommand(Command $command) |
|
| 46 | { |
||
| 47 | 5 | $this->command = $command; |
|
| 48 | 5 | } |
|
| 49 | |||
| 50 | /** |
||
| 51 | * @return bool |
||
| 52 | */ |
||
| 53 | 3 | protected function hasClassAction() |
|
| 54 | { |
||
| 55 | 3 | return $this->getCommand()->hasActionParam('class'); |
|
| 56 | } |
||
| 57 | |||
| 58 | /** |
||
| 59 | * @return bool |
||
| 60 | */ |
||
| 61 | 4 | protected function hasInstanceAction() |
|
| 64 | } |
||
| 65 | } |
||
| 66 |