Problem/Motivation

PHPStan currently flags 1 parameter.unresolvableType errors acros Drupal core.

$ignoreErrors[] = [
	'message' => '#^PHPDoc tag @param for parameter \\$modules contains unresolvable type\\.$#',
	'identifier' => 'parameter.unresolvableType',
	'count' => 1,
	'path' => __DIR__ . '/tests/Drupal/Tests/Core/Extension/ModuleHandlerTest.php',
];

Proposed resolution

The error points to an incorrect phpdoc type. Fix it.

Issue fork drupal-3642781

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mallezie created an issue. See original summary.

mallezie’s picture

Status: Active » Needs review

Issue is very straightforward.
Fixes a phpdoc type.

-  *@param list<string, string> $modules
+  * @param array<string, string> $modules

And removes that error from the baseline.

mstrelan’s picture

This feels a bit small for its own issue. I opened #3612127: Fix long tail of baselined errors by type for the long tail back when we were on level 1, and there are a fair few more now. Combining them can make review harder, though, since each fix is usually quite different. A middle ground would be to group this with varTag.misplaced (3) and varTag.trait (1). They're also docblock-only fixes (@var used where @param was meant, and a @var naming a trait), so the MR stays easy to review.

mallezie’s picture

Status: Needs review » Needs work