| 1 | <?php |
||
| 19 | class DoctrinePHPCRODMListenerContainerAware implements EventSubscriber |
||
| 20 | { |
||
| 21 | protected $listener; |
||
| 22 | |||
| 23 | protected $service; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @param ContainerInterface $container |
||
| 27 | * @param $service |
||
| 28 | */ |
||
| 29 | public function __construct(ContainerInterface $container, $service) |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @return array |
||
| 37 | */ |
||
| 38 | public function getSubscribedEvents() |
||
| 45 | |||
| 46 | /** |
||
| 47 | * @param $args |
||
| 48 | */ |
||
| 49 | public function preRemove(LifecycleEventArgs $args) |
||
| 55 | |||
| 56 | /** |
||
| 57 | * @param LifecycleEventArgs $args |
||
| 58 | */ |
||
| 59 | public function preUpdate(LifecycleEventArgs $args) |
||
| 65 | |||
| 66 | private function load() |
||
| 74 | } |
||
| 75 |
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: