Code cleanup from PHPStan report
Problem/Motivation
Our tests with code sniffer and phpunit helped us a lot to get to a high quality code base. However, static code analysis uncovers another range of potential or real code issues, that should also be resolved and tested in both a PHP 7.4 and 8.1 environment.
Proposed resolution
Work through the attached report and clean everything up.
Edited by drupalbot