1 | <?php |
||
3 | class FeatureSet { |
||
4 | private $properties = []; |
||
5 | private $pseudo = []; |
||
6 | |||
7 | public function __construct(Hook\DataFunction $data, Hook\Formatter $formatter, &$headers) { |
||
12 | |||
13 | public function getData() { |
||
16 | |||
17 | public function getFormatter() { |
||
20 | |||
21 | public function &getHeaders() { |
||
24 | |||
25 | public function registerFormatter($formatter) { |
||
28 | |||
29 | public function registerProperty($name, Property $property) { |
||
32 | |||
33 | public function registerPseudo(Pseudo $pseudo) { |
||
36 | |||
37 | public function loadProperties(Hook\PropertyHook $hook) { |
||
40 | |||
41 | public function createPseudoMatcher($pseudo) { |
||
46 | } |
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: