phpstan: Jean85\PrettyVersions not found

Both composer global install and phar fail with:

phpstan.phar    
PHP Fatal error:  Uncaught Error: Class 'PHPStanVendor\Jean85\PrettyVersions' not found in phar:///usr/local/bin/phpstan.phar/bin/phpstan:23
Stack trace:
#0 /usr/local/bin/phpstan.phar(4): require()
#1 {main}
  thrown in phar:///usr/local/bin/phpstan.phar/bin/phpstan on line 23

In addition, https://github.com/phpstan/phpstan/releases/tag/0.8.5 is missing phar.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 38 (20 by maintainers)

Most upvoted comments

@dinamic You have a completely different problem and this error is just a side effect. When using PHPStan with its extensions, they have to see each other. So when using the docker image, you have to install PHPStan extensions alongside PHPStan. See “Install PHPStan extensions” at https://github.com/phpstan/docker-image/blob/master/README.md

Composer version in use?

BTW I’m not able to reproduce it with an isolated Docker env, using this command:

docker run --rm php:7.1.10-cli \
    curl -sS https://github.com/phpstan/phpstan/releases/download/0.8.4/phpstan.phar \
    && php ./phpstan.phar