Increase PHPStan level from 1 to 2
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3556239. -->
Reported by: [joelpittet](https://www.drupal.org/user/160302)
Related to !80
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>
The module currently passes static analysis at PHPStan level 1. Raising it to<br>
level 2 will help identify more potential issues and improve overall code<br>
quality.
</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>
Update the PHPStan configuration to level 2 and fix any reported issues until<br>
the analysis passes cleanly.
</p>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<ul>
<li>Increase level in <code>phpstan.neon.dist</code>.</li>
<li>Run PHPStan and address reported errors.</li>
<li>Commit fixes and verify CI passes.</li>
</ul>
issue