1 | <?php |
||
8 | class WampEvent extends ConnectionEvent |
||
9 | { |
||
10 | /** |
||
11 | * @param ConnectionInterface $conn |
||
12 | * @param string|Topic $topic The topic the user has attempted to publish to |
||
13 | */ |
||
14 | public function __construct(ConnectionInterface $conn, $topic) |
||
20 | |||
21 | /** |
||
22 | * @return string|Topic |
||
23 | */ |
||
24 | public function getTopic() |
||
28 | } |
||
29 |
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: