Spin off of #3274474: Fix 'Access to an undefined property' PHPStan L0 errors.

Problem/Motivation

PHPStan baseline is currently skipping multiple Access to an undefined property errors.

Proposed resolution

Fix the errors, clean up the baseline. In this issue, focus on runtime code public properties.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3295157

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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mondrake created an issue. See original summary.

mondrake’s picture

Issue summary: View changes
Status: Active » Needs review
mondrake’s picture

Status: Needs review » Reviewed & tested by the community

I am RTBCing this because this is just a spin off of the parent that was RTBC already.

mondrake’s picture

Assigned: mondrake » Unassigned
andypost’s picture

Not sure about returning $info array to extension class which was just removed and ongoing work happening to fix it with getters/setters #3292759: Create getters and setters for dynamic Extension properties

alexpott’s picture

$info has been a public property on the extension object for a very long time. This change is only documenting that fact. It's not been removed.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed f76cebd189 to 10.1.x and 7fe5869f20 to 10.0.x. Thanks!

  • alexpott committed f76cebd on 10.1.x
    Issue #3295157 by mondrake: Fix 'Access to an undefined property'...

  • alexpott committed 7fe5869 on 10.0.x
    Issue #3295157 by mondrake: Fix 'Access to an undefined property'...

Berdir’s picture

Missed this on my earlier review but this IMHO has some problematic parts.

This didn't just add new properties but also added types to existing properties by moving them to the base class, that broke the aggregator module:#3294389: Fix fails in HEAD and other modules could be affected as well in contrib. Isn't adding a type to existing properties a BC break? Especially in a base class.

Another strange part is that it defines the original property for _some_ entity types, but $entity->original is a generic entityconcept and this conflicts with #2839195: Add a method to access the original property which I finally resurrected. Sure, we need a BC layer for that anyway but that might complicate that and feels like a very half-baked solution with the only purpose of reducing the baseline.

Status: Fixed » Closed (fixed)

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

donquixote’s picture