-
Notifications
You must be signed in to change notification settings - Fork 25
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
Add example of a nowdoc/heredoc as a function parameter #30
Comments
Likewise there is no actual example of the correct format for a multi-line array (or anon function) within a multi-line parameter list. It just says that those do not imply that the parameter list itself is multi-line. |
I'd argue that:
makes it clear that your first example is allowed and your second example is disallowed. |
I don't think it's clear, otherwise I wouldn't have opened this issue. Especially since a function call does not open a new scope if using common terminology (in PHP it's even arguable if Certainly another explicit example can't hurt? |
Alternatively this could be rephrased entirely: "The heredoc body and ending delimiter must be indented one additional level compared to the opening delimiter" |
"Scope" here refers to the indentation scope, not the variable scope. I wouldn't mind adding another example if you want to open a PR. |
I believe the indentation requirement of nowdoc/heredoc is not obviously correct within a multi-line function parameter list, as the ending delimiter also needs to be indented compared to e.g. an anonymous function.
see https://3v4l.org/eGlGY
see #5
The text was updated successfully, but these errors were encountered: