Problem/Motivation

Follow-up to #3178534: Start running PHPStan on Drupal core (level 0). We want all of the Drupal core to be checked against PHPStan level 0.

Proposed resolution

Try to fix as many level 0 problems as possible in this issue.

Remaining tasks

Run phpstan level 0 on core and create a merge request to address problems.

Issue fork drupal-3190393

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

klausi created an issue. See original summary.

klausi’s picture

I made the mistake of statically defining the ->original property on the entity base class and all hell broke lose. I think that happens we have a lot of magic __get() going on in the entity API that we need for dynamic fields, so I made an exception to ignore that in PHPStan.

daffie’s picture

Title: Fix the rest of PHPStan level 0 errors » Start running PHPStan on Drupal core (level 0 - part 2)
Parent issue: #3178534: Start running PHPStan on Drupal core (level 0) » #3190585: [META] Run PHPStan on Drupal core
tstoeckler’s picture

Re #3: Good choice, that is a whole can of worms by itself... ;-) but at least we have an issue for that already, so linking that from here.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

mondrake’s picture

Issue tags: +PHPStan-0

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

longwave’s picture

Status: Postponed » Closed (duplicate)

#3178534: Start running PHPStan on Drupal core (level 0) was committed so closing this as duplicate as I don't think there's anything to action directly here.