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
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:
- 11.x
compare
- 3359001-11.x
changes, plain diff MR !5096
- 3359001-fix-phpstan-l1
changes, plain diff MR !3957
Comments
Comment #3
spokjeComment #4
smustgrave commentedApplied the MR and think I found 1 more instance
Comment #5
spokjeThanks @smustgrave, I somehow genuinely missed the hardest one.
Comment #6
spokjeComment #7
smustgrave commentedLooks good!
Comment #8
catchOne comment on the MR.
Comment #12
spokjeCreated #3396002: Fix PHPStan L1 errors "Function Drupal\Core\Executable\ExecutableInterface::execute() invoked with 1 parameter, 0 required." in ActionBase and removed it from this issue.
Comment #13
spokjeComment #14
spokjeComment #15
smustgrave commentedSeems feedback has been addressed.
Comment #18
longwaveCommitted 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.