🐛 [BUG] Destroyed Codeformat
Describe the bug After saving an extension with the Extensionbuilder, the codeformat of arrays is destroyed. All is on the left side.
To Reproduce Steps to reproduce the behavior:
- format the code of an array (see screenshot)
- open and save the Ext with the EB (roundtrip active)
- look at the codeformat of the array
TYPO3 Version 10.4.32
Extension Builder Version: Git-branch for TYPO3 10
Additional context Code example for testing:
/**
* @param string $searchString
* @param array $contactPersonUids
*/
public function countByFilter($searchString, $contactPersonUids)
{
// query
$query = $this->createQuery();
$query->matching(
$query->logicalOr(
[
$query->like('company', $searchString),
$query->like('companyaddon', $searchString),
$query->like('address', $searchString),
$query->like('city', $searchString),
$query->in('uid', $contactPersonUids)
]
)
);
// only count
return $query->count();
}

The phpparser has an option for pretty printing: https://github.com/nikic/PHP-Parser/blob/master/doc/component/Pretty_printing.markdown
Have a look at the ParserService class here. It needs to have handed over some more lexer options for the factory method. The challenge is, that you need to keep all those statements and tokens somehow, because you need them later again for printing.