The following code:
return new TabPanelLayout( $name, [ 'id' => $name, 'label' => $label, 'expanded' => false, 'tabItemConfig' => [ 'href' => $this->getFullTitle()->getLinkURL( [ 'tab' => $name ] ) ], 'content' => $content ] );
passes phpcs with no warnings, but the indentation of some parts is not correct:
- Elements of the outer array ('id' to 'content') should have one extra level of indentation (and the inner array should be adjusted accordingly)
- The closing ] on the last line should be on its own line after 'content', with the same indentation as the opening [
- The closing ] for the 'tabItemConfig' element has 1 extra tab of indentation
All in all, this would be the end result:
return new TabPanelLayout( $name, [ 'id' => $name, 'label' => $label, 'expanded' => false, 'tabItemConfig' => [ 'href' => $this->getFullTitle()->getLinkURL( [ 'tab' => $name ] ) ], 'content' => $content ] );
If possible, this should be achieved through an existing rule in the phpcs tool, else we would write one. The sniff should have autofix.