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
];
}
}
Activity
Daimona commentedon Jun 27, 2025
Re-opened this in the new repo as PHPCSStandards/PHP_CodeSniffer#1154.