Key::setKeyValue can accept array, documented as only accepting string

Created on 21 October 2023, about 1 year ago
Updated 3 June 2024, 5 months ago

Problem/Motivation

This method can in fact accept arrays for use with multi-value keys.

When using PHPStan, the following error is produced:

Parameter #1 $key_value of method Drupal\key\Entity\Key::setKeyValue() expects string,
array given.

Steps to reproduce

Run PHPStan on a codebase where $key->setKeyValue([...]) is invoked

Proposed resolution

Update doc to accept array and string, not just string.

Remaining tasks

Update docs

User interface changes

Nil

API changes

Nil

Data model changes

Nil

๐Ÿ“Œ Task
Status

Needs review

Version

1.0

Component

Documentation

Created by

๐Ÿ‡ฆ๐Ÿ‡บAustralia dpi Perth, Australia

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024