Generated with the help of an LLM.

I asked an LLM to find easy to resolve issues added to the phpstan baseline, since we bumped to level 3. I then refined the fix and wrote this issue summary.

Problem/Motivation

There are 130 "Access to an undefined property ArrayObject" violations in the baseline. These are all due to loose typehints for \Drupal\Tests\field\Kernel\FieldKernelTestBase::$fieldTestData.

Steps to reproduce

List baseline entries:
grep -F 'Access to an undefined property ArrayObject' core/.phpstan-baseline.php

Sum them:
grep -F -A2 'Access to an undefined property ArrayObject' core/.phpstan-baseline.php | awk -F"=> " '/count/ {gsub(/,/,"",$2); s+=$2} END {print s}'

Proposed resolution

Document the expected keys / types for this property.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3634932

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.

mstrelan’s picture

Status: Active » Needs review
Issue tags: +PHPStan, +PHPStan-3

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

smustgrave’s picture

Not sure a good way to test this one. Will it always be that structure or does it depend?

mstrelan’s picture

I guess the proof is in the phpstan baseline reduction and green run. This covers everything in core.

For contrib, if they are running at a lower level this won't make a difference, if a higher level they will already have been seeing this problem.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for that. Makes sense going to mark for you