Problem/Motivation

Amongst the current suppressions found in the PHPStan level 1 baseline is: Function \Foo\Bar\baz invoked with X parameters, 0 required..

This issue exists to fix all of those.

Steps to reproduce

- Run PHPStan on level 1 and see the above issue amongst all others.

Proposed resolution

- Solve all of the reported issues for the above mentioned.
NOTE: There is one suppression that is deemed worthy of a separate issue (#3396002: Fix PHPStan L1 errors "Function Drupal\Core\Executable\ExecutableInterface::execute() invoked with 1 parameter, 0 required." in ActionBase), so this is the only remaining suppression in this MR:

			message: "#^Method Drupal\\\\Core\\\\Executable\\\\ExecutableInterface\\:\\:execute\\(\\) invoked with 1 parameter, 0 required\\.$#"
			count: 1
			path: lib/Drupal/Core/Action/ActionBase.php

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3359001

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

Spokje created an issue. See original summary.

spokje’s picture

Status: Active » Needs review
smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative

Applied the MR and think I found 1 more instance

		-
			message: "#^Method Drupal\\\\Core\\\\Executable\\\\ExecutableInterface\\:\\:execute\\(\\) invoked with 1 parameter, 0 required\\.$#"
			count: 1
			path: lib/Drupal/Core/Action/ActionBase.php
spokje’s picture

Thanks @smustgrave, I somehow genuinely missed the hardest one.

spokje’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Looks good!

catch’s picture

Status: Reviewed & tested by the community » Needs work

One comment on the MR.

Version: 10.1.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, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

spokje’s picture

Issue summary: View changes
spokje’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Seems feedback has been addressed.

  • longwave committed 55eecad1 on 10.2.x
    Issue #3359001 by Spokje, smustgrave, catch: Fix PHPStan L1 errors "...

  • longwave committed 6fd51ee8 on 11.x
    Issue #3359001 by Spokje, smustgrave, catch: Fix PHPStan L1 errors "...
longwave’s picture

Version: 11.x-dev » 10.2.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed to 11.x and 10.2.x, thanks!

Did not cleanly backport to 10.1.x, not sure it is worth the effort.

Status: Fixed » Closed (fixed)

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