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

Error on initializing (with Xdebug) #244

Closed
MacDada opened this issue Oct 13, 2017 · 1 comment
Closed

Error on initializing (with Xdebug) #244

MacDada opened this issue Oct 13, 2017 · 1 comment

Comments

@MacDada
Copy link

MacDada commented Oct 13, 2017

I've just installed psalm with composer require --dev vimeo/psalm.

I try to initialize it, but I get the error:

$ ./vendor/vimeo/psalm/bin/psalm --init
The given path "/vagrant/--ansi" does not appear to be a directory

Lets slightly modify the source code of psalm by adding var_dumps:

var_dump('a', $GLOBALS['argv']);
// If XDebug is enabled, restart without it
(new \Composer\XdebugHandler(\Composer\Factory::createOutput()))->check();
var_dump('b', $GLOBALS['argv']);
$ ./vendor/vimeo/psalm/bin/psalm --init
string(1) "a"
array(2) {
  [0] =>
  string(30) "./vendor/vimeo/psalm/bin/psalm"
  [1] =>
  string(6) "--init"
}
string(1) "a"
array(3) {
  [0]=>
  string(30) "./vendor/vimeo/psalm/bin/psalm"
  [1]=>
  string(6) "--init"
  [2]=>
  string(6) "--ansi"
}
string(1) "b"
array(3) {
  [0]=>
  string(30) "./vendor/vimeo/psalm/bin/psalm"
  [1]=>
  string(6) "--init"
  [2]=>
  string(6) "--ansi"
}
The given path "/vagrant/--ansi" does not appear to be a directory

Notice the --ansi parameter being added after XdebugHandler is called, causing the directory to be wrong.

@muglug muglug closed this as completed in 6c1587d Oct 14, 2017
@muglug
Copy link
Collaborator

muglug commented Oct 14, 2017

Thanks for the detailed write-up!

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

No branches or pull requests

2 participants