matomo-org / matomo

Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
https://matomo.org/
GNU General Public License v3.0
19.89k stars 2.65k forks source link

Rename the Piwik\Plugin\Manager class #7656

Open mnapoli opened 9 years ago

mnapoli commented 9 years ago

Following #7644 the plugin manager will be stored in the DI container, which means we will be able to inject it by simply type-hinting it:

class MyService {
    public function __construct(Manager $pluginManager) {
        // ...
    }
}

Manager alone is confusing (the name doesn't mean anything) and can lead to conflicts. This is already a problem (we end up e.g. aliasing the class name in a lot of places) but I think it's a good time to take the opportunity to rename it as the problem will only get more visible when using dependency injection.

It could be renamed to Piwik\Plugin\PluginManager for example.

Of course backward compatibility would be kept and Piwik\Plugin\Manager still exist as an alias to the new class

Thoughts?

mattab commented 9 years ago

It could be renamed to Piwik\Plugin\PluginManager for example.

+1

mnapoli commented 9 years ago

After thinking about it I think it's best to do that for 3.0 as there will be less risks of conflicts with the DI refactorings and we probably won't have the same level of BC to keep.