Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Fix the module initializer #65

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ public function getConfig()
/**
* Register a specification for the ValidatorManager with the ServiceListener.
*
* @param \Zend\ModuleManager\ModuleEvent
* @param \Zend\ModuleManager\ModuleManager $moduleManager
* @return void
*/
public function init($event)
public function init($moduleManager)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to typehint the parameter?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potentially. We've typically not done it, in order to prevent the inevitable "zend-modulemanager should be listed as a package requirement" issues. For some reason, not using a typehint doesn't trigger those remarks, even though the code ends up working exactly the same.

{
$event = $moduleManager->getEvent();
$container = $event->getParam('ServiceManager');
$serviceListener = $container->get('ServiceListener');

Expand Down