- Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
Description
PSR-2 states the following (emphasis mine):
The closing ?> tag MUST be omitted from files containing only PHP.
Zend.Files.ClosingTag only checks for a closing tag at the end of the file, ignoring the bolded part.
Here's an example Gist which is valid according to PSR-2, but running phpcs --standard=PSR2
on the file gives the following output:
-------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE -------------------------------------------------------------------------------- 7 | ERROR | [x] A closing tag is not permitted at the end of a PHP file -------------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY --------------------------------------------------------------------------------
Running phpcbf
will remove the final closing tag.