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

rename`getListHooksRegistered` to `registerEvents` (keep BC) #8565

mattab opened this Issue Aug 13, 2015 · 3 comments


None yet
3 participants
Copy link

mattab commented Aug 13, 2015

renamegetListHooksRegistered to getListEventsRegistered in a backwards compatible way. Maybe there could be even a better name for this method?

(extracted from #7241)


This comment has been minimized.

Copy link

mnapoli commented Aug 13, 2015

How about registerEvents()? The current name takes a long time to read and understand. I would even suggest a simpler naming scheme in the Plugin class since it's targeting plugin developers and we want the simplest API possible for them: events(). That way, there's no question or surprise on what this method is for. Laravel is a good example for that (e.g.

tsteur added a commit that referenced this issue Sep 9, 2015


This comment has been minimized.

Copy link

tsteur commented Sep 9, 2015

I'll go with registerEvents() for now but will leave issue open to maybe rename it again for 3.0. There could be also methods to actually register an event eg

public function registerEvents()
     $this->registerEvent('CoreFoo.Bar', $this, 'myMethod', $after = true);

It could be maybe also done in __construct but this would make it slow when creating an instance of plugin and events are not needed. This way we would get rid of the array thing and make it more intuitive etc. Also one could maybe actually register events in another method if somehow needed or so (maybe it would be possible not sure)

tsteur added a commit to matomo-org/developer-documentation that referenced this issue Sep 9, 2015

@mattab mattab modified the milestones: 3.0.0-b2, 3.0.0 Oct 1, 2015


This comment has been minimized.

Copy link
Member Author

mattab commented Oct 30, 2016

Function was renamed to registerEvents in Piwik 3

@mattab mattab closed this Oct 30, 2016

@mattab mattab changed the title rename`getListHooksRegistered` to `getListEventsRegistered` (keep BC) rename`getListHooksRegistered` to `registerEvents` (keep BC) Oct 31, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.