Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy. This forum is not for asking programming related questions.
1. This ERROR appears only after validation is complete and there are no other ERROR or WARNING.
2. In editor viewing all hidden characters, there are no unusual end of line characters after the first line, [CR][LF], which is the same for all lines within my PHP code.
I am running PHP_CodeSniffer within the Windows environment, and it is expected for editor within the Windows environment to use for the end of line with "\r\n".
So, I am thinking this an error within PHP_CodeSniffer because it is expecting to validate PHP code within a UNIX environment, where the default end of line is "\n" .
So, within my IDE, Eclipse PDT, I cannot remove "\r\n" from my code, thereby I have no way of avoiding this error in Windows: End of line character is invalid; expected "\n" but found "\r\n"
<!--
Another useful example of changing sniff settings is
to specify the end of line character that your standard
should check for.
-->
<rule ref="Generic.Files.LineEndings">
<properties>
<property name="eolChar" value="\r\n"/>
</properties>
</rule>
If you don't want to enforce that, and since CodeSniffer is really just a collection of rules to validate code against, then remove the rule definition.