2013-07-11 1 views
0

PHP Depend 및 PMD를 사용하는 데 문제가 있습니다. 내가 사용하는 경우 :PHP_Depend 및 PHP_PMD를 사용하는 중 오류가 발생했습니다.

pdepend --summary-xml=/home/<mydirectory>/.sonar/pdepend.xml --suffix=php,php3,php4,php5,phtml,inc /home/<mydirectory> 

이 결과 :

같은과 함께 발생

Parsing...
.................................................. 1260
........................PHP Catchable fatal error: Argument 1 passed to PHP_Depend_Parser_UnexpectedTokenException::__construct() must be an instance of PHP_Depend_Token, integer given, called in /usr/share/php/PHP/Depend/Parser.php on line 5444 and defined in /usr/share/php/PHP/Depend/Parser/UnexpectedTokenException.php on line 70 PHP Stack trace: PHP 1. {main}() /usr/bin/pdepend:0 PHP 2. PHP_Depend_TextUI_Command::main() /usr/bin/pdepend:78 PHP 3. PHP_Depend_TextUI_Command->run() /usr/share/php/PHP/Depend/TextUI/Command.php:679 PHP 4. PHP_Depend_TextUI_Runner->run() /usr/share/php/PHP/Depend/TextUI/Command.php:206 PHP 5. PHP_Depend->analyze() /usr/share/php/PHP/Depend/TextUI/Runner.php:331 PHP 6. PHP_Depend->performParseProcess() /usr/share/php/PHP/Depend.php:306 PHP 7. PHP_Depend_Parser->parse() /usr/share/php/PHP/Depend.php:560 PHP 8. PHP_Depend_Parser->parseOptionalStatement() /usr/share/php/PHP/Depend/Parser.php:370 PHP 9. PHP_Depend_Parser->parseIfStatement() /usr/share/php/PHP/Depend/Parser.php:5474 PHP 10. PHP_Depend_Parser->parseStatementBody() /usr/share/php/PHP/Depend/Parser.php:3195 PHP 11. PHP_Depend_Parser->parseStatement() /usr/share/php/PHP/Depend/Parser.php:2320 PHP 12. PHP_Depend_Parser_UnexpectedTokenException->__construct() /usr/share/php/PHP/Depend/Parser.php:5444

:

phpmd /home/<mydirectory> xml /home/<mydirectory>/Sonar_Way_php.xml 

PHP Catchable fatal error: Argument 1 passed to PHP_Depend_Parser_UnexpectedTokenException::__construct() must be an instance of PHP_Depend_Token, integer given, called in /usr/share/php/PHP/Depend/Parser.php on line 5444 and defined in /usr/share/php/PHP/Depend/Parser/UnexpectedTokenException.php on line 70 PHP Stack trace:

PHP 1. {main}() /usr/bin/phpmd:0 
PHP 2. PHP_PMD_TextUI_Command::main() /usr/bin/phpmd:48 
PHP 3. PHP_PMD_TextUI_Command->run() /usr/share/php/PHP/PMD/TextUI/Command.php:151 
PHP 4. PHP_PMD->processFiles() /usr/share/php/PHP/PMD/TextUI/Command.php:129 
PHP 5. PHP_PMD_Parser->parse() /usr/share/php/PHP/PMD.php:203 
PHP 6. PHP_Depend->analyze() /usr/share/php/PHP/PMD/Parser.php:128 
PHP 7. PHP_Depend->performParseProcess() /usr/share/php/PHP/Depend.php:306 
PHP 8. PHP_Depend_Parser->parse() /usr/share/php/PHP/Depend.php:560 
PHP 9. PHP_Depend_Parser->parseOptionalStatement() /usr/share/php/PHP/Depend/Parser.php:370 
PHP 10. PHP_Depend_Parser->parseIfStatement() /usr/share/php/PHP/Depend/Parser.php:5474 
PHP 11. PHP_Depend_Parser->parseStatementBody() /usr/share/php/PHP/Depend/Parser.php:3195 
PHP 12. PHP_Depend_Parser->parseStatement() /usr/share/php/PHP/Depend/Parser.php:2320 
PHP 13. PHP_Depend_Parser_UnexpectedTokenException->__construct() /usr/share/php/PHP/Depend/Parser.php:5444 

¿ 어떤 sugestion? 감사.

답변

0

이것은 pdepend와 pmd의 버그입니다. /usr/share/php/PHP/Depend/parser.php에서 나는 변경 : 이것에 대한

private function parseStatement() 
{ 
    if (null === ($stmt = $this->parseOptionalStatement())) { 
     throw new PHP_Depend_Parser_UnexpectedTokenException(
      $this->tokenizer->next(), 
      $this->sourceFile->getFileName() 
     ); 
    } 
    return $stmt; 
} 

:

private function parseStatement() 
{ 
    if (null === ($stmt = $this->parseOptionalStatement())) { 
     throw new PHP_Depend_Parser_UnexpectedTokenException(
      new PHP_Depend_Token, 
      $this->sourceFile->getFileName() 
     ); 
    } 
    return $stmt; 
} 

내가 얻을 경고 만 프로세스가 계속 :

PHP 경고 : 5442 번 라인의 /usr/share/php/PHP/Depend/Parser.php에서 호출되고 /usr/share/php/PHP/Depend/Token.php in line에 정의 된 PHP_Depend_Token :: __ construct()에 대한 인수 1이 누락되었습니다. 121

다음 업그레이드를 기다릴 수 있습니다. e;)

관련 문제