Re: Bug #19399 [Opn->Fbk]: Bogus "Missing @return tag"
| From: | lpeng564@gmail.com | Date: | Thu, 26 Apr 2012 09:56:48 +0000 |
| Subject: | Re: Bug #19399 [Opn->Fbk]: Bogus "Missing @return tag" | ||
| References: | 1 | Groups: | php.pear.bugs |
| Request: | Send a blank email to pear-bugs+get-8579@lists.php.net to get a copy of this message | ||
LinJim
On Apr 26, 2012, at 1:15, gsherwood@squiz.net wrote:
> Edit report at
> https://pear.php.net/bugs/bug.php?id=19399&edit=1
>
> ID: 19399
> Updated by: gsherwood@squiz.net
> Reported By: anthon dot pang at gmail dot com
> Summary: Bogus "Missing @return tag"
> -Status: Open
> +Status: Feedback
> Type: Bug
> Package: PHP_CodeSniffer
> Operating System: Ubuntu
> Package Version: 1.3.3
> PHP Version: 5.3.2
> -Assigned To:
> +Assigned To: squiz
> Roadmap Versions:
> New Comment:
>
> -Status: Open
> +Status: Feedback
> -Assigned To:
> +Assigned To: squiz
> Even if the function is empty, you'll still be asked to include an
> @return tag in the
> function comment. In this case, you'd use "@return void" to indicate
> that your
> function is never supposed to return a value. This happens for both the
> included
> PEAR and Squiz standards but may not happen for custom standards.
>
>
> Previous Comments:
> ------------------------------------------------------------------------
>
> [2012-04-26 06:03:15] vipsoft
>
> Description:
> ------------
> phpcs reports "Missing @return tag" if the method contains an
> anonymous function that does a return in its body.
>
>
>
> Test script:
> ---------------
> <?php
> /**
> * @package foo
> */
> /**
> * foo
> */
> class Foo
> {
> /**
> * bar
> */
> public function bar()
> {
> array_filter(array(), function ($val)
> {
> return true;
> });
> }
> }
>
> Expected result:
> ----------------
> No error
>
> Actual result:
> --------------
> ---------------------------------------------------------------------------
> -----
> FOUND 1 ERROR(S) AFFECTING 1 LINE(S)
> ---------------------------------------------------------------------------
> -----
> 12 | ERROR | Missing @return tag in function comment
> ---------------------------------------------------------------------------
> -----
>
> ------------------------------------------------------------------------
>
>
> --
> Edit this bug report at
> https://pear.php.net/bugs/bug.php?id=19399&edit=1
>
>
> --
> PEAR Bugs Mailing List (http://pear.php.net/bugs/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>