VS Code在PHP类中自动生成接口方法?

问题描述:

我如何从接口自动实现"/生成方法到PHP类中? 我想使用 VS Code

How can i "auto implement"/generate methods from interfaces into PHP classes? I wanna use VS Code for it

界面:

interface MyInterface{  public function myMethod($param); }

class:

Class MyClass implements MyInterface{
//myMethod should be auto generate by vscode
   public function myMethod($param){

}
}

VS代码中是否存在此功能?

VSCode不支持PHP.据我所知,这无法通过任何现有的PHP插件(如PHP Intelephense或PHP IntelliSense)获得. 不过,PHP Intelephense会从已实现的接口中自动完成方法.

VSCode doesn't support this out of the box for PHP. For what I know, this is not available through any of the existing PHP plugins like PHP Intelephense or PHP IntelliSense. PHP Intelephense does autocomplete methods from implemented interfaces though.