Multiple Variables defined by same DocBlock |
|
Unfortunately, I still have to program for PHP 4, or this would be less of an issue since PHP5 has private and public declarations, etc...but even in PHP5, it could be useful...
Anyway, I was looking for a way to define large groups of class methods or variables so that I don't have to do the same phpDoc comments over and over again like so:
When I looked into it online, I found some info on "DocBlock Templates" on wikipedia: http://en.wikipedia.org/wiki/PHPDoc This template should supposedly allow you to make a "private" or "protected" declaration, etc., one time and have it apply to all variables/methods that are within that template. The template would start like so:
This template is then applied to every element until it hits the template ending comment:
It would be very useful in my opinion, to be able to define groups of variables with the DocBlock templates and have those reflected in the Code Insight, which currently doesn't appear to be reading those templates correctly at all, as doing things like the following would greatly reduce redundancy:
Zend Studio, which I quit using because of it's local/remote handling does a bit of a better job in the phpDoc department, as it will actually apply the phpDoc comment to all variables in a comma delimited list of variables even if there is no "DocBlock Template". For my purposes, even doing it that way would suffice, though the Template method has more overall use. Anyway, if there already is a way to do this and I simply don't know about it, if someone could correct me and let me know how, that would be appreciated...i've tried various things, but the phpDoc comments always only gets applied to the first variable in a comma delimited list. So, if there's a way to better comment this without separating each variable one-by-one and still get phpEd to parse it and give the code insight, that would be great. Otherwise, I'll just leave it as my request...to support DocBlock templates...or at the very least make it so that the same comments will apply to all variables in a comma-delimited list. Also, I know this has been brought up elsewhere, but some beautification on the phpDoc comments to have the asterisk characters lined up (subsequent lines after the first line, add one space before asterisk). Thanks, Kevin |
||||||||||||||||||||
|
Site Admin
|
as of version 5.2, these constructs are fully supported in phped.
for example, if you declare your methods like below you'll see them "private" in the code explorer: |
||||||||||||
_________________ The PHP IDE team |
Site Admin
|
Right, and it's because there is no "template" in your code sample. Please add #@+ in the beginning and you'll get it working as you expected: Regarding object properties, we'll extend support of phpdoc "templates" for them in the next build. |
||||||||||||||
_________________ The PHP IDE team |
|
Ah, yep...starting the template would be good
Thanks, Kevin |
||||||||||||
|
Multiple Variables defined by same DocBlock |
|
||
Content © NuSphere Corp., PHP IDE team
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by