1 | <?php |
||
13 | class AutoAdder |
||
14 | { |
||
15 | /** |
||
16 | * @var DataCollectorTranslator |
||
17 | */ |
||
18 | private $translator; |
||
19 | |||
20 | /** |
||
21 | * @var TranslationServiceInterface transService |
||
22 | */ |
||
23 | private $transService; |
||
24 | |||
25 | /** |
||
26 | * @param DataCollectorTranslator $translator |
||
27 | * @param TranslationServiceInterface $transService |
||
28 | * @param FilesystemUpdater $fileSystemUpdater |
||
29 | */ |
||
30 | public function __construct(DataCollectorTranslator $translator, TranslationServiceInterface $transService, FilesystemUpdater $fileSystemUpdater) |
||
36 | |||
37 | public function onTerminate(Event $event) |
||
58 | } |
||
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: