1 | <?php |
||
13 | class SolarXMLParser implements IParser |
||
14 | { |
||
15 | |||
16 | /* |
||
17 | * sets the XMLElement containing packet's data |
||
18 | * @parameter \SimpleXMLElement $xmlElement |
||
19 | */ |
||
20 | 3 | public function setXMLElement(\SimpleXMLElement $xmlElement) |
|
24 | |||
25 | /* |
||
26 | * returns the Solar implementation of IPacket |
||
27 | */ |
||
28 | 2 | public function parse() |
|
45 | |||
46 | } |
||
47 |
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: