6

Is there a way in PhpStorm to automatically generate the empty methods that are required by the interface the given class is implementing?

Say we have an Interface with 3 methods - when defining the new class that implements this interface - some option to auto-generate containers for all required methods.

Don't Panic
  • 41,125
  • 10
  • 61
  • 80
Sebastian Sulinski
  • 5,815
  • 7
  • 39
  • 61

2 Answers2

16

Sure, you can.

There are 3 ways to do it :

  1. Press
    Ctrl + I
  2. On main menu, click
    Code --> Implement Methods
  3. On the code editor, press right click on your mouse, then click
    Generate --> Implement Methods

After that, you can select one or some method(s), then click OK.

Adi Priyanto
  • 161
  • 3
14

From my comment: You could try ALT + ENTER. This normaly shows up a small "dialog" to autogenerate phpdoc, functions, etc.

bish
  • 3,381
  • 9
  • 48
  • 69