rector: Default error handler is not helping
Bug Report
| Subject | Details |
|---|---|
| Rector version | 0.11.2 |
| Installed as | composer dependency |
Minimal PHP Code Causing Issue
dev@phpstorm ~/Code/sw6 $ ../vendor/bin/rector process custom/plugins/FroshPlatformMailArchive/src/Controller/Api/MailResendController.php
4/4 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
[OK] Rector is done!
Expected Behaviour
See the error and not a green OK. Maybe change it to warning with an help text to use -vvv
dev@phpstorm ~/Code/sw6 $ ../vendor/bin/rector process custom/plugins/FroshPlatformMailArchive/src/Controller/Api/MailResendController.php -vv
[parsing] custom/plugins/FroshPlatformMailArchive/src/Controller/Api/MailResendController.php
In IdentifierNotFound.php line 24:
[PHPStan\BetterReflection\Reflector\Exception\IdentifierNotFound]
PHPStan\BetterReflection\Reflection\ReflectionClass "Symfony\Bundle\FrameworkBundle\Controller\AbstractController" could not be found in the located source
Exception trace:
at phar:///home/dev/Code/FroshPluginUploader/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflector/Exception/IdentifierNotFound.php:24
PHPStan\BetterReflection\Reflector\Exception\IdentifierNotFound::fromIdentifier() at phar:///home/dev/Code/FroshPluginUploader/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflector/ClassReflector.php:47
PHPStan\BetterReflection\Reflector\ClassReflector->reflect() at phar:///home/dev/Code/FroshPluginUploader/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Reflection/BetterReflection/Reflector/MemoizingClassReflector.php:29
PHPStan\Reflection\BetterReflection\Reflector\MemoizingClassReflector->reflect() at phar:///home/dev/Code/FroshPluginUploader/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/ReflectionClass.php:645
PHPStan\BetterReflection\Reflection\ReflectionClass->getParentClass() at phar:///home/dev/Code/FroshPluginUploader/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/vendor/ondrejmirtes/better-reflection/src/Reflection/Adapter/ReflectionClass.php:368
PHPStan\BetterReflection\Reflection\Adapter\ReflectionClass->getParentClass() at phar:///home/dev/Code/FroshPluginUploader/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Reflection/ClassReflection.php:161
PHPStan\Reflection\ClassReflection->getParentClass() at phar:///home/dev/Code/FroshPluginUploader/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/PhpDoc/PhpDocBlock.php:196
PHPStan\PhpDoc\PhpDocBlock::getParentReflections() at phar:///home/dev/Code/FroshPluginUploader/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/PhpDoc/PhpDocBlock.php:178
PHPStan\PhpDoc\PhpDocBlock::resolveParentPhpDocBlocks() at phar:///home/dev/Code/FroshPluginUploader/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/PhpDoc/PhpDocBlock.php:146
PHPStan\PhpDoc\PhpDocBlock::resolvePhpDocBlockTree() at phar:///home/dev/Code/FroshPluginUploader/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/PhpDoc/PhpDocBlock.php:128
PHPStan\PhpDoc\PhpDocBlock::resolvePhpDocBlockForMethod() at phar:///home/dev/Code/FroshPluginUploader/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/PhpDoc/PhpDocInheritanceResolver.php:32
PHPStan\PhpDoc\PhpDocInheritanceResolver->resolvePhpDocForMethod() at phar:///home/dev/Code/FroshPluginUploader/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php:2876
PHPStan\Analyser\NodeScopeResolver->getPhpDocs() at phar:///home/dev/Code/FroshPluginUploader/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php:367
PHPStan\Analyser\NodeScopeResolver->processStmtNode() at phar:///home/dev/Code/FroshPluginUploader/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php:252
PHPStan\Analyser\NodeScopeResolver->processStmtNodes() at phar:///home/dev/Code/FroshPluginUploader/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php:491
PHPStan\Analyser\NodeScopeResolver->processStmtNode() at phar:///home/dev/Code/FroshPluginUploader/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php:252
PHPStan\Analyser\NodeScopeResolver->processStmtNodes() at phar:///home/dev/Code/FroshPluginUploader/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php:457
PHPStan\Analyser\NodeScopeResolver->processStmtNode() at phar:///home/dev/Code/FroshPluginUploader/vendor/rector/rector/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php:220
PHPStan\Analyser\NodeScopeResolver->processNodes() at /home/dev/Code/FroshPluginUploader/vendor/rector/rector/packages/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php:130
Rector\NodeTypeResolver\PHPStan\Scope\PHPStanNodeScopeResolver->processNodes() at /home/dev/Code/FroshPluginUploader/vendor/rector/rector/packages/NodeTypeResolver/NodeScopeAndMetadataDecorator.php:78
Rector\NodeTypeResolver\NodeScopeAndMetadataDecorator->decorateNodesFromFile() at /home/dev/Code/FroshPluginUploader/vendor/rector/rector/src/Application/FileProcessor.php:48
Rector\Core\Application\FileProcessor->parseFileInfoToLocalCache() at /home/dev/Code/FroshPluginUploader/vendor/rector/rector/src/Application/FileProcessor/PhpFileProcessor.php:107
Rector\Core\Application\FileProcessor\PhpFileProcessor->Rector\Core\Application\FileProcessor\{closure}() at /home/dev/Code/FroshPluginUploader/vendor/rector/rector/src/Application/FileProcessor/PhpFileProcessor.php:179
Rector\Core\Application\FileProcessor\PhpFileProcessor->tryCatchWrapper() at /home/dev/Code/FroshPluginUploader/vendor/rector/rector/src/Application/FileProcessor/PhpFileProcessor.php:108
Rector\Core\Application\FileProcessor\PhpFileProcessor->process() at /home/dev/Code/FroshPluginUploader/vendor/rector/rector/src/Application/ApplicationFileProcessor.php:70
Rector\Core\Application\ApplicationFileProcessor->processFiles() at /home/dev/Code/FroshPluginUploader/vendor/rector/rector/src/Application/ApplicationFileProcessor.php:56
Rector\Core\Application\ApplicationFileProcessor->run() at /home/dev/Code/FroshPluginUploader/vendor/rector/rector/src/Console/Command/ProcessCommand.php:130
Rector\Core\Console\Command\ProcessCommand->execute() at /home/dev/Code/FroshPluginUploader/vendor/rector/rector/vendor/symfony/console/Command/Command.php:230
RectorPrefix20210514\Symfony\Component\Console\Command\Command->run() at /home/dev/Code/FroshPluginUploader/vendor/rector/rector/vendor/symfony/console/Application.php:826
RectorPrefix20210514\Symfony\Component\Console\Application->doRunCommand() at /home/dev/Code/FroshPluginUploader/vendor/rector/rector/vendor/symfony/console/Application.php:251
RectorPrefix20210514\Symfony\Component\Console\Application->doRun() at /home/dev/Code/FroshPluginUploader/vendor/rector/rector/src/Console/ConsoleApplication.php:72
Rector\Core\Console\ConsoleApplication->doRun() at /home/dev/Code/FroshPluginUploader/vendor/rector/rector/vendor/symfony/console/Application.php:152
RectorPrefix20210514\Symfony\Component\Console\Application->run() at /home/dev/Code/FroshPluginUploader/vendor/rector/rector/bin/rector.php:52
require_once() at /home/dev/Code/FroshPluginUploader/vendor/rector/rector/bin/rector:5
process [-n|--dry-run] [-a|--autoload-file AUTOLOAD-FILE] [-o|--output-format [OUTPUT-FORMAT]] [--no-progress-bar] [--no-diffs] [--output-file OUTPUT-FILE] [--cache-debug] [--clear-cache] [--] [<source>...]
```
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 16 (11 by maintainers)
Commits related to this issue
- [TASK] Output error message for file Resolves: rectorphp/rector#6418 — committed to sabbelasichon/rector-src by sabbelasichon 3 years ago
- [TASK] Output error message for file Resolves: rectorphp/rector#6418 — committed to sabbelasichon/rector-src by sabbelasichon 3 years ago
- [TASK] Output error message for file (#42) Resolves: rectorphp/rector#6418 — committed to rectorphp/rector-src by sabbelasichon 3 years ago
I don’t see how this is connected to the warnings, removing the exceptions fixed it. It runs fine with the deprecation warnings still there?
Lines removed:
https://github.com/PHPOffice/PHPExcel/blob/1.8/Classes/PHPExcel/Writer/PDF/DomPDF.php#L8 https://github.com/PHPOffice/PHPExcel/blob/1.8/Classes/PHPExcel/Writer/PDF/mPDF.php#L8 https://github.com/PHPOffice/PHPExcel/blob/1.8/Classes/PHPExcel/Writer/PDF/tcPDF.php#L9
I’m only complaining that the exceptions were thrown but were not shown on screen - makes it confusing and hard to debug. Not a major issue ofc.
It´s all about clear communication. Nothing wrong but just the message could be clearer here.
I could provide something. Had the same issues some days ago.