DevinVinson / WordPress-Plugin-Boilerplate

[WordPress] A foundation for WordPress Plugin Development that aims to provide a clear and consistent guide for building your plugins.
http://wppb.io
7.66k stars 2.25k forks source link

Why not using singleton pattern? #578

Open essentique opened 2 years ago

essentique commented 2 years ago

I just picked up the code to use it for my plugin. I have this urge to turn some of the core classes to singletons. Before doing so, was wondering why it's not like that already.

Any specific reason?

DevinVinson commented 2 years ago

You totally could @essentique . It can cause some hurdles when building out tests but it has been a while since I've been in the weeds to get into the specifics. Give it a try and go from there.