Problem/Motivation

Fix

$ignoreErrors[] = [
	'message' => '#^Method Drupal\\\\Core\\\\Config\\\\TypedConfigManagerInterface\\:\\:get\\(\\) return type with generic interface Drupal\\\\Core\\\\TypedData\\\\TraversableTypedDataInterface does not specify its types\\: I, T$#',
	'identifier' => 'missingType.generics',
	'count' => 1,
	'path' => __DIR__ . '/lib/Drupal/Core/Config/TypedConfigManagerInterface.php',
];

and similar.

Proposed resolution

tbd

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3569674

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

mondrake created an issue. See original summary.

mondrake’s picture

Title: [PP] Fix remaining PHPStan missingType.generics errors » [PP] Fix remaining PHPStan missingType.generics errors (level 1)

mondrake’s picture

Title: [PP] Fix remaining PHPStan missingType.generics errors (level 1) » Fix remaining PHPStan missingType.generics errors (level 1)
Status: Postponed » Active
mondrake’s picture

Status: Active » Needs review
dcam’s picture

I'm seeing a lot of potential for using @phpstan-type to reduce repetition within and across classes. Is there a reason you decided to not use it in this MR? If it's to keep the changes simple I just want to say that I'm personally OK with doing it here.

mondrake’s picture

I'm seeing a lot of potential for using @phpstan-type to reduce repetition

I do as well, but every time I try to use it in an issue there's debate, and fact is that ATM there's not even one instance in core. See #3565560: Describe the requirements array as a PHPDoc type for instance, or #3532930: Make Drupal\Core\Database\Database type strict and PHPStan L10 compliant.

In this particular issue, frankly did not think about that. But it should be a separate issue from this, I guess.

smustgrave’s picture

@dcam any objections to a follow up?

dcam’s picture

Status: Needs review » Reviewed & tested by the community

No objection. I don't disagree with the point made in #7. I wish it weren't the case, but there's no reason to hold this up over it.

I'm certain that I reviewed all of the changes a couple of weeks ago and didn't find any problems. But I checked them all again today. Fortunately, they're mostly pretty easy to validate. The majority of the changes come directly from PHPStan templates in the referenced classes. Thus, comparison is pretty simple. I didn't find any problems. This looks good to me.

  • longwave committed 938b3f34 on main
    docs: #3569674 Fix remaining PHPStan missingType.generics errors (level...
longwave’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to main, thanks! Doesn't backport cleanly to 11.x due to baseline conflicts, not sure this is worth the effort - reopen if you disagree.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.