Comments in empty arrays are lost

Created on 18 April 2021, over 4 years ago
Updated 4 July 2024, about 1 year ago

Problem/Motivation

The class documentation block for ConfigDependencyManager includes

 * @code
 * array(
 *   'config' => array(
 *     // An array of configuration entity object names. Recalculated on save.
 *   ),
 *   'content' => array(
 *     // An array of content entity configuration dependency names. The default
 *     // format is "ENTITY_TYPE_ID:BUNDLE:UUID". Recalculated on save.
 *   ),
 *   'module' => array(
 *     // An array of module names. Recalculated on save.
 *   ),
 *   'theme' => array(
 *     // An array of theme names. Recalculated on save.
 *   ),
 *   'enforced' => array(
 *     // An array of configuration dependencies that the config entity is
 *     // ensured to have regardless of the details of the configuration. These
 *     // dependencies are not recalculated on save.
 *     'config' => array(),
 *     'content' => array(),
 *     'module' => array(),
 *     'theme' => array(),
 *   ),
 * );
 * @endcode

but this is rendered on the ConfigDependencyManager API page as

array(
  'config' => array(),
  'content' => array(),
  'module' => array(),
  'theme' => array(),
  'enforced' => array(
    // An array of configuration dependencies that the config entity is
    // ensured to have regardless of the details of the configuration. These
    // dependencies are not recalculated on save.
    'config' => array(),
    'content' => array(),
    'module' => array(),
    'theme' => array(),
  ),
);

It looks as though comments inside otherwise empty arrays are stripped.

Steps to reproduce

Compare the code in core/lib/Drupal/Core/Config/Entity/ConfigDependencyManager.php, specifically the part in the @code block near the top, to the API docs.

Proposed resolution

I suggested a work-around in 🐛 Fix API docs for ConfigDependencyManager Needs work .

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

2.0

Component

Parser

Created by

🇺🇸United States benjifisher Boston area

Live updates comments and jobs are added and updated live.
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