PHPCSExtra
PHPCSExtra copied to clipboard
Sniff to detect the irregular whitespace characters
Originally created in the WPCS repo
Motivation
The motivation behind the sniff was that I got errors in my php code, and I couldn't see where the errors were coming from, unless I highlighted the code in the editor (Sublime), where I could see that there is not a dot in my space.
So this sniff would detect these irregular white spaces in the code and warn the user not to use them.
For this ticket to be actionable, it will need a list of what is considered an "irregular whitespace character".
Without that, there's nothing which can be done.
The inspiration for the sniff comes from ESLint: https://eslint.org/docs/latest/rules/no-irregular-whitespace
There's also the following list: https://invisible-characters.com/
I have copied some of the characters in a test file and ran it through the phpcsdebug standard and I get things like
Thanks for adding that additional info!