@mattab opened this Issue on August 13th 2015 Owner

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

(extracted from #7241)

@mnapoli commented on August 13th 2015 Member

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 commented on September 9th 2015 Owner

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)

@mattab commented on October 30th 2016 Owner

Function was renamed to registerEvents in Piwik 3

This Issue was closed on October 30th 2016
Powered by GitHub Issue Mirror