php: ReflectionMethod returns 报错时,如何找到函数定义的位置

php: When ReflectionMethod returns error, how do I find out where a function is defined

$this->config = ED::config();
$this->jconfig = ED::jconfig();
$this->doc = JFactory::getDocument();
$this->app = JFactory::getApplication();
$this->input = ED::request();
$this->theme = ED::themes();

$method = new ReflectionMethod('ED', 'themes'); // Getting error message: 0 Method ED::themes() does not exist

这是在 Joomla 网络应用程序中。我试图找出 ED::themes() 的定义位置。我能够找到定义 class ED 的文件,但是,该文件中没有静态函数 themes。所以我尝试使用 ReflectionMethod,但是 returns 一条错误消息说 ED::themes() 不存在。所以我被困在这里。我怎样才能找到这个 ED::themes() 的定义位置?

有问题的 class 有 __callStatic magic method,它处理对 themes() 等不存在的静态方法的调用。除非 class 的开发人员记录了可用的方法,否则您必须自己检查 __callStatic 方法以确定最终被调用的方法。