-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow short PHP echo tags #142
Comments
@justintadlock I've just looked into this. The current sniff we use - As the sniff comes from PHPCS itself, I think the best course of action would be to propose a custom property to be added to the sniff which can toggle whether "short open echo" is allowed or not. If this would be acceptable to PHPCS, I'd happily create the PR for it. Would you be willing to write up & open the issue yourself in the PHPCS repo please ? |
If you can point me to the correct place to post the issue, I'd be happy to create a ticket. |
@justintadlock Just saw the upstream issue & Greg's response. I had looked at the sniff, but must have completely overlooked the different error codes. Oh well... at least that means this can be fixed really easily. |
Cool. I closed that ticket out. |
Should this be added in the ruleset? The <exclude name="Generic.PHP.DisallowShortOpenTag.EchoFound"/> Or should we leave this out? @justintadlock |
Short PHP
<?
tags should be disallowed (see: #2). However, as of PHP 5.4, the short echo syntax<?=
is always available. The sniffer should make a distinction between the two.For those of us no longer coding for PHP versions that have reached EOL, it'd be nice to be able to use the short echo syntax, especially within templates.
Here's an example:
Reference:
The text was updated successfully, but these errors were encountered: