Modernize services for Workbench Access

Created on 19 September 2024, 3 months ago

Problem/Motivation

Similar to Modernize services: Add autowiring aliases, use autoconfigure, etc Fixed .

This is a quick issue to modernize services, a housekeeping issue.

The attached MR:

  • Clean up services.yml and use modern features
  • Adds autowiring aliases
  • Use autowire for our dependencies
  • Bumps core dep to the current minimum supported version of core, D10.2
  • Finalises constructors.
  • Cleans up constructor docblocks, removes a slew of properties in favor of constructor property promotion; makes them readonly.
  • Role and User reference eachother, so to prevent circular references, switched to service closures. Before this change, the services were accessed via \Drupal::service.
  • Updated todos and static calls to services to use injection.
  • Removed a few service dependencies that wern't actually used.
  • Updated relevant tests
  • Added optional token dependency, no tests by the look of it now, but may at least help if stan level is increased.
  • Added a phpstan baseline (as opposed to a ignoreError), see https://github.com/mglaman/phpstan-drupal/issues/598
  • Adding typehints to service docs.

This is a backwards incompatible change for anyone extending the existing services. I imagine it would be rare however. Consider a new minor version.

Anyone that needs to extend WBA services can continue to do so via service decoration, service container `calls`, etc.

📌 Task
Status

Needs review

Version

2.0

Component

Code

Created by

🇦🇺Australia dpi Perth, Australia

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

Merge Requests

Comments & Activities

  • Issue created by @dpi
  • Merge request !22Resolve #3475418 "Wba modernize services" → (Open) created by dpi
  • Pipeline finished with Failed
    3 months ago
    Total: 437s
    #286754
  • Pipeline finished with Failed
    3 months ago
    Total: 384s
    #286764
  • Pipeline finished with Failed
    3 months ago
    Total: 454s
    #286769
  • Pipeline finished with Failed
    3 months ago
    Total: 272s
    #286774
  • Pipeline finished with Failed
    3 months ago
    Total: 657s
    #286782
  • Pipeline finished with Failed
    3 months ago
    Total: 296s
    #287216
  • Pipeline finished with Success
    3 months ago
    Total: 282s
    #287224
  • Pipeline finished with Success
    3 months ago
    Total: 252s
    #287240
  • 🇦🇺Australia dpi Perth, Australia
  • Issue was unassigned.
  • Status changed to Needs review 3 months ago
  • 🇦🇺Australia dpi Perth, Australia
  • 🇦🇺Australia dpi Perth, Australia
  • Pipeline finished with Success
    3 months ago
    Total: 1203s
    #287426
Production build 0.71.5 2024