You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While a quick fix for #57 in PR #58 was merged, the file still gets emptied when PHPCBF can't find PHP in the PATH environment variable, as reported in the returned fixer object:
stderr = "'php' is not recognized as an internal or external command,\r\noperable program or batch file.\r\n"
When this issue happens, the stdout is an empty string, and when the extension adds \n to it: let fixed = stdout + '\n'; the text is no longer an empty string and the length is no longer 0, therefore the check for text length if (text.length > 0) always returns true and the file gets emptied. This is solved by merging PR #142 to remove the newline at the end of the fixed code.
This only solves the emptying the document issue, and not the 'php' is not recognized issue (which I have a solution for in PR #157 ).
The text was updated successfully, but these errors were encountered:
While a quick fix for #57 in PR #58 was merged, the file still gets emptied when PHPCBF can't find PHP in the PATH environment variable, as reported in the returned fixer object:
When this issue happens, the
stdout
is an empty string, and when the extension adds\n
to it:let fixed = stdout + '\n';
the text is no longer an empty string and the length is no longer0
, therefore the check for text lengthif (text.length > 0)
always returns true and the file gets emptied. This is solved by merging PR #142 to remove the newline at the end of the fixed code.This only solves the emptying the document issue, and not the
'php' is not recognized
issue (which I have a solution for in PR #157 ).The text was updated successfully, but these errors were encountered: