1 | <?php |
||
15 | class Dispatcher implements DomainEventDispatcher |
||
16 | { |
||
17 | /** |
||
18 | * @var EventDispatcherInterface |
||
19 | */ |
||
20 | private $dispatcher; |
||
21 | |||
22 | /** |
||
23 | * @param EventDispatcherInterface $dispatcher |
||
24 | */ |
||
25 | 3 | public function __construct(EventDispatcherInterface $dispatcher) |
|
29 | |||
30 | /** |
||
31 | * {@inheritdoc} |
||
32 | */ |
||
33 | 1 | public function dispatch(EventProvider $provider) |
|
42 | |||
43 | 1 | private function resolveEventName(EventProvider $provider, DomainEvent $event) |
|
51 | |||
52 | 1 | private function getClassname($object) |
|
59 | } |
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: