We have code like this in our codebase:
public function qwe(string $someString)
{
return $someString === 'empty' || !$someString ? [] : $someString;
}
When i check it with this rule suggested code is this:
- return $someString === 'empty' || !$someString ? [] : $someString;
+ return $someString === 'empty' || $someString ?: [];
It completely ignores first part of condition. This is not fixable error if i see correctly.
Thanks.
@aiphee What version did you tested? Can you test dev-master ?
Thanks for swift reply.
I have version 6.4.1 ran through "symplify/easy-coding-standard": "^9.0.14"
I tried explicitly setting slevomat/coding-standard to dev-master and result seems same.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Fixed in https://github.com/slevomat/coding-standard/commit/b5d3caf55af3fe8e2f1f8eab03312dddda5c5b4e