[TASK] Enhance code according to Sonar rules

https://metrics.typo3.org reports a few problems:

- ForLoopWithTestFunctionCallNotAllowed
- LineLengthMaxExceeded
- FunctionCallArgumentSpacingNoSpaceAfterComma

Change-Id: I092cdea0d75338a3a243d47d547602718bebdce4
Reviewed-on: https://review.typo3.org/26658
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers