Problem/Motivation

As per #3404246: [META] Fix strict type errors detected by phpstan

We've fixed quite a few issues in the meta, and there are a few more ready to go, but there are still a few hundred violations. This issue is to eventually add the parameter and commit the baseline, when we're comfortable.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3570870

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

mstrelan created an issue. See original summary.

mondrake’s picture

Assigned: Unassigned » mondrake

on this

mondrake’s picture

Assigned: mondrake » Unassigned
Status: Active » Needs review
mstrelan’s picture

Status: Needs review » Needs work

I think it needs a rebase. I generated the baseline from main then compared with this branch and found one additional entry that I think is no longer required since #3555534: Since symfony/validator 7.4: Support for evaluating options in the base Constraint class is deprecated. Initialize properties in the constructor instead.

+++ b/core/.phpstan-baseline.php
@@ -6253,6 +6253,12 @@
        'count' => 1,
        'path' => __DIR__ . '/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php',
 ];
+$ignoreErrors[] = [
+       'message' => '#^Parameter \\#2 \\$options of method Drupal\\\\Core\\\\TypedData\\\\DataDefinition\\:\\:addConstraint\\(\\) expects array\\|null, string given\\.$#',
+       'identifier' => 'argument.type',
+       'count' => 1,
+       'path' => __DIR__ . '/lib/Drupal/Core/Entity/TypedData/EntityDataDefinition.php',
+];
 $ignoreErrors[] = [
        'message' => '#^Method Drupal\\\\Core\\\\EventSubscriber\\\\ActiveLinkResponseFilter\\:\\:onResponse\\(\\) has no return type specified\\.$#',
        'identifier' => 'missingType.return',
mondrake’s picture

Status: Needs work » Needs review

Rebased - this will need frequent reroll.

smustgrave made their first commit to this issue’s fork.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

If it helps capture stuff in the future all for it.

smustgrave’s picture

Status: Reviewed & tested by the community » Needs review

Think I jumped the gun

smustgrave’s picture

Status: Needs review » Needs work

Appears to need a rebase but is this ready to merge or does the parent need to land?

mstrelan’s picture

Let's finish up #3561385: Fix "expects FieldableEntityInterface" issues detected by phpstan then reroll this. Can see then if we want to work on more fixes before committing the baseline.

mstrelan’s picture

Status: Needs work » Needs review

Rerolled this. It was 446 errors when mondrake first submitted the MR. It's now down to 223, although some of them have multiple counts in the same file, so I'm not sure whether those were originally counted.

smustgrave’s picture

Status: Needs review » Needs work

Sorry for taking me a while to get to. @mstrelan mind rebasing one more time. If you ping me I'll review

mondrake’s picture

Status: Needs work » Needs review

rebased

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Thanks! Always bummer to see the baseline go up so much but gives people something to work on!

mondrake’s picture

Needs rebasing again...

mondrake’s picture

Status: Reviewed & tested by the community » Needs work
mstrelan’s picture

Status: Needs work » Reviewed & tested by the community

Merged in main as there were existing merge commits and regenerated the baseline. Setting back to RTBC.

  • godotislate committed c6a388b4 on main
    task: #3570870 Add checkFunctionArgumentTypes parameter to phpstan...
godotislate’s picture

Status: Reviewed & tested by the community » Fixed

Not sure this needs to go into 11.x, but even if it did, it'd need a separate MR. Moving this to fixed, but if someone feels strongly about 11.x and opens a new MR, can reopen.

Committed c6a388b and pushed to main. Thanks!

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.