You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The rule PEAR.WhiteSpace.ObjectOperatorIndent always shows an error for indentation space for object operator when on a array that has a embedded array before it.
If i move the key brand from the code sample to the end of the array the error is not reported anymore.
Code sample
<?phpnamespaceExample;
class Bug
{
publicfunctiontoJson(array$list): array
{
return [
'brand' => [
'id' => $item->product()->brand()->id(),
'title' => $item->product()->brand()->name(),
],
'charges' => $item->charges()
->toArray(), // Object operator not indented correctly; expected 20 spaces but found 16
];
}
}
…alls
No functional change. CI should be happy.
Notes:
This enforces indenting exactly once for each chained method call.
There is currently a bug in the sniff. If we choose `multilevel =
false`, it cannot decide between two indentation levels and will always
flag an error. We must therefore choose `multilevel = true`.
[0]: squizlabs/PHP_CodeSniffer#3718
Change-Id: I2a09ab03ffafa8efe24b55260152e954e91d603e
Describe the bug
The rule
PEAR.WhiteSpace.ObjectOperatorIndent
always shows an error for indentation space for object operator when on a array that has a embedded array before it.If i move the key
brand
from the code sample to the end of the array the error is not reported anymore.Code sample
Custom ruleset
To reproduce
Steps to reproduce the behavior:
test.php
with the code sample above...phpcs test.php ...
Expected behavior
PHPCS and PHPCPF should be able to "select" the right indentation when on a array, even if a "embedded array" before it.
Versions (please complete the following information):
Additional context
NONE
The text was updated successfully, but these errors were encountered: