Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify the EventDispatcher #348

Merged
merged 3 commits into from May 12, 2018

Conversation

BackEndTea
Copy link
Member

This PR:

  • Removes dead code from the EventDispatcher

Most of its public functions were not being used within the code base(anymore).
Removed the unused functions, the now useless interface,and updated tests to show this behaviour.

Most of its public functions were not being used within the code base
(anymore). Removed the unused functions, the now useless interface,
and updated tests to show this new behaviour.
And update tests to mock the inferface, and mark the normall class as
final.
{
if (!$this->hasListeners($eventName)) {
if (!isset($this->listeners[$eventName])) {
Copy link
Member

Choose a reason for hiding this comment

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

can be simplified as well:
return $this->listeners[$eventName] ?? [];

*/
public function getListeners($eventName)
private function getListeners($eventName)
Copy link
Member

Choose a reason for hiding this comment

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

seems like we can add string type hinting here

@maks-rafalko maks-rafalko added this to the 0.9.0 milestone May 12, 2018
@maks-rafalko
Copy link
Member

Thank you @BackEndTea

@maks-rafalko maks-rafalko merged commit 9f405ad into infection:master May 12, 2018
@BackEndTea
Copy link
Member Author

Thank you @borNfreee @sidz

@BackEndTea BackEndTea deleted the update/event-dispatcher branch May 12, 2018 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants