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

renamegetListHooksRegistered to registerEvents (keep BC) #8565

Closed
mattab opened this issue Aug 13, 2015 · 3 comments
Closed

renamegetListHooksRegistered to registerEvents (keep BC) #8565

mattab opened this issue Aug 13, 2015 · 3 comments
Assignees
Labels
c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement.
Milestone

Comments

@mattab
Copy link
Member

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)

@mattab mattab added Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement. c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. labels Aug 13, 2015
@mattab mattab added this to the 3.0.0 milestone Aug 13, 2015
@mnapoli
Copy link
Contributor

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. http://laravel.com/docs/5.1/routing).

tsteur added a commit that referenced this issue Sep 9, 2015
@tsteur
Copy link
Member

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
@mattab
Copy link
Member Author

mattab commented Oct 30, 2016

Function was renamed to registerEvents in Piwik 3

@mattab mattab closed this as completed Oct 30, 2016
@mattab mattab changed the title renamegetListHooksRegistered to getListEventsRegistered (keep BC) renamegetListHooksRegistered 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
Labels
c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement.
Projects
None yet
Development

No branches or pull requests

3 participants