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

Created on 23 October 2023, about 1 year ago
Updated 16 November 2023, about 1 year 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 about 3 hours 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.71.5 2024