Fix PHPStan L1 errors "Function Drupal\Core\Executable\ExecutableInterface::execute() invoked with 1 parameter, 0 required." in ActionBase

Created on 23 October 2023, 8 months ago
Updated 16 November 2023, 8 months ago

Problem/Motivation

Split off from πŸ“Œ Fix PHPStan L1 errors "Function \Foo\Bar\baz invoked with X parameters, 0 required." Fixed as requested by @catch.

This looks like a bc break? Could we move it to its own issue maybe?

To me, the problems seems to be that execute() in the \Drupal\Core\Executable\ExecutableInterface works well for the Conditions working with it, but not so much with the Actions.

The latter all (except \Drupal\Core\Action\Plugin\Action\GotoAction) require an Entity to perform the Action on.

This leads to all the Actions now doing stuff like public function execute($object = NULL) to both fulfil the contract for the ExecutableInterface and have an Entity as parameter.

Steps to reproduce

Proposed resolution

- Stop extending ExecutableInterface from \Drupal\Core\Action\ActionInterface.
- Introduce a public function execute(EntityInterface $entity): void in ActionInterface.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Needs work

Version

11.0 πŸ”₯

Component
BaseΒ  β†’

Last updated less than a minute ago

Created by

πŸ‡³πŸ‡±Netherlands Spokje

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024