Skip to content
This repository has been archived by the owner on Mar 24, 2022. It is now read-only.

Throwing errors if composer json does not contain all options #2

Open
skors opened this issue Oct 6, 2016 · 0 comments
Open

Throwing errors if composer json does not contain all options #2

skors opened this issue Oct 6, 2016 · 0 comments

Comments

@skors
Copy link

skors commented Oct 6, 2016

Hi,

if the composer json in the required is not complete, an error is thrown:

PHP Notice:  Undefined property: stdClass::$zip in phar:///opt/tools/phpmetrics/extensions/composer-extension.phar/ComposerExtension.php on line 52
PHP Stack trace:
PHP   1. {main}() /usr/local/bin/phpmetrics:0
PHP   2. Symfony\Component\Console\Application->run() /usr/local/bin/phpmetrics:17
PHP   3. Symfony\Component\Console\Application->doRun() phar:///usr/local/bin/phpmetrics/vendor/symfony/console/Application.php:117
PHP   4. Symfony\Component\Console\Application->doRunCommand() phar:///usr/local/bin/phpmetrics/vendor/symfony/console/Application.php:186
PHP   5. Symfony\Component\Console\Command\Command->run() phar:///usr/local/bin/phpmetrics/vendor/symfony/console/Application.php:815
PHP   6. Hal\Application\Command\RunMetricsCommand->execute() phar:///usr/local/bin/phpmetrics/vendor/symfony/console/Command/Command.php:256
PHP   7. Hal\Application\Extension\ExtensionService->receive() phar:///usr/local/bin/phpmetrics/src/Hal/Application/Command/RunMetricsCommand.php:156
PHP   8. ComposerExtension\ComposerExtension->receive() phar:///usr/local/bin/phpmetrics/src/Hal/Application/Extension/ExtensionService.php:51

and another example

PHP Warning:  implode(): Invalid arguments passed in phar:///opt/tools/phpmetrics/extensions/composer-extension.phar/HtmlRenderer.php on line 81
PHP Stack trace:
PHP   1. {main}() /usr/local/bin/phpmetrics:0
PHP   2. Symfony\Component\Console\Application->run() /usr/local/bin/phpmetrics:17
PHP   3. Symfony\Component\Console\Application->doRun() phar:///usr/local/bin/phpmetrics/vendor/symfony/console/Application.php:117
PHP   4. Symfony\Component\Console\Application->doRunCommand() phar:///usr/local/bin/phpmetrics/vendor/symfony/console/Application.php:186
PHP   5. Symfony\Component\Console\Command\Command->run() phar:///usr/local/bin/phpmetrics/vendor/symfony/console/Application.php:815
PHP   6. Hal\Application\Command\RunMetricsCommand->execute() phar:///usr/local/bin/phpmetrics/vendor/symfony/console/Command/Command.php:256
PHP   7. Hal\Application\Command\Job\Queue->execute() phar:///usr/local/bin/phpmetrics/src/Hal/Application/Command/RunMetricsCommand.php:163
PHP   8. Hal\Application\Command\Job\ReportWriter->execute() phar:///usr/local/bin/phpmetrics/src/Hal/Application/Command/Job/Queue.php:51
PHP   9. Hal\Application\Formater\Summary\Html->terminate() phar:///usr/local/bin/phpmetrics/src/Hal/Application/Command/Job/ReportWriter.php:75
PHP  10. Twig_Environment->render() phar:///usr/local/bin/phpmetrics/src/Hal/Application/Formater/Summary/Html.php:91
PHP  11. Twig_Template->render() phar:///usr/local/bin/phpmetrics/vendor/twig/twig/lib/Twig/Environment.php:347
PHP  12. Twig_Template->display() phar:///usr/local/bin/phpmetrics/vendor/twig/twig/lib/Twig/Template.php:366
PHP  13. Twig_Template->displayWithErrorHandling() phar:///usr/local/bin/phpmetrics/vendor/twig/twig/lib/Twig/Template.php:355
PHP  14. __TwigTemplate_b26c8aec323d934747ab94470b20e7a36f5ff4f8a249a9ef862a1ddf72d09b30->doDisplay() phar:///usr/local/bin/phpmetrics/vendor/twig/twig/lib/Twig/Template.php:387
PHP  15. Hal\Application\Formater\Twig\FormatingExtension->extensionsContent() phar:///usr/local/bin/phpmetrics/vendor/twig/twig/lib/Twig/Environment.php(403) : eval()'d code:539
PHP  16. ComposerExtension\HtmlRenderer->renderHtml() phar:///usr/local/bin/phpmetrics/src/Hal/Application/Formater/Twig/FormatingExtension.php:118
PHP  17. implode() phar:///opt/tools/phpmetrics/extensions/composer-extension.phar/HtmlRenderer.php:81

I think it would be better to just output an information of the missing information rather then throwing a warning or notice.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant