2014-07-10 34 views
1

我使用phpdocumentor來執行php代碼嗅探。這已經爲年齡完美運行,但突然我得到一個致命的錯誤,當它試圖「改造項目分析到工件:Phpdocumenter致命錯誤:調用一個非對象的成員函數getMethods()?

Transform analyzed project into artifacts       .. PHP Fatal error: Call to a member function getMethods() on a non-object in /usr/share/php/phpDocumentor/src/phpDocumentor/Descriptor/ClassDescriptor.php on line 176 
PHP Stack trace: 
PHP 1. {main}() /usr/bin/phpdoc:0 
PHP 2. phpDocumentor\Application->run() /usr/bin/phpdoc:29 
PHP 3. Symfony\Component\Console\Application->run() /usr/share/php/phpDocumentor/src/phpDocumentor/Application.php:425 
PHP 4. Symfony\Component\Console\Application->doRun() /usr/share/php/phpDocumentor/vendor/symfony/console/Symfony/Component/Console/Application.php:121 
PHP 5. Symfony\Component\Console\Application->doRunCommand() /usr/share/php/phpDocumentor/vendor/symfony/console/Symfony/Component/Console/Application.php:191 
PHP 6. Symfony\Component\Console\Command\Command->run() /usr/share/php/phpDocumentor/vendor/symfony/console/Symfony/Component/Console/Application.php:895 
PHP 7. phpDocumentor\Command\Project\RunCommand->execute() /usr/share/php/phpDocumentor/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:241 
PHP 8. Symfony\Component\Console\Command\Command->run() /usr/share/php/phpDocumentor/src/phpDocumentor/Command/Project/RunCommand.php:269 
PHP 9. phpDocumentor\Transformer\Command\Project\TransformCommand->execute() /usr/share/php/phpDocumentor/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:241 
etc.. 
etc.. 

我在ClassDescriptor.php文件,其內容檢出線176:

175   foreach($this->getUsedTraits() as $trait) { 
176    $inheritedMethods = $inheritedMethods->merge(clone $trait->getMethods()); 
177   } 

在這裏,我有點卡住了。我不知道爲什麼會突然在一個phpDocumentor的錯誤,但我也不知道它可能是什麼。

沒有任何人有任何想法我該如何解決這個問題?歡迎任何調試提示!

回答

0

我在2.5.0中有同樣的錯誤,結果我所需要的只是升級。它在2.6.1中得到解決。

確保在運行新版本之前刪除目標phpdoc目錄中的任何緩存目錄。 (我用sudo peardev upgrade-all btw升級)

相關問題