Comments in empty arrays are lost

Created on 18 April 2021, almost 4 years ago
Updated 5 July 2024, 9 months ago

Problem/Motivation

The class documentation comment in core/lib/Drupal/Core/Config/Entity/ConfigDependencyManager.php contains the following lines.

 * @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

On ConfigDependencyManager. that array is rendered differently: The comments inside arrays that just contain comments are stripped. Furthermore, a line is not indented correctly, despite it is correctly indented in the source code.

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 .

🐛 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