Skip to content

Invalid Squiz.Formatting.OperatorBracket error when using namespaces #1350

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

Closed
ofbeaton opened this issue Feb 14, 2017 · 2 comments
Closed

Invalid Squiz.Formatting.OperatorBracket error when using namespaces #1350

ofbeaton opened this issue Feb 14, 2017 · 2 comments

Comments

@ofbeaton
Copy link
Contributor

I ran phpcs and got the following error:
[x] Arithmetic operation must be bracketed

So I ran phpcbf to auto-fix it, and it changed the code line from:
$results = $stmt->fetchAll(\PDO::FETCH_ASSOC | \PDO::FETCH_GROUP | \PDO::FETCH_UNIQUE);

to a syntax error:
$results = $stmt->fetchAll(\(PDO::FETCH_ASSOC | ) \(PDO::FETCH_GROUP | ) \PDO::FETCH_UNIQUE);

@gsherwood gsherwood changed the title [bug] improper auto-fix arithmetic operation must be bracketed Invalid Squiz.Formatting.OperatorBracket error when using namespaces Feb 15, 2017
@gsherwood
Copy link
Member

Thanks for reporting this. That code shouldn't produce any errors at all, so I've fixed that up.

gsherwood added a commit that referenced this issue Feb 15, 2017
@ofbeaton
Copy link
Contributor Author

Thanks for the quick fix as always! Can't wait for stable v3!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants