[PEAR-BUG] Req #20481 [Opn]: detect/ignore shebang as first line
[email protected] Thu, 8 Jan 2015 23:31:00 +0000 (GMT)
| Newsgroups | php.pear.bugs |
|---|---|
| Message-ID | <[email protected]> |
Edit report at https://pear.php.net/bugs/bug.php?id=20481&edit=1 ID: 20481 Updated by: [email protected] Reported By: flyingmana at googlemail dot com Summary: detect/ignore shebang as first line Status: Open Type: Feature/Change Request Package: PHP_CodeSniffer Package Version: Unknown PHP Version: 5.5.20 -Assigned To: +Assigned To: squiz Roadmap Versions: New Comment: -Assigned To: +Assigned To: squiz The sniffs that would report this error are not included in any of the standards that come with PHP_CodeSniffer; they are only in the Generic sniff collection. Are you using a custom standard with scrutinizer-ci or is it a generic check they are doing? Never the less, there are 2 sniffs that report errors with code like that: PHP files must only contain PHP code (Generic.Files.InlineHTML.Found); and The opening PHP tag must be the first content in the file (Generic.PHP.CharacterBeforePHPOpeningTag.Found) I'll look into getting those sniffs to allow shebang lines in case you are using one of those. If it is another, please let me know the error message and the sniff code (use the -s command line argument to see the code). Previous Comments: ------------------------------------------------------------------------ [2015-01-08 01:14:57] flyingmana Description: ------------ the detection for a php opening tag as first content is not complete , as a shebang is valid content here in general (I dont know actual versions, as I got this error on scrutinizer- ci.com and assumed its a general problem) Test script: --------------- #!/usr/bin/env php <?php //some code Actual result: -------------- The opening PHP tag must be the first content in the file ------------------------------------------------------------------------ -- Edit this bug report at https://pear.php.net/bugs/bug.php?id=20481&edit=1