AnnotatedClassDiscovery::getPluginNamespaces() description is inaccurate and unclear.

Created on 18 May 2023, over 1 year ago
Updated 25 October 2023, about 1 year ago

Problem/Motivation

AnnotatedClassDiscovery::getPluginNamespaces() description is inaccurate and unclear.

   * Gets an array of PSR-4 namespaces to search for plugin classes.
   *
   * @return string[]

But the caller does this:

    foreach ($this->getPluginNamespaces() as $namespace => $dirs) {

Documentation states "Returns an array of PSR-4 namespaces."

In reality, it returns an associative array with:
Keys representing namespaces.
Values representing directories.

$namespace variable in the loop stores each namespace key.
$dirs variable in the loop stores the associated directory for each namespace.

Steps to reproduce

Proposed resolution

Remaining tasks

19.2 Wrap to 80 characters

User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
Documentation 

Last updated 1 day ago

No maintainer
Created by

🇬🇧United Kingdom joachim

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

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