Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS Code auto generate interface methods in php class?

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

interface :

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

class :

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

}
}

does this feature exist in VS Code?

like image 221
Amibel Avatar asked Feb 26 '19 10:02

Amibel


2 Answers

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.

edit 25-08-2021

Intelephense premium has such feature, you need to buy a very inexpensive license at https://intelephense.com/

like image 60
Daan Geurts Avatar answered Oct 23 '22 12:10

Daan Geurts


Check PHP tools extension: DEVSENSE.phptools-vscode.

It is providing what you need for free for 30 days as far as I understood.

like image 1
Kirill Devope Avatar answered Oct 23 '22 13:10

Kirill Devope