Deprecated: Optional parameter $data before required parameter $webform

Created on 9 April 2024, 9 months ago
Updated 8 May 2024, 8 months ago

Problem/Motivation

We've been using Webform API Handler and have seen the following warning pop up in our installation:

PHP Deprecated:  Optional parameter $data declared before required parameter $webform is implicitly treated as a required parameter in /path/to/app/modules/contrib/webform_api_handler/src/Plugin/ResponsePluginBase.php on line 87

Note this applies to RequestPluginBase as well.

This is likely to become a problem on newer PHP versions (we're on 8.1).

Steps to reproduce

Set up a webform using Webform API Handler as a handler.

Proposed resolution

Reorder the parameters to $response, $webform, $data; adjust any calls to this method.

Remaining tasks

Implement the code changes.

User interface changes

None.

API changes

Reorder parameters as described above for both RequestPluginBase and ResponsePluginBase. This is a breaking change that will affect users that extend this module with custom plugins.

Data model changes

None.

📌 Task
Status

Needs review

Version

1.0

Component

Code

Created by

🇦🇺Australia geoffreyr

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024