Add trait support
4 posts
• Page 1 of 1
Add trait support
Mostly I found that support for traits is a little bit crippled.
[1] Autocomplete when adding trait to class does not populate with traits in the same namespace. You need to use full namespace ("\Drupal\fdf\MyCustomTrait" instead of "MyCustomTrait" directly).
[2] Autocomplete when adding traits will let you use anything, including interfaces and classes. It should only populate with traits and show error when "using" inside a class is pointing to something that is not a trait.
[3] Methods "inherited" by a class through a trait are not seen by Intellisense. I had to resort to creating stub interfaces for Intellisense to pick the methods in the traits.
It would be great to see support for traits improved.
[1] Autocomplete when adding trait to class does not populate with traits in the same namespace. You need to use full namespace ("\Drupal\fdf\MyCustomTrait" instead of "MyCustomTrait" directly).
[2] Autocomplete when adding traits will let you use anything, including interfaces and classes. It should only populate with traits and show error when "using" inside a class is pointing to something that is not a trait.
[3] Methods "inherited" by a class through a trait are not seen by Intellisense. I had to resort to creating stub interfaces for Intellisense to pick the methods in the traits.
It would be great to see support for traits improved.
You do not have the required permissions to view the files attached to this post.
- davidbcn
- Posts: 87
- Joined: September 10th, 2014, 3:07 am
Re: Add trait support
UPDATE: Looks like some of the issues are due to the fact that PHP Tools needs use statement in trait to have full namespace.
- davidbcn
- Posts: 87
- Joined: September 10th, 2014, 3:07 am
Re: Add trait support
Hi David,
Thanks for the feedback. We've fixed [1] and [2]. So these will be in next update.
We'll improve other traits features in a future updates as well.
Best,
Jakub
Thanks for the feedback. We've fixed [1] and [2]. So these will be in next update.
We'll improve other traits features in a future updates as well.
Best,
Jakub
Jakub Misek │ DEVSENSE s.r.o. | @misekjakub │ jakub@devsense.com │
-
Jakub Misek - Posts: 2092
- Joined: January 4th, 2012, 2:42 pm
- Location: Prague
Re: Add trait support
Hello,
Please check the latest preview. It contains [1] and [2] fixes.
Thanks!
Please check the latest preview. It contains [1] and [2] fixes.
Thanks!
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbeno │ miloslav@devsense.com
-
Miloslav Beno - Posts: 1252
- Joined: January 7th, 2012, 8:36 pm
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 87 guests