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