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的錯誤,但我也不知道它可能是什麼。
沒有任何人有任何想法我該如何解決這個問題?歡迎任何調試提示!