-
Notifications
You must be signed in to change notification settings - Fork 427
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow for the class to be extended from a child class for a specific …
…implementation The way the class was set up, extending from a child class would mean overloading a truck load of methods to get round the hard coded class name and some more convoluted coding to overrule the instance and the auto-instantiation of the class. These changes take the pain out of extending the class and make it so this library can have a clean upgrade path even when you extend the class. Details: * Wrap instantiation in a hooked function (so it can be unhooked) * Use the global to get to the instance. This allows for an extended child class to set the global and for everything to still work provided the child class provides their own static `get_instance()` method which sets their own static `$instance` property. * Force instantiation via `get_instance()` by making the constructor protected. props jrfnl, see #219
- Loading branch information
Showing
1 changed file
with
34 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters