如何让 PhpStorm 转到正确的声明
我有以下代码片段。
abstract class MrParent {
public function __construct() {
$this->var = 'a';
}
}
class MrChild extends MrParent {
public function hello() {
echo 'Hello';
}
}
$MrGuy = new MrChild();
现在,在 PhpStorm 中,当我在“MrChild”类的最后一行上单击鼠标中键(“转到声明”)时,光标会跳到“__construct”行。我期待它进入“MrChild 类扩展 MrParent”行。
在单个文档中,这没问题,但在每个文件一个类的设置中,这非常烦人,因为这意味着 IDE 不断向我显示我不想要的类。
我知道,如果我将以下代码添加到“MrChild”类中,我就会得到我想要的,但这似乎我不应该通过添加额外的代码来修复我认为是 IDE 错误的内容。
public function __construct() {
parent::__construct();
}
您有什么建议吗?
I have the following snippet of code.
abstract class MrParent {
public function __construct() {
$this->var = 'a';
}
}
class MrChild extends MrParent {
public function hello() {
echo 'Hello';
}
}
$MrGuy = new MrChild();
Now, in PhpStorm, when I middle-click ("Go To Declaration") on the last line of the "MrChild" class, the cursor jumps up to the "__construct" line. I was expecting it to go to the "class MrChild extends MrParent" line.
In a single document, this is OK, but in a setup where it's one class per file, this is quite annoying because it means the IDE is constantly showing me the class I don't want.
I know that if I added the following code to the "MrChild" class, I'd get what I want, but that seems like I shouldn't be fixing what I consider to be an IDE bug by adding extra code.
public function __construct() {
parent::__construct();
}
Do you have any suggestion?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您面临 WI-4880 问题。欢迎观看/投票。
You are facing WI-4880 issue. Feel free to watch/vote.