Example TaxonomyBuildNodeIndexFixer::loadNodeWithId() should return Node

Created on 8 September 2025, 6 days ago

Problem/Motivation

The example modules/scanner_fixer_api_example/src/Plugin/ScannerFixer/Fixer/TaxonomyBuildNodeIndexFixer.php's loadNodeWithId function currently has the signature protected function loadNodeWithId(int|string $nid): ?\Drupal\node\NodeInterface

But \taxonomy_build_node_index()'s docblock (called in performFix()) only accepts \Drupal\node\Entity\Node.

(note this issue shows up at phpstan level 5: Parameter #1 $node of function taxonomy_build_node_index expects Drupal\node\Entity\Node, Drupal\node\NodeInterface|null given.)

Proposed resolution

Change to have the signature protected function loadNodeWithId(int|string $nid): ?\Drupal\node\Entity\Node

Remaining tasks

  1. Write a patch
  2. Review and feedback
  3. RTBC and feedback
  4. Commit
  5. Release

User interface changes

None.

API changes

None.

Data model changes

None.

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇨🇦Canada mparker17 UTC-4

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024