Problem/Motivation

PHPStan baseline is currently skipping multiple Call to an undefined method errors.

Steps to reproduce

grep "// identifier: method.notFound" core/.phpstan-baseline.php

Proposed resolution

Fix the errors, clean up the baseline.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3291519

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

mondrake created an issue. See original summary.

mondrake’s picture

mondrake’s picture

Assigned: mondrake » Unassigned
mondrake’s picture

Status: Active » Needs review
longwave’s picture

Status: Needs review » Needs work

A lot of methods that really should have been declared abstract - is there a clean way we can do this, if not now then in the next major?

mondrake’s picture

Thanks @longwave, replied to a couple of your inline comments.

In general yes, many of these methods would have had to be declared abstract, but doing that now without breaking BC is impossible I think. We could explore alternatives, but each case would deserve its own issue IMHO.

Can I suggest we agree on keeping in the baseline and leaving untouched those items that require so? and with this issue just move on with the unquestionable ones?

mondrake’s picture

Status: Needs work » Needs review
mondrake’s picture

rebased

mondrake’s picture

rebased

mondrake’s picture

Title: Fix 'Call to an undefined method' PHPStan L0 errors » [Meta] Fix 'Call to an undefined method' PHPStan L0 errors
Status: Needs review » Active

I'm afraid this will never go on as a megapatch. Let's convert to meta for smaller scoped issues.

mondrake’s picture

Update MR

Version: 10.0.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

mstrelan’s picture

Title: [Meta] Fix 'Call to an undefined method' PHPStan L0 errors » [Meta] Fix method.notFound PHPStan L0 errors
Issue summary: View changes

Updated title with identifier and added steps to reproduce. There are currently 14 remaining errors.

longwave’s picture

Title: [Meta] Fix method.notFound PHPStan L0 errors » Fix remaining method.notFound PHPStan L0 errors
Status: Active » Needs work

Removing the assertion around enabling class modules has uncovered tests that don't assert anything. Some of these are false positives (WebAsserts do not count as assertions) but it looks like we have two broken tests:

#3568285: ClaroMenuUiJavascriptTest does nothing
#3568287: JqueryUiLibraryAssetsTest::testSameAssetSameWeight() tests nothing

longwave’s picture

Oops didnt see the remaining open child issues, should just continue in there I guess.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.