1 | <?php |
||
11 | class HooksReader { |
||
12 | |||
13 | /** |
||
14 | * Construct a new HooksReader instance. |
||
15 | */ |
||
16 | private function __construct() { |
||
22 | |||
23 | /** |
||
24 | * Get the Annotation reader. |
||
25 | * |
||
26 | * @return AnnotationReader |
||
27 | */ |
||
28 | private function reader() { |
||
31 | |||
32 | /** |
||
33 | * Get the shared reader instance. |
||
34 | * |
||
35 | * @return HooksReader |
||
36 | */ |
||
37 | static private function instance() { |
||
46 | |||
47 | /** |
||
48 | * Shared implementation of hook reading logic. |
||
49 | * |
||
50 | * @param object $target Object to read annotations from. |
||
51 | * @param \Closure $condition Whether the annotation should be registered. |
||
52 | * @return array |
||
53 | */ |
||
54 | static public function read( $target, $condition ) { |
||
75 | } |
||
76 |
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: