ConfigProviderInterface::addConfigToCreate() @return annotation is wrong

Created on 23 May 2022, almost 3 years ago
Updated 25 April 2023, almost 2 years ago

Problem/Motivation

The PHPDoc @return annotation for the addConfigToCreate() method of the ConfigProviderInterface indicates that implementations should return "An array of configuration data read from the source storage keyed by the configuration object name." however when the addConfigToCreate() method of ConfigProvider Plugins is actually called, it is only used to manipulate the $config_to_create parameter which is passed by reference.
https://git.drupalcode.org/project/config_provider/-/blob/8.x-2.x/src/Co...

This is problematic when using static code analysis tools like phpstan because ConfigProvider Plugins will be expected to provide a return value in their addConfigToCreate() method implementations even though doing so is counter productive.

Proposed resolution

The PHPDoc @return annotation should be removed from the interface.

Remaining tasks

Create patch, review, commit.

User interface changes

None.

API changes

The ConfigProviderInterface::addConfigToCreate() method will properly document that implementations do not need to return anything.

Data model changes

None.

πŸ› Bug report
Status

Needs review

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States joegraduate Arizona, USA

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024