Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
59 | 1 | public function close(): void |
|
60 | { |
||
61 | 1 | if ($this->closed()) { |
|
62 | 1 | return; |
|
63 | } |
||
64 | |||
65 | $this |
||
66 | 1 | ->connection |
|
67 | 1 | ->send($this->connection->protocol()->channel()->close( |
|
68 | 1 | $this->number, |
|
69 | 1 | new Close |
|
70 | )) |
||
71 | 1 | ->wait('channel.close-ok'); |
|
72 | 1 | $this->closed = true; |
|
73 | 1 | } |
|
74 | } |
||
75 |
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: