[policy] Remove DI verbosity by removing unnecessary doc lines

Created on 3 March 2014, over 10 years ago
Updated 16 July 2024, about 2 months ago

Spin off from #2134513-55: [policy, no patch] Trait strategy β†’ . Since that issue is only making traits for a small subset of controller dependencies, we'll still be left with constructor injection of some dependencies in many controllers. As pointed out in that comment, a separate PHPDoc for each protected variable plus each constructor parameter is both redundant, and also unnecessary entirely given proper type hints, variable names, and an IDE that's capable of autocompleting on static code analysis (e.g., PhpStorm).

Proposal: combine declaration of DI property variables, __construct(), and create() into a single section of code, with only a single, minimal, PHPDoc for the entire combination.

Goal: to reduce the verbosity of implementing DI within controllers, so that it's less intimidating, and distracts less from the actual logic of the controller.

πŸ“Œ Task
Status

Closed: duplicate

Component

Coding Standards

Created by

πŸ‡ΊπŸ‡ΈUnited States effulgentsia

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

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