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

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

Open
ghostwriter opened this issue Mar 10, 2024 · 3 comments

Comments

@ghostwriter
Copy link

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
Copy link
Member

weirdan commented Mar 10, 2024

I cannot reproduce it:
image

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

@ghostwriter
Copy link
Author

Thanks for looking into this @weirdan,

It turned out to be a combination of things.

  1. In the 1st package ghostwriter/coding-standard,
  • I was using "vimeo/psalm": ">=5.23 || <6.0.1 || dev-main as 6.0.0.999” in composer (to be able to use nikic/PHP-Parser both 4.x and 5.x in other packages)

  • I made a mistake using || <6.0.1.


  1. In the 2nd package ghostwriter/psalm-sandbox,
  • I used ghostwriter/coding-standard and nikic/[email protected] as a dev dependency.

  • composer was downloading vimeo/psalm:0.3.14 because of || <6.0.1.


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
Copy link
Author

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

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

No branches or pull requests

2 participants