Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 3.7.2

Bug #11041 Incorrect detection of line endings
Submitted: 2007-05-15 09:41 UTC
From: troehr Assigned: squiz
Status: Bogus Package: PHP_CodeSniffer (version 0.6.0)
PHP Version: Irrelevant OS: Win XP
Roadmaps: (Not assigned)    
Subscription  


 [2007-05-15 09:41 UTC] troehr (Torsten Roehr)
Description: ------------ Please replace all occurrences of "\n" with PHP_EOL in all files. Currently on Windows errors like this are triggered: Expected "if (...) {\n"; found "if (...) {\r\n". Thanks and best regards, Torsten

Comments

 [2007-05-15 09:50 UTC] squiz (Greg Sherwood)
Replacing with PHP_EOL is not a good solution because it then means your code will conform the standards different depending on the OS you run it on. That is not how standards should work. The reason I selected \n for the standards so far is because the PEAR coding standard disallows \r\n and \r line endings: http://pear.php.net/manual/en/standards.file.php You can create your own standard and change \n to \r\n if that is the standard you follow.
 [2007-05-15 09:52 UTC] squiz (Greg Sherwood)
Thank you for taking the time to write to us, but this is not a bug. Marking as expected behavior for reasons outlined above.
 [2007-05-15 09:55 UTC] squiz (Greg Sherwood)
...