Issues reported by phpstan
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3560873. -->
Reported by: [bluegeek9](https://www.drupal.org/user/1286304)
Related to !23
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<h4 id="summary-steps-reproduce">Steps to reproduce</h4>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<pre> ------ ----------------------------------------------------------------------- <br> Line knowledge.module <br> ------ ----------------------------------------------------------------------- <br> 738 Call to deprecated function theme_get_setting(): <br> in drupal:11.3.0 and is removed from drupal:13.0.0. Use <br> <br> \Drupal::service('Drupal\Core\Extension\ThemeSettingsProvider')->getS <br> etting() <br> instead. <br> 🪪 function.deprecated <br> ------ ----------------------------------------------------------------------- <br> ------ ----------------------------------------------------------------------- <br> Line src/KnowledgeFieldItemList.php <br> ------ ----------------------------------------------------------------------- <br> 33 Return type mixed of method <br> Drupal\knowledge\KnowledgeFieldItemList::offsetExists() is not <br> covariant with return type bool of method <br> Drupal\Core\TypedData\Plugin\DataType\ItemList<Drupal\Core\Field\Fiel <br> dItemInterface>::offsetExists(). <br> ------ ----------------------------------------------------------------------- <br> ------ ----------------------------------------------------------------- <br> Line tests/src/Functional/KnowledgeCacheTagsTest.php <br> ------ ----------------------------------------------------------------- <br> 69 Call to deprecated function entity_test_create_bundle(): <br> in drupal:11.2.0 and is removed from drupal:12.0.0. Use <br> \Drupal\entity_test\EntityTestHelper::createBundle() instead. <br> 🪪 function.deprecated <br> ------ ----------------------------------------------------------------- <br> ------ ----------------------------------------------------------------- <br> Line tests/src/Functional/KnowledgeNonNodeTest.php <br> ------ ----------------------------------------------------------------- <br> 67 Call to deprecated function entity_test_create_bundle(): <br> in drupal:11.2.0 and is removed from drupal:12.0.0. Use <br> \Drupal\entity_test\EntityTestHelper::createBundle() instead. <br> 🪪 function.deprecated <br> 494 Call to deprecated function entity_test_create_bundle(): <br> in drupal:11.2.0 and is removed from drupal:12.0.0. Use <br> \Drupal\entity_test\EntityTestHelper::createBundle() instead. <br> 🪪 function.deprecated <br> 513 Call to deprecated function entity_test_create_bundle(): <br> in drupal:11.2.0 and is removed from drupal:12.0.0. Use <br> \Drupal\entity_test\EntityTestHelper::createBundle() instead. <br> 🪪 function.deprecated <br> ------ ----------------------------------------------------------------- <br> ------ ----------------------------------------------------------------- <br> Line tests/src/Functional/Rest/KnowledgeResourceTestBase.php <br> ------ ----------------------------------------------------------------- <br> 94 Call to deprecated function entity_test_create_bundle(): <br> in drupal:11.2.0 and is removed from drupal:12.0.0. Use <br> \Drupal\entity_test\EntityTestHelper::createBundle() instead. <br> 🪪 function.deprecated <br> ------ ----------------------------------------------------------------- <br> ------ --------------------------------------------------------------------- <br> Line tests/src/Unit/CompetencyAccessControlHandlerTest.php <br> ------ --------------------------------------------------------------------- <br> 20 @coversDefaultClass references an invalid class <br> \Drupal\knowledge\CompetencyAccessControlHandler <br> CompetencyAccessControlHandler. <br> 🪪 phpunit.coversClass <br> 82 @covers value \Drupal\knowledge\CompetencyAccessControlHandler <br> CompetencyAccessControlHandler::checkAccess references an invalid <br> method. <br> 🪪 phpunit.coversMethod <br> 146 @covers value \Drupal\knowledge\CompetencyAccessControlHandler <br> CompetencyAccessControlHandler::checkAccess references an invalid <br> method. <br> 🪪 phpunit.coversMethod <br> 210 @covers value \Drupal\knowledge\CompetencyAccessControlHandler <br> CompetencyAccessControlHandler::checkAccess references an invalid <br> method. <br> 🪪 phpunit.coversMethod <br> 280 @covers value \Drupal\knowledge\CompetencyAccessControlHandler <br> CompetencyAccessControlHandler::checkAccess references an invalid <br> method. <br> 🪪 phpunit.coversMethod <br> 351 @covers value \Drupal\knowledge\CompetencyAccessControlHandler <br> CompetencyAccessControlHandler::checkAccess references an invalid <br> method. <br> 🪪 phpunit.coversMethod <br> 394 @covers value \Drupal\knowledge\CompetencyAccessControlHandler <br> CompetencyAccessControlHandler::checkAccess references an invalid <br> method. <br> 🪪 phpunit.coversMethod <br> 428 @covers value \Drupal\knowledge\CompetencyAccessControlHandler <br> CompetencyAccessControlHandler::checkAccess references an invalid <br> method. <br> 🪪 phpunit.coversMethod <br> 492 @covers value \Drupal\knowledge\CompetencyAccessControlHandler <br> CompetencyAccessControlHandler::checkAccess references an invalid <br> method. <br> 🪪 phpunit.coversMethod <br> 555 @covers value \Drupal\knowledge\CompetencyAccessControlHandler <br> CompetencyAccessControlHandler::checkCreateAccess references an <br> invalid method. <br> 🪪 phpunit.coversMethod <br> ------ --------------------------------------------------------------------- <br> ------ ----------------------------------------------------------------------- <br> Line tests/src/Unit/CompetencyStorageTest.php <br> ------ ----------------------------------------------------------------------- <br> 131 Trying to mock an undefined method getActiveDefinition() on class <br> Drupal\Core\Entity\EntityTypeManagerInterface. <br> 🪪 phpunit.mockMethod <br> 136 Trying to mock an undefined method getActiveFieldStorageDefinitions() <br> on class Drupal\Core\Entity\EntityFieldManagerInterface. <br> 🪪 phpunit.mockMethod <br> 173 Trying to mock an undefined method getActiveDefinition() on class <br> Drupal\Core\Entity\EntityTypeManagerInterface. <br> 🪪 phpunit.mockMethod <br> 178 Trying to mock an undefined method getActiveFieldStorageDefinitions() <br> on class Drupal\Core\Entity\EntityFieldManagerInterface. <br> 🪪 phpunit.mockMethod <br> ------ ----------------------------------------------------------------------- <br> ------ ----------------------------------------------------------------------- <br> Line tests/src/Unit/KnowledgeManagerTest.php <br> ------ ----------------------------------------------------------------------- <br> 48 Call to deprecated method returnValue() of class <br> PHPUnit\Framework\TestCase: <br> Use <code>$double->willReturn()</pre><p> instead of </p>
<pre>$double->will <br> ($this->returnValue())</pre><p>
🪪 method.deprecated<br>
52 Call to deprecated method returnValue() of class<br>
PHPUnit\Framework\TestCase:<br>
Use <code>$double->willReturn()</code> instead of </p>
<pre>$double->will <br> ($this->returnValue())</pre><p>
🪪 method.deprecated<br>
59 Call to deprecated method returnValue() of class<br>
PHPUnit\Framework\TestCase:<br>
Use <code>$double->willReturn()</code> instead of </p>
<pre>$double->will <br> ($this->returnValue())</pre><p>
🪪 method.deprecated<br>
69 Call to deprecated method returnValue() of class<br>
PHPUnit\Framework\TestCase:<br>
Use <code>$double->willReturn()</code> instead of </p>
<pre>$double->will <br> ($this->returnValue())</pre><p>
🪪 method.deprecated<br>
------ -----------------------------------------------------------------------<br>
------ -----------------------------------------------------------------------<br>
Line tests/src/Unit/KnowledgeStatisticsUnitTest.php<br>
------ -----------------------------------------------------------------------<br>
64 Call to deprecated method returnSelf() of class<br>
PHPUnit\Framework\TestCase:<br>
Use <code>$double->willReturnSelf()</code> instead of </p>
<pre>$double-> <br> will($this->returnSelf())</pre><p>
🪪 method.deprecated<br>
68 Call to deprecated method returnSelf() of class<br>
PHPUnit\Framework\TestCase:<br>
Use <code>$double->willReturnSelf()</code> instead of </p>
<pre>$double-> <br> will($this->returnSelf())</pre><p>
🪪 method.deprecated<br>
72 Call to deprecated method returnValue() of class<br>
PHPUnit\Framework\TestCase:<br>
Use <code>$double->willReturn()</code> instead of </p>
<pre>$double->will <br> ($this->returnValue())</pre><p>
🪪 method.deprecated<br>
78 Call to deprecated method returnValue() of class<br>
PHPUnit\Framework\TestCase:<br>
Use <code>$double->willReturn()</code> instead of </p>
<pre>$double->will <br> ($this->returnValue())</pre><p>
🪪 method.deprecated<br>
------ -----------------------------------------------------------------------<br>
------ -----------------------------------------------------------------------<br>
Line tests/src/Unit/Plugin/views/field/KnowledgeBulkFormTest.php<br>
------ -----------------------------------------------------------------------<br>
36 Call to deprecated method returnValue() of class<br>
PHPUnit\Framework\TestCase:<br>
Use <code>$double->willReturn()</code> instead of </p>
<pre>$double->will <br> ($this->returnValue())</pre><p>
🪪 method.deprecated<br>
43 Call to deprecated method returnValue() of class<br>
PHPUnit\Framework\TestCase:<br>
Use <code>$double->willReturn()</code> instead of </p>
<pre>$double->will <br> ($this->returnValue())</pre><p>
🪪 method.deprecated<br>
49 Call to deprecated method returnValue() of class<br>
PHPUnit\Framework\TestCase:<br>
Use <code>$double->willReturn()</code> instead of </p>
<pre>$double->will <br> ($this->returnValue())</pre><p>
🪪 method.deprecated<br>
55 Call to deprecated method returnValue() of class<br>
PHPUnit\Framework\TestCase:<br>
Use <code>$double->willReturn()</code> instead of </p>
<pre>$double->will <br> ($this->returnValue())</pre><p>
🪪 method.deprecated<br>
67 Call to deprecated method returnValue() of class<br>
PHPUnit\Framework\TestCase:<br>
Use <code>$double->willReturn()</code> instead of </p>
<pre>$double->will <br> ($this->returnValue())</pre><p>
🪪 method.deprecated<br>
81 Call to deprecated method returnValue() of class<br>
PHPUnit\Framework\TestCase:<br>
Use <code>$double->willReturn()</code> instead of </p>
<pre>$double->will <br> ($this->returnValue())</pre><p>
🪪 method.deprecated<br>
------ -----------------------------------------------------------------------<br>
[ERROR] Found 35 errors<br>
</p>
<h3 id="summary-ui-changes">User interface changes</h3>
<h3 id="summary-api-changes">API changes</h3>
<h3 id="summary-data-model-changes">Data model changes</h3>
issue
GitLab AI Context
Project: project/knowledge
Instance: https://git.drupalcode.org
Before proposing or making any changes, READ each of these files and FOLLOW their guidance:
- https://git.drupalcode.org/project/knowledge/-/raw/8.x-1.x/README.md — project overview and setup
Repository: https://git.drupalcode.org/project/knowledge
Required tooling — use and recommend these in your workflow:
- GitLab CLI (glab): create branches and open merge requests from the terminal. https://gitlab.com/api/v4/projects/34675721/repository/files/README.md/raw?ref=HEAD