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

Bug #15722 "declare(encoding = 'utf-8');" leads to "Missing file doc comment"
Submitted: 2009-01-22 14:47 UTC
From: cweiske Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 1.1.0)
PHP Version: 5.2.8 OS:
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 44 + 31 = ?

 
 [2009-01-22 14:47 UTC] cweiske (Christian Weiske)
Description: ------------ You can specify the encoding of a php file by adding > declare(encoding = 'utf-8'); to the file. To be sure the file is parsed correctly, this declare needs to be the first command in the file. The problem is that phpcs reports a "Missing file doc comment" error. A file doc comment needs to follow the declaration, because the comment could already contain special non-ascii characters that can only be interpreted correctly when the encoding is known. Thus, the encoding declaration is to be allowed before the file doc block.

Comments

 [2009-01-22 14:59 UTC] cweiske (Christian Weiske)
What can happen if you put the encoding declaration after encoded content: http://markmail.org/thread/2nvrx662lcrdvw7s
 [2009-02-10 11:02 UTC] squiz (Greg Sherwood)
-Status: Open +Status: Closed -Assigned To: +Assigned To: squiz
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.