Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/joomla/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ide PhpStorm&x27;查找用法';支持SPL PSR-0类自动加载_Ide_Phpstorm_Spl Autoload Register - Fatal编程技术网

Ide PhpStorm&x27;查找用法';支持SPL PSR-0类自动加载

Ide PhpStorm&x27;查找用法';支持SPL PSR-0类自动加载,ide,phpstorm,spl-autoload-register,Ide,Phpstorm,Spl Autoload Register,在PhpStorm中,在使用PSR-0 SPL自动加载的类上使用“查找用法”功能时,没有结果。您可以通过以下方式执行此操作:从项目中选择一个文件,单击鼠标右键,然后查找用法快捷方式为Alt+F7,您可以通过类声明中的Alt+F7在编辑器视图中查找用法 代码如下: spl_autoload_register( function ($class) { if (!strstr($class, "PHPExcel")) { include (__DIR__ . '/.

在PhpStorm中,在使用PSR-0 SPL自动加载的类上使用“查找用法”功能时,没有结果。您可以通过以下方式执行此操作:从项目中选择一个文件,单击鼠标右键,然后查找用法快捷方式为Alt+F7,您可以通过类声明中的Alt+F7在编辑器视图中查找用法

代码如下:

spl_autoload_register(
    function ($class) {

    if (!strstr($class, "PHPExcel")) {
        include (__DIR__ . '/../classes/' . $class . '.php');
    }
});
“Find Usages”在项目中使用时,将找不到此
spl\u autoload\u register
方法中包含的任何此类

但是,“Find Usages”功能确实可以为使用
new
关键字实例化的类以及CSS和JS等链接资产(包括“classes”目录)查找结果


如何为使用spl_autoload_register方法自动加载的类添加“find usages”支持?我希望返回显示类用法的搜索结果。

??请澄清你的问题(用一些截图或其他东西来说明)。你想得到什么样的支持?现在我不明白“查找用法”是如何链接到您的SPL自动加载代码的。。您在文件中使用了“查找用法”——它没有找到任何东西;然后对
classes
folder执行该操作——它找到了引用该文件夹的位置。如果要查找特定类的用法。。然后在该类(而不是文件)上调用“Find Usages”——在类定义中的类名上放置插入符号并使用该操作。SPL Autolaign与此无关。。。由于IDE在整个项目中搜索用法,而不考虑include/require指令。谢谢,我没有意识到在项目视图中单击鼠标右键只搜索文件。进入文件,右键单击类去极化,然后“查找用法”。