Thanks to visit codestin.com
Credit goes to github.com

Skip to content

move event listener method type hint docs to @Event annotations defau… #18685

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

Closed

Conversation

Haehnchen
Copy link
Contributor

Q A
Branch? 3.0
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR reference to the documentation PR, if any

I moved all listener method receives a "*" from php docs to "@event". makes them parsable by PhpStorm Plugin without extract class names out of comments. This helps to prefill type hints on method creation. There is also a fallback for doccomments, but it would be much easier to provide a common structure eg for external libs.

see also #18684, which adds some missing "@Events"

External issue:
Haehnchen/idea-php-symfony2-plugin#493

phpstorm-events-method

@linaori
Copy link
Contributor

linaori commented May 1, 2016

This would make a very nice addition to the plugin!

@xabbuh
Copy link
Member

xabbuh commented May 2, 2016

👍

@fabpot
Copy link
Member

fabpot commented May 3, 2016

3.0 is probably not the right target. It should be 2.3 or master/3.1. What do you think? It's not really a new feature, but might cause problem is people are relying on the simple @Event tag. So, I'd say that we need to merge this one in master/3.1. Is that ok?

…lt value. makes it easily parsable by PhpStorm plugin
@Haehnchen Haehnchen force-pushed the patch/use-event-annotation-defaults branch from 2bf6e53 to a7c77e7 Compare May 3, 2016 16:30
@Haehnchen
Copy link
Contributor Author

i did a rebase on latest changes in 3.0 branch. master/3.1 sounds good for more.

@fabpot
Copy link
Member

fabpot commented May 3, 2016

Thank you @Haehnchen.

@fabpot fabpot closed this in 6857c36 May 3, 2016
javiereguiluz added a commit to EasyCorp/EasyAdminBundle that referenced this pull request May 6, 2016
This PR was merged into the master branch.

Discussion
----------

Added the new @event annotation

@Haehnchen, the author of the PHPStorm Symfony plugin, has introduced a new `@Event` annotation in Symfony code (symfony/symfony#18685) He's also updating some bundles (e.g. liip/LiipImagineBundle#732) so we could do the same.

In our case this info is not critical because we always use the same generic event object, but still it's a little nice addition.

Commits
-------

9755f38 Added the new @event annotation
@fabpot fabpot mentioned this pull request May 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants