Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Yml] Create function when no declaration can be found #415

Closed
rvanlaak opened this issue Jan 8, 2015 · 6 comments
Closed

[Yml] Create function when no declaration can be found #415

rvanlaak opened this issue Jan 8, 2015 · 6 comments

Comments

@rvanlaak
Copy link

rvanlaak commented Jan 8, 2015

Great feature to goto the declaration of a call by using CTRL+click in my services.yml. This makes navigating a lot easier, because the yml file is located far away from the controllers.

In case a call / function does not have a declaration (yet), PhpStorm will show the message:

Cannot find declaration to go to

It would be great to add a generator for this under the ALT+enter menu. Most of the time these are setters, so adding the protected variable and the getter/setter would be great!

acme.test_service:
    calls:
        - [ setLogger, [@logger] ]

This could generate:

use Monolog\Logger;

/**
 * @var Logger
 */
protected $logger;

/**
 * @param Logger $logger
 * @return self
 */
 public function setLogger(Logger $logger)
{
    $this->logger = $logger;
    return $this;
}
@Haehnchen Haehnchen added the todo label Jan 8, 2015
@Haehnchen
Copy link
Owner

code generators (+update) are on my todo list, this is only one of them...

@rvanlaak
Copy link
Author

rvanlaak commented Jan 8, 2015

👍

The ALT+enter lookup to the translation file when you cursor is on a translation string in a Twig file also seems broken. It did work before, and is a brilliant feature ;)

@Haehnchen
Copy link
Owner

its in. will improve and also support xml in next release

@Haehnchen Haehnchen added optimize and removed todo labels Jan 15, 2015
@rvanlaak
Copy link
Author

👍

The function is added at a weird position. Are they added sorted by name?

Planning to generate the new class variable as well? Maybe add an extra generator Create setter + variable ?

@Haehnchen
Copy link
Owner

@rvanlaak yes its name sorted what would you a expect?
i will add more features here

@rvanlaak
Copy link
Author

Usually I put the getters/setters at the bottom of my class, but don't think there is a way to figure out how to archieve that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants