[PP-2] Remove Implements comments once the api can pickup hook implementations from classes.

Created on 26 October 2024, 3 months ago

Problem/Motivation

✨ Support for OO hooks implementations in classes Postponed
πŸ“Œ [PP-1] Determine how to implement Form Alters with attributes. Active
Probably a third issue here to update rules to allow no comments if the attribute is for hooks.

Once the two above land we can remove the redundant Implements Hook since it's in the attribute.

Steps to reproduce

N/A

Proposed resolution

Remove them

Remaining tasks

Remove them

User interface changes

N/A

Introduced terminology

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component

documentation

Created by

πŸ‡ΊπŸ‡ΈUnited States nicxvan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @nicxvan
  • πŸ‡ΊπŸ‡ΈUnited States nicxvan
  • πŸ‡¨πŸ‡­Switzerland berdir Switzerland

    I would assume that api module can't properly pick up #Hook methods, whether or not they have the Implements docblock, so I'd assume that's not really a blocker, it's already broken without that change.

    What I think is a blocker of this is a coding standards issue to change the requirement around this. We need to change this bit: https://www.drupal.org/docs/develop/standards/php/api-documentation-and-... β†’ .

    That means we need an issue in this project: https://www.drupal.org/project/coding_standards β†’ . See 🌱 Allow constructor methods to omit docblocks Fixed for the example that changed the requirements around constructor params.

  • πŸ‡¨πŸ‡¦Canada Charlie ChX Negyesi 🍁Canada

    > I would assume that api module can't properly pick up #Hook methods

    A proof of concept for that already exists but we decided it's better to properly support attributes and then special case from there. Attribute support branch is up at [#344963], we need a test, I will write one when I get to it.

    I'd like to get #Hook api support out by the time D11.1 lands. We will see whether time permits.

  • πŸ‡¨πŸ‡­Switzerland berdir Switzerland

    That was maybe a bit unclear, let me expand: "I assume that API module currently out of the box would not find class methods as hook implementations, whether or not there is a 'Implements hook_foo()' docblock and therefore having or not having those docblocks is not relevant or api.module. It needs adjustments to find those and these adjustments will not look at the comment string anymore.".

Production build 0.71.5 2024