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

Config option "ignoreEnv" not working #25

Open
pvettori opened this issue Jul 30, 2024 · 3 comments
Open

Config option "ignoreEnv" not working #25

pvettori opened this issue Jul 30, 2024 · 3 comments
Assignees

Comments

@pvettori
Copy link

VsCode PHP CS Fixer is one of my most used VSCode extensions.
I now have installed php 8.3 on my system, but the current version of uses a builtin php-cs-fixer that allows php 8.2 as maximum version.
I know there is a somewhat "hidden" configuration setting called "ignoreEnv" that allows running the fixer with the env option PHP_CS_FIXER_IGNORE_ENV = 1, but it actually does not work properly.

There is an easy fix to this issue which consists in changing the line 22 of "extension.js" to something like this:

    opts.env = { PHP_CS_FIXER_IGNORE_ENV: 1 };

I hope you can integrate this fix.

@mansoorkhan96 mansoorkhan96 self-assigned this Jul 31, 2024
@mansoorkhan96
Copy link
Owner

@pvettori Have you tried and confirm this works on windows then?

I am on macs and if even remove that line, it still works.

@mansoorkhan96
Copy link
Owner

I have updated. lets see if it works for you.

@pvettori
Copy link
Author

pvettori commented Aug 3, 2024

I have updated. lets see if it works for you.

Thank you, it now seems to be working on both Windows and Ubuntu.
I see that you have updated the php-cs-fixer source file and it now supports php 8.3 by default, that is maybe the reason you find that it works even if you remove that line.

I doug a bit deeper and found out from documentation (child_process.execFile()) that a better solution would be to write line (now) 23 as follows:

opts.env = { ...process.env, PHP_CS_FIXER_IGNORE_ENV: 1 }

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