Conversation
| if("cli" !== php_sapi_name()) { | ||
| use Doctrine\SqlFormatter\SqlFormatter; | ||
|
|
||
| if('cli' !== php_sapi_name()) { |
There was a problem hiding this comment.
This kind of CS change should be handled by PHPCS. Can we please configure PHPCS so that it runs on the files you've changed here?
There was a problem hiding this comment.
@greg0ire you are an CI expect, might I know why the phpcs is not working for examples/ and for bin/?
examples/ - they are added in https://github.com/doctrine/sql-formatter/blob/e1e39d8f4c/phpcs.xml.dist#L22 and ending with .php, but it seems they are completely ignored as for ex. constants like in https://github.com/doctrine/sql-formatter/blob/e1e39d8f4c/examples/cli.php#L10 are not added to uses.
bin/ - the file does not end with .php but a full path is specified - it seems ignored currently as well as I would expect the php_sapi_name() in https://github.com/doctrine/sql-formatter/blob/e1e39d8f4c/bin/sql-formatter#L6 to be replaced with a constant.
There was a problem hiding this comment.
It works, it's just that you did not spot
Lines 25 to 36 in 7c0096a
There was a problem hiding this comment.
I spot the config but found UnusedUses rule not relevant...
So in examples/ - InlineHTML is still preventing any CS rules when a single inline HTML/PHP is found?
And in bin/ the CS rules are still not applied.
There was a problem hiding this comment.
Well in bin, there are no files ending with .php 🤷♂️
There was a problem hiding this comment.
InlineHTMLis still preventing any CS rules when a single inline HTML/PHP is found?
You don't need a working Github CI to figure that out, do you?
There was a problem hiding this comment.
Well in
bin, there are no files ending with.php🤷♂️
In the config, I am using <file>bin/sql-formatter</file>, so I wonder how to do that, I need a help in this topic, IDK the solution myself.
There was a problem hiding this comment.
Consider filing an issue at https://github.com/PHPCSStandards/PHP_CodeSniffer/
a6d0fc9 to
e1e39d8
Compare
30794d6 to
218a72a
Compare
submitting as a separate PR as requested