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