1 | <?php |
||
7 | class ProvidesEventsForm extends Form |
||
8 | { |
||
9 | /** |
||
10 | * @var EventManagerInterface |
||
11 | */ |
||
12 | protected $events; |
||
13 | /** |
||
14 | * Set the event manager instance used by this context |
||
15 | * |
||
16 | * @param EventManagerInterface $events |
||
17 | * @return mixed |
||
18 | */ |
||
19 | public function setEventManager(EventManagerInterface $events) |
||
24 | /** |
||
25 | * Retrieve the event manager |
||
26 | * |
||
27 | * Lazy-loads an EventManager instance if none registered. |
||
28 | * |
||
29 | * @return EventManagerInterface |
||
30 | */ |
||
31 | public function getEventManager() |
||
50 | } |
||
51 |
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: