Problem/Motivation

ParagraphsBehaviorInterface::settingsIcon(), in its DocBlock, says this:

   * @return string[]
   *   The plugin settings.

However TestBoldTextBehavior::settingsIcon() contains this code:

     return [
        'bold' => [
          '#theme' => 'paragraphs_info_icon',
          '#message' => $this->t('Bold: Yes.'),
          '#icon' => 'bold',
        ],
      ];

This is not of type string[].

Proposed resolution

Document that settingsIcon should return an associative array, not an array of strings.

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork paragraphs-3534987

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

alberto56 created an issue. See original summary.

nickolaj’s picture

Status: Active » Needs review
StatusFileSize
new1.19 KB

Updated the `@return` docblocks for both methods to accurately reflect their return types:

- Changed `string[]` to `array[]` for both methods.
- Added detailed descriptions of the expected array structure.

alberto56’s picture

Status: Needs review » Reviewed & tested by the community

Looks good, thanks!

berdir made their first commit to this issue’s fork.

  • berdir committed f2c7a472 on 8.x-1.x authored by nickolaj
    fix: #3534987 ParagraphsBehaviorInterface::settingsIcon() claims to...
berdir’s picture

Status: Reviewed & tested by the community » Fixed

Merged, thanks.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.