phptools-docs
phptools-docs copied to clipboard
Formatting does not remove closing ?> tag
PHP Tools version: 1.36.13517.
When saving a php script the closing ?> tag is not removed if present in a pure PHP file. This is trivial but it need to be fixed to ensure compliance.
Thank you for the suggestions.
It appears you're right and PSR-2 is saying:
The closing ?> tag MUST be omitted from files containing only PHP.
I'm not sure if formatter itself should do this, or other component. Anyway we will take a look at it.
Thanks!
@Miloslav hi,
Thank you for responding. This is not a big issue but helps prevents us forgetting to comply. With regards to where this fix should be done, I can quite definitely say it has to be done in Devsense PHP extension as I can confirm that this is the only extension I am using for formatting. I do use other extensions but they are for snippets only and they do not do formatting.
Hi,
We've added a diagnostic warning and code action for this one in the latest version. Please check it out.
Thanks again for the suggestion.
@Miloslav Hi,
Thank you for the update. Solution works and acceptable. The PHP Intelephense extension works auto. I mean i do not have to worry about the closing as it auto removes if there is no code below the closing tag.
I love all the improvements especially the one on auto-completing for Server parameters and Globals. I always had trouble with that. one. Thank you.