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
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
Comment #3
mstrelan commentedComment #5
smustgrave commentedNot sure a good way to test this one. Will it always be that structure or does it depend?
Comment #6
mstrelan commentedI 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.
Comment #7
smustgrave commentedThanks for that. Makes sense going to mark for you