| Summary: | PHPDoc does not add @throws when using variables | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Sylvia Tancheva <silviya> |
| Component: | PDT | Assignee: | Q.S. Wang <qiangsheng.w> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P1 | CC: | gadi, ganoro, qiangsheng.w |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
Fixed. [Petyo Tanchev] Tested on 2.2.1 SR1 Works as expected. |
Example code: function doSomeStuff($header, $footer) { if (strlen ( $footer ) < 0) { $err= new Exception($header, $code); throw $err; } } Generate Element Comment for this function. Result: /** * Enter description here ... * @param unknown_type $header * @param unknown_type $footer */ As you can see there is no @throws line. Replace the code: $err= new Exception($header, $code); throw $err; with: throw new Exception($header, $code); The generated comment will be: /** * Enter description here ... * @param unknown_type $header * @param unknown_type $footer * @throws Exception */ So in case you use the class directly in the throw statement you get a @throws, otherwise (i.e. use variables) not.