Thanks to visit codestin.com
Credit goes to github.com

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

Bug in Zend\ModuleManager\Listener\LocatorRegistrationListener#2350

Closed
bedeabza wants to merge 4 commits into
zendframework:masterfrom
bedeabza:bug-locator-registration-listener
Closed

Bug in Zend\ModuleManager\Listener\LocatorRegistrationListener#2350
bedeabza wants to merge 4 commits into
zendframework:masterfrom
bedeabza:bug-locator-registration-listener

Conversation

@bedeabza
Copy link
Copy Markdown
Contributor

The shared event manager can be false sometimes and at lines 70 and 85 this wasn't checked so I caught some errors while running tests for a new module.

I'm not even sure if this is due to errors in my configuration, but considering that the shared event manager is not always returned we should check for it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This can be simply:

if ($events) {

getSharedManager() can return either null, false, or a SharedEventManagerInterface instance.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

And, actually, I'd change this entirely to:

if (!$events) {
    return;
}

and then continue on with the event registration. Nothing else in this method is necessary if we don't have the shared event manager instance.

weierophinney added a commit that referenced this pull request Sep 14, 2012
- Use MvcEvent::EVENT_BOOTSTRAP instead of 'bootstrap'
- Whitespace around conditional statements
@weierophinney
Copy link
Copy Markdown
Member

There was something wrong with the commit history due to the presence of a merge in the branch, and I ended up cherry-picking the commit.

Merged to master and release branches.

@bedeabza
Copy link
Copy Markdown
Contributor Author

Sorry about that, I had already pushed the changes when I realized there was something wrong and merged back the origin.

weierophinney pushed a commit to zendframework/zend-modulemanager that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-modulemanager that referenced this pull request May 15, 2015
- Use MvcEvent::EVENT_BOOTSTRAP instead of 'bootstrap'
- Whitespace around conditional statements
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants