I have these two classes:
class Service {
public static function __callStatic($name, $arguments)
{
// ... opt-out code
$result = call_user_func_array([CacheService::class, $name], $arguments);
// ... opt-out code
}
}
And this
class CacheService
{
public static function __callStatic($name, $arguments)
{
// ... opt-out code
if (self::getCacheInstance()->has('some_cache_key')) {
return call_user_func_array(['self', $name], $arguments);
}
// ... opt-out code
}
public static function getItems()
{
//... do operations
}
}
When I call Service::getItems(); from the controller, it executes __callStatic in Service class, but when Service class attempts to call getItems() from CacheService, it does not execute __callStatic in CacheService class.
What is the problem exactly ?