Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@hjanuschka
Copy link
Contributor

Q A
Branch? master
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #35259
License MIT

returns 0 instead of null as it is typ hinted on other places anyway, and leads to exceptions sometimes.

@ro0NL
Copy link
Contributor

ro0NL commented Jan 8, 2020

* @return int|null The event listener priority
*/
public function getListenerPriority(string $eventName, $listener);

should we update the contract then? Or just the wrongful calling sides?

@hjanuschka
Copy link
Contributor Author

@ro0NL thx, good point, pushed changes

@nicolas-grekas
Copy link
Member

This looks suspicious to me. It looks like a BC break.

@nicolas-grekas nicolas-grekas added this to the next milestone Jan 8, 2020
{
if (empty($this->listeners[$eventName])) {
return null;
return 0;
Copy link
Member

Choose a reason for hiding this comment

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

This looks wrong to me. The interface states this:

Returns null if the event or the listener does not exist.

Making this change here violates the contract defined by the interface.

}

return null;
return 0;
Copy link
Member

Choose a reason for hiding this comment

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

same above

* @param callable $listener The listener
*
* @return int|null The event listener priority
* @return int The event listener priority, defaults to 0
Copy link
Member

Choose a reason for hiding this comment

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

changing this is a BC break

@lyrixx lyrixx changed the title fix empty prio [EventDispatcher] fix empty prio Jan 9, 2020
@hjanuschka hjanuschka closed this Jan 9, 2020
@nicolas-grekas nicolas-grekas modified the milestones: next, 5.1 May 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EventListener Broken with 5.0.x

5 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.