Search code examples
intellij-ideaphpstorm

PhpStorm/IntelliJ generate method from usage


I'm looking for a generate method from usage. IntelliJ supports extract, rename etc. But if i write, for instance, $this->new_method($a) i would like to quickly generate this method in the same class. Does this exist or maybe there is a plugin for it?

Thanks for any help


Solution

    1. Place cursor on non existing method
    2. Alt + Enter (or wait and click on light bulb)
    3. Choose Add method from submenu.

    enter image description here