psalm / phar

A place for Psalm's Phar to live in a composer-versioned setting
https://psalm.dev
24 stars 4 forks source link

Call to undefined method `Psalm\Config::getConfigForPath()` Psalm 5.23.0 #17

Open ghostwriter opened 6 months ago

ghostwriter commented 6 months ago
Uncaught Error: Call to undefined method Psalm\Config::getConfigForPath() in phar:///Users/nathane/.phive/phars/psalm-5.23.0.phar/src/Psalm/Internal/CliUtils.php:265
Stack trace:
#0 phar:///Users/nathane/.phive/phars/psalm-5.23.0.phar/src/Psalm/Internal/Cli/Psalm.php(383): Psalm\Internal\CliUtils::initializeConfig(NULL, '/Users/nathane/...', 'console', Object(Composer\Autoload\ClassLoader), false)
#1 phar:///Users/nathane/.phive/phars/psalm-5.23.0.phar/src/Psalm/Internal/Cli/Psalm.php(670): Psalm\Internal\Cli\Psalm::loadConfig(NULL, '/Users/nathane/...', 'console', Object(Composer\Autoload\ClassLoader), false, Array)
#2 phar:///Users/nathane/.phive/phars/psalm-5.23.0.phar/src/Psalm/Internal/Cli/Psalm.php(204): Psalm\Internal\Cli\Psalm::initConfig('/Users/nathane/...', Array, 'vendor', Object(Composer\Autoload\ClassLoader), NULL, 'console', false, Array)
#3 phar:///Users/nathane/.phive/phars/psalm-5.23.0.phar/psalm(7): Psalm\Internal\Cli\Psalm::run(Array)
#4 /Users/nathane/.phive/phars/psalm-5.23.0.phar(14): require('phar:///Users/n...')
#5 {main}
(Psalm 5.23.0@005e3184fb6de4350a873b9b8c4dc3cede9db762 crashed due to an uncaught Throwable)

installed via phive

weirdan commented 6 months ago

I cannot reproduce it: image

Would you mind creating a small repro in a separate repo?

ghostwriter commented 6 months ago

Thanks for looking into this @weirdan,

It turned out to be a combination of things.

  1. In the 1st package ghostwriter/coding-standard,

  1. In the 2nd package ghostwriter/psalm-sandbox,

Now, i don't understand is how or why downloading and executing a psalm-5.23.0.phar phar file

some how touched the vendor directory outside of the phar and complain something was missing in the phar:///


I’ll find time to reproduce it, but removing || <6.0.1 fixed my issue.

image
ghostwriter commented 5 months ago

Sorry for the delay, https://github.com/ghostwriter/psalm-phar-issues-17