PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » PHP » PHP_CodeSniffer » Bug #9806

When comment is no data, The result is that output script error message.

Details

Submitted2007-01-12 02:41 UTC
Fromkouichi66 at php dot net
Assignedsquiz
StatusClosed
PackagePHP_CodeSniffer
PHP Version5.2.0
OSWindows
Roadmaps(Not assigned)

Comments

[2007-01-12 02:41 UTC] kouichi66 at php dot net

Description:
------------
When comment is no data,
the result is that output script error message.

Fatal error: Call to a member function getShortComment() on a non-object in C:\php5\PEAR\PHP\CodeSniffer\Standards\PEAR\Sniffs\Commenting\FunctionCommentSniff.php on line 167

Test script:
---------------
<?php
// file: test.php

class AAA {
/**
*/
function hogehoge1()
{
;
}
/**
*
*/
function hogehoge2()
{
;
}
/**
*
*
*
*/
function hogehoge3()
{
;
}
}
?>

Expected result:
----------------
% phpcs test.php

FOUND 5 ERROR(S) AND 0 WARNING(S) AFFECTING 5 LINE(S)
--------------------------------------------------------------------------------

2 | ERROR | You must use "/**" style comments for a file comment
4 | ERROR | You must use "/**" style comments for a class comment
7 | ERROR | Missing return tag in function comment
14 | ERROR | Missing return tag in function comment
21 | ERROR | Missing return tag in function comment
--------------------------------------------------------------------------------

Actual result:
--------------
% phpcs test.php

Fatal error: Call to a member function getShortComment() on a non-object in C:\php5\PEAR\PHP\CodeSniffer\Standards\PEAR\Sniffs\Commenting\FunctionCommentSniff.php on line 167

[2007-01-12 03:58 UTC] squiz at php dot net

This bug has been fixed in CVS.

If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET).

If this was a problem with the pear.php.net website, the change should be live shortly.

Otherwise, the fix will appear in the package's next release.

Thank you for the report and for helping us make PEAR better.