| Conditions | 3 |
| Paths | 5 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | protected function initializeChannelArgument(InputInterface $input): void |
||
| 34 | { |
||
| 35 | try { |
||
| 36 | $channel = $input->getArgument('channel'); |
||
| 37 | |||
| 38 | if (!\is_string($channel)) { |
||
| 39 | throw new InvalidArgumentException('Argument "channel" is not a string.'); |
||
| 40 | } |
||
| 41 | |||
| 42 | $this->centrifugoChecker->assertValidChannelName($channel); |
||
|
|
|||
| 43 | $this->channel = $channel; |
||
| 44 | } catch (\Exception $e) { |
||
| 45 | throw new InvalidArgumentException($e->getMessage()); |
||
| 46 | } |
||
| 47 | } |
||
| 48 | } |
||
| 49 |
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: