| Total Complexity | 4 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Changes | 6 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | class Lamp implements DeviceInterface |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * Command registry |
||
| 16 | * ---------------- |
||
| 17 | * Реестр команд |
||
| 18 | * |
||
| 19 | * @var array |
||
| 20 | */ |
||
| 21 | private array $commands = []; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Executes a specific command from the registry |
||
| 25 | * --------------------------------------------- |
||
| 26 | * Исполняет определенную команду из реестра |
||
| 27 | * |
||
| 28 | * @param string $commandName |
||
| 29 | * @return void |
||
| 30 | */ |
||
| 31 | public function execute(string $commandName): void |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Adds a command to the registry |
||
| 42 | * ------------------------------ |
||
| 43 | * Добавляет команду в реестр |
||
| 44 | * |
||
| 45 | * @param string $commandName |
||
| 46 | * @param CommandInterface $command |
||
| 47 | */ |
||
| 48 | public function setCommand(string $commandName, CommandInterface $command): void |
||
| 57 |