Closed tolki5 closed 1 year ago
It sounds like you want the -l
or --syntax-check
flag for the php
executable. https://www.php.net/manual/en/features.commandline.options.php
PHP_CodeSniffer is a tool for checking that code conforms to a particular coding standard.
Yes, this is exactly what i need. However, when calling php, in the event of an error, I get a response in this format:
Parse error: syntax error, unexpected '$resPcs' (T_VARIABLE) in D:\php\index.php on line 22 Errors parsing D:\php\index.php
This format is not compatible with https://github.com/deadem/notepad-pp-linter, which I would like to use in notepad++ to pre-check scripts.
Only supported format is from phpcs:
<?xml version="1.0" encoding="UTF-8"?> <checkstyle version="2.9.2"> <file name="D:\php\index.php"> <error line="1" column="1" severity="error" message="End of line character is invalid; expected "\n" but found "\r\n"" source="Generic.Files.LineEndings.InvalidEOLChar"/></file></checkstyle>
@tolki5 Sounds like you are looking for a tool like PHP Parallel Lint.
Note: this repo is not a general PHP tooling support forum. You may be better off in StackOverflow or something.
Agree with @jrfnl - sounds like you're not looking for a tool to enforce coding standards. Try the linter and you'll get what you need.
I ran the phpcs function over the php file which works normally and got this error report.
`<?xml version="1.0" encoding="UTF-8"?>