Skip to content
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

Opening brace should not match one-lined anonymous function #122

Closed
soullivaneuh opened this issue Jan 25, 2018 · 3 comments
Closed

Opening brace should not match one-lined anonymous function #122

soullivaneuh opened this issue Jan 25, 2018 · 3 comments

Comments

@soullivaneuh
Copy link
Contributor

soullivaneuh commented Jan 25, 2018

Found on Symfony codebase: https://github.com/symfony/symfony/blob/cf898572a0194340ca2d8111891f8a6b9f860654/src/Symfony/Component/Config/Definition/Builder/ExprBuilder.php#L40

But phpcs will say:

Opening brace must be the last content on the line
Closing brace must be on a line by itself
Missing blank line before return statement

See also: squizlabs/PHP_CodeSniffer#1580

Workaround:

<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.ContentAfterBrace"/>
<exclude name="Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore"/>
<exclude name="PEAR.WhiteSpace.ScopeClosingBrace.Line"/>
<exclude name="Symfony.Formatting.BlankLineBeforeReturn.Invalid"/>
@wickedOne
Copy link
Contributor

wickedOne commented Jun 25, 2018

does #141 fix this issue?

don't think that pointing to a piece of code in the symfony repo provides a proper argument whether or not a coding standard rule is valid or not; please provide a code sample and arguments from symfony's coding standards page to make a point

@soullivaneuh
Copy link
Contributor Author

don't think that pointing to a piece of code in the symfony repo

Maybe some Symfony maintainer could answer, but I don't think why they will not apply Symfony coding standard on the Symfony codebase. :-)

@djoos
Copy link
Owner

djoos commented Sep 11, 2018

Hi guys,

the coding standards page is what we base us on as codebases (even the Symfony repo!) could have bits (for different, sensible reasons) of legacy code that is not in-line with the standard... Those are then up to the CI setup on the codebase to be knowingly excluded.

Hope this helps!

@djoos djoos closed this as completed Sep 11, 2018
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants