\Drupal calls should be avoided in classes, use dependency injection instead

Created on 16 October 2024, 6 months ago

Problem/Motivation

We are still using the \Drupal::XYZ() facades in some of our classes. We should use dependency injection instead.

Steps to reproduce

Check the latest PHPStan pipeline for the 3.0.x branch (https://git.drupalcode.org/project/recurring_events/-/pipelines?page=1&s...) and search for "\Drupal calls should be avoided in classes".

Proposed resolution

Use dependency injection.

Remaining tasks

Affected classes:

  • ConsecutiveRecurringDateWidget
  • EventInstanceDeleteForm
  • EventInstanceRevisionRevertForm
  • EventInstanceRevisionRevertTranslationForm
  • EventSeriesDeleteForm
  • EventSeriesRevisionRevertForm
  • EventSeriesTypeDeleteForm
  • GroupEventInstanceHandler
  • GroupEventSeries
  • MonthlyRecurringDateWidget
  • RecurringEventsFullCalendarProcessor
  • RegistrantAccessControlHandler
  • WeeklyRecurringDateWidget

API changes

Class constructors might change. This should be done in the 3.x branch.

📌 Task
Status

Active

Version

3.0

Component

Recurring Events (Main module)

Created by

🇧🇬Bulgaria pfrenssen Sofia

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024