You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The main problem is that you're trying to put multiple things into one class. A static facade is a separate responsibility and should go into a separate class. This way, static calls will properly work, and you can get rid of the getInstance() calls.
The text was updated successfully, but these errors were encountered:
Ah that makes sense. I had initially looked at your static facade library and assumed that it would easily enable calling methods statically without a real singleton, until I noticed that existing non static methods are preferred over __callStatic(). But yeah, having it inside the class wouldn't make sense anyway. Let's continue discussing a solid approach in #7.
My Static Facade is meant to create objects that fulfill that single role. It is not meant to extend existing, real objects. Always prefer composition over inheritance!
In the
ObjectCache
class, there's this comment:https://github.com/felixarntz/wp-psr-cache/blob/master/src/ObjectCache.php#L771
The main problem is that you're trying to put multiple things into one class. A static facade is a separate responsibility and should go into a separate class. This way, static calls will properly work, and you can get rid of the
getInstance()
calls.The text was updated successfully, but these errors were encountered: