1 | <?php |
||
13 | class BlockLocatorSerializer |
||
14 | { |
||
15 | |||
16 | /** |
||
17 | * @var Template |
||
18 | */ |
||
19 | private $template; |
||
20 | |||
21 | 2 | public function __construct() |
|
32 | |||
33 | /** |
||
34 | * @param Parser $parser |
||
35 | * @return BlockLocator |
||
36 | */ |
||
37 | 2 | public function fromParser(Parser $parser) |
|
49 | |||
50 | /** |
||
51 | * @param BufferInterface|string $data |
||
52 | * @return BlockLocator |
||
53 | */ |
||
54 | 2 | public function parse($data) |
|
58 | |||
59 | /** |
||
60 | * @param BlockLocator $blockLocator |
||
61 | * @return \BitWasp\Buffertools\BufferInterface |
||
62 | */ |
||
63 | 2 | public function serialize(BlockLocator $blockLocator) |
|
73 | } |
||
74 |
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: