Reinstate PHP 8.1 tests (previous major) and check for any breaking code
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3542368. -->
Reported by: [marcus_johansson](https://www.drupal.org/user/385947)
Related to !845
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>We removed the PHP 8.1 tests in <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/ai/issues/3537549" title="Status: Closed (fixed)">#3537549: Remove previous major tests</a></span>, because DrupalCI was having issues. This has since been fixed in the DrupalCI issue queue <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/drupalci_environments/issues/3537551" title="Status: Closed (fixed)">#3537551: PHP 8.1 images broken apt source (used in phpunit previous major)</a></span> and can be used once again.</p>
<p>This means that we have gotten code into 1.2.x branch that is not 8.1 compatible. This should be fixed.</p>
<p>We should also based on this write out in developer documentation how we treat Drupal and PHP versioning.</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Reinstate the previous major test.<br>
Run a phpstan test on all code and fix any code that breaks 8.1 compability.<br>
Write a page in the documentation about how we should treat Drupal and PHP versions.</p>
issue