This method is useful if you want to apply a filter inside a global bootstrap file to a
static class which may or may not be loaded during every request, or which may be loaded
lazily elsewhere in your application. If the class is already loaded, the filter will be
applied immediately.
However, if the class has not been loaded, the filter will be stored and applied to the class
the first time the method specified in $method is called. This works for any class which
extends StaticObject.
public static apply ( string $class, string $method, Closure $filter ) : void | ||
$class | string | The fully namespaced name of a **static** class to which the filter will be applied. The class name specified in `$class` **must** extend `StaticObject`, or else statically implement the `applyFilter()` method. |
$method | string | The method to which the filter will be applied. |
$filter | Closure | The filter to apply to the class method. |
return | void |