-
-
Notifications
You must be signed in to change notification settings - Fork 124
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
break
statements stripped of optional number
#16
Comments
Can you |
php 5.4.0 "Removed the ability to pass in variables (e.g., Which leads to the question (maybe best discussed as a separate issue): what version(s) of php will this plugin target? |
Nice work! |
Agreed, and fixed in nikulis/prettier-php@da6aea4 |
I've created a new branch (nikulis/prettier-php@7ee8034) to address this, but did not want to PR at the moment since it is based on the already-open #14.
The php
break
statement should accept an optional trailing integer denoting the number of nested control statements to break. Currently, any trailing integer is removed.Input:
Current output:
There are a couple other quirks surrounding the use of the
break
statement that may or may not fall under the purview of this project to auto-correct and/or offer configurable parameters for:Apparently, php also allows for parentheses around the trailing integer, making it look like a function call, e.g.
break(2);
. Could we automatically remove the parentheses so that all breaks follow the same convention?break 1;
could be collapsed tobreak;
.The text was updated successfully, but these errors were encountered: