Wrong amount of asterisks in a class docblock renders annotations useless without even a warning

Created on 7 January 2017, almost 8 years ago
Updated 24 July 2024, 3 months ago

Problem/Motivation

Let's look at the following plugin:

/*
 * Defines a fallback plugin for missing block plugins.
 *
 * @Block(
 *   id = "broken",
 *   admin_label = @Translation("Broken/Missing"),
 *   category = @Translation("Block"),
 * )
 */
class Broken extends BlockBase {

Where is the problem? Its hard to spot ... ... Its a missing asterics on the first line.

Proposed resolution

Somehow protect against this stupid but insane hard to debug problem.

One approach could be to add some check in \Drupal\Component\Annotation\Plugin\Discovery\AnnotatedClassDiscovery::getDefinitions

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Closed: outdated

Version

11.0 🔥

Component
Other 

Last updated about 11 hours ago

Created by

🇩🇪Germany dawehner

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