Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

phpstan-doctrine crashes phpstan #169

Closed
Seldaek opened this issue Jan 13, 2021 · 4 comments
Closed

phpstan-doctrine crashes phpstan #169

Seldaek opened this issue Jan 13, 2021 · 4 comments

Comments

@Seldaek
Copy link

Seldaek commented Jan 13, 2021

I'm trying to add this project to my phpstan config for packagist.org, but it crashes with:

In ProcessPool.php line 21:

  [PHPStan\ShouldNotHappenException]
  Process qmjscxflzr not found.


Exception trace:
  at phar:///var/www/packagist/vendor/phpstan/phpstan/phpstan/src/Parallel/ProcessPool.php:21
 PHPStan\Parallel\ProcessPool->getProcess() at phar:///var/www/packagist/vendor/phpstan/phpstan/phpstan/src/Parallel/ProcessPool.php:38
 PHPStan\Parallel\ProcessPool->quitProcess() at phar:///var/www/packagist/vendor/phpstan/phpstan/phpstan/src/Parallel/ParallelAnalyser.php:133
 PHPStan\Parallel\ParallelAnalyser->PHPStan\Parallel\{closure}() at phar:///var/www/packagist/vendor/phpstan/phpstan/phpstan/src/Parallel/Process.php:115
 PHPStan\Parallel\Process->PHPStan\Parallel\{closure}() at phar:///var/www/packagist/vendor/phpstan/phpstan/phpstan/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php:97
 _HumbugBoxe2c51d49dfa3\Evenement\EventEmitter->emit() at phar:///var/www/packagist/vendor/phpstan/phpstan/phpstan/vendor/clue/ndjson-react/src/Decoder.php:110
 _HumbugBoxe2c51d49dfa3\Clue\React\NDJson\Decoder->handleData() at phar:///var/www/packagist/vendor/phpstan/phpstan/phpstan/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php:97
 _HumbugBoxe2c51d49dfa3\Evenement\EventEmitter->emit() at phar:///var/www/packagist/vendor/phpstan/phpstan/phpstan/vendor/react/stream/src/Util.php:62
 _HumbugBoxe2c51d49dfa3\React\Stream\Util::_HumbugBoxe2c51d49dfa3\React\Stream\{closure}() at phar:///var/www/packagist/vendor/phpstan/phpstan/phpstan/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php:97
 _HumbugBoxe2c51d49dfa3\Evenement\EventEmitter->emit() at phar:///var/www/packagist/vendor/phpstan/phpstan/phpstan/vendor/react/stream/src/DuplexResourceStream.php:152
 _HumbugBoxe2c51d49dfa3\React\Stream\DuplexResourceStream->handleData() at phar:///var/www/packagist/vendor/phpstan/phpstan/phpstan/vendor/react/event-loop/src/StreamSelectLoop.php:200
 _HumbugBoxe2c51d49dfa3\React\EventLoop\StreamSelectLoop->waitForStreamActivity() at phar:///var/www/packagist/vendor/phpstan/phpstan/phpstan/vendor/react/event-loop/src/StreamSelectLoop.php:172
 _HumbugBoxe2c51d49dfa3\React\EventLoop\StreamSelectLoop->run() at phar:///var/www/packagist/vendor/phpstan/phpstan/phpstan/src/Parallel/ParallelAnalyser.php:151
 PHPStan\Parallel\ParallelAnalyser->analyse() at phar:///var/www/packagist/vendor/phpstan/phpstan/phpstan/src/Command/AnalyserRunner.php:55
 PHPStan\Command\AnalyserRunner->runAnalyser() at phar:///var/www/packagist/vendor/phpstan/phpstan/phpstan/src/Command/AnalyseApplication.php:148
 PHPStan\Command\AnalyseApplication->runAnalyser() at phar:///var/www/packagist/vendor/phpstan/phpstan/phpstan/src/Command/AnalyseApplication.php:79
 PHPStan\Command\AnalyseApplication->analyse() at phar:///var/www/packagist/vendor/phpstan/phpstan/phpstan/src/Command/AnalyseCommand.php:156
 PHPStan\Command\AnalyseCommand->execute() at phar:///var/www/packagist/vendor/phpstan/phpstan/phpstan/vendor/symfony/console/Command/Command.php:228
 _HumbugBoxe2c51d49dfa3\Symfony\Component\Console\Command\Command->run() at phar:///var/www/packagist/vendor/phpstan/phpstan/phpstan/vendor/symfony/console/Application.php:856
 _HumbugBoxe2c51d49dfa3\Symfony\Component\Console\Application->doRunCommand() at phar:///var/www/packagist/vendor/phpstan/phpstan/phpstan/vendor/symfony/console/Application.php:237
 _HumbugBoxe2c51d49dfa3\Symfony\Component\Console\Application->doRun() at phar:///var/www/packagist/vendor/phpstan/phpstan/phpstan/vendor/symfony/console/Application.php:138
 _HumbugBoxe2c51d49dfa3\Symfony\Component\Console\Application->run() at phar:///var/www/packagist/vendor/phpstan/phpstan/phpstan/bin/phpstan:76
 _HumbugBoxe2c51d49dfa3\{closure}() at phar:///var/www/packagist/vendor/phpstan/phpstan/phpstan/bin/phpstan:77
 require() at /var/www/packagist/vendor/phpstan/phpstan/phpstan:6

You can see it at https://github.com/composer/packagist/runs/1696331140?check_suite_focus=true too - and reproduce using the ci branch of the composer/packagist repo, running composer phpstan is enough.

@ondrejmirtes
Copy link
Member

Hi, yeah, PHPStan crashes in an ugly way if there's an error in the provided objectManagerLoader :/ But the real problem is a typo inobject-manager.php:

diff --git a/tests/object-manager.php b/tests/object-manager.php
index 0e9f0e3d..4184eef5 100644
--- a/tests/object-manager.php
+++ b/tests/object-manager.php
@@ -1,6 +1,6 @@
 <?php
 
 require dirname(__DIR__).'/config/bootstrap.php';
-$kernel = new AppKernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
+$kernel = new App\Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
 $kernel->boot();
 return $kernel->getContainer()->get('doctrine')->getManager();

I figured it out because I ran PHPStan with --debug and the real problem showed up:

PHP Fatal error:  Uncaught Error: Class 'AppKernel' not found in /Users/ondrej/Downloads/packagist/tests/object-manager.php:4

@ondrejmirtes
Copy link
Member

Also, I modified PHPStan so that it shows something useful instead :) phpstan/phpstan-src@cbbbd36

Closing - feel free to ask more questions but I think it's solved :)

@Seldaek
Copy link
Author

Seldaek commented Jan 13, 2021

Oh sorry for the noise then :) But good if this lead to some improvement in error output at least.

@github-actions
Copy link

github-actions bot commented May 1, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 1, 2021
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

2 participants