| Conditions | 2 |
| Paths | 3 |
| Total Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | protected function initializeChannelArgument(InputInterface $input): void |
||
| 34 | { |
||
| 35 | try { |
||
| 36 | $channel = (string) $input->getArgument('channel'); |
||
| 37 | $this->centrifugoChecker->assertValidChannelName($channel); |
||
|
|
|||
| 38 | $this->channel = $channel; |
||
| 39 | } catch (\Exception $e) { |
||
| 40 | throw new InvalidArgumentException($e->getMessage()); |
||
| 41 | } |
||
| 42 | } |
||
| 43 | } |
||
| 44 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: