I have the following class in PHP with all static methods:
class Foo {
public static function a {
}
public static function b {
}
public static function c {
}
public static function d {
}
public static function e {
}
}
Is there a way to create a hook to fire before calling any of the methods in class Foo
i.e. like a before hook? I need some logic, and don't want to have to add that logic to every static function like:
class Foo {
private static function init() {
// pre logic here
}
public static function a {
Foo::init();
}
public static function b {
Foo::init();
}
public static function c {
Foo::init();
}
public static function d {
Foo::init();
}
public static function e {
Foo::init();
}
}