|
8 | 8 |
|
9 | 9 | class CommandDecorator extends COMMAND |
10 | 10 | { |
11 | | - private $originalCommand; |
| 11 | + private CommandInterface $originalCommand; |
12 | 12 |
|
13 | 13 | public function __construct(CommandInterface $command) |
14 | 14 | { |
15 | 15 | $this->originalCommand = $command; |
16 | 16 | } |
17 | 17 |
|
18 | 18 | /** |
| 19 | + * Yii components expect response without changes |
19 | 20 | * @inheritdoc |
20 | 21 | */ |
21 | 22 | public function parseResponse($data) |
22 | 23 | { |
23 | 24 | return $data; |
24 | 25 | } |
25 | 26 |
|
26 | | - public function __call($method, $args) |
27 | | - { |
28 | | - return call_user_func_array([$this->originalCommand, $method], $args); |
29 | | - } |
| 27 | + // Calling methods of the original class |
| 28 | + |
| 29 | + public function __call($method, $args): mixed { return call_user_func_array([$this->originalCommand, $method], $args); } |
30 | 30 |
|
31 | 31 | public function getId():string { return $this->originalCommand->getId(); } |
32 | | - public function setArguments(array $arguments):void { $this->originalCommand->setArguments($arguments); } |
33 | | - public function getArguments():array { return $this->originalCommand->getArguments(); } |
| 32 | + |
| 33 | + public function setArguments(array $arguments): void { $this->originalCommand->setArguments($arguments); } |
| 34 | + |
| 35 | + public function getArguments(): array { return $this->originalCommand->getArguments(); } |
| 36 | + |
| 37 | + public function setSlot($slot): void { $this->originalCommand->setSlot($slot); } |
| 38 | + |
| 39 | + public function getSlot(): ?int { return $this->originalCommand->getSlot(); } |
| 40 | + |
| 41 | + public function setRawArguments(array $arguments): void { $this->originalCommand->setRawArguments($arguments); } |
| 42 | + |
| 43 | + public function getArgument($index): mixed { return $this->originalCommand->getArgument($index); } |
| 44 | + |
| 45 | + public function parseResp3Response($data): mixed { return $this->originalCommand->parseResp3Response($data); } |
| 46 | + |
| 47 | + public function serializeCommand(): string { return $this->originalCommand->serializeCommand(); } |
34 | 48 | } |
0 commit comments