Shortcut to create new method that doesn't exist yet?

I've seen this used a number of times on Laracasts. You reference a method that does not exist such as `Post::doSomething($results)` and then you hit a hot key to generate the boilerplate for the method `doSomething` in the class `Post`.

How is this done? Other than constructors, getters, settings, etc I can't find this in the documentation.

4 comments
Comment actions Permalink

Hi there,

Press Alt+Enter while standing on problematic place and choose correct option from the newly appeared menu.

0
Comment actions Permalink

Excellent! Thanks!

0
Comment actions Permalink

Hi..

For me not work. There might be misunderstood, or Mac OS X differs command.

public function execute(InputInterface $input, OutputInterface $output)
{
$this->showTasks($output);
}

I put cursor over showTask (not exists this method) and press Alt+Enter. Nothing happens

 

Apreciate help.

 

 

0
Comment actions Permalink

Hi  there,

https://www.jetbrains.com/help/phpstorm/2016.1/applying-intention-actions.html -- on top right there is a keymap switcher.

As I understand on Mac it would be Option+Enter. In any  case -- you can reach the same menu by clicking on light bulb icon.

http://nedbatchelder.com/pix/macmenusymbols.png

0

Please sign in to leave a comment.