Update class deprecations to implement "Concrete, instantiated classes" policy

Created on 23 January 2023, over 2 years ago

Problem/Motivation

This is a followup to πŸ“Œ [policy, then docs] Change how we deprecate classes Fixed .

The deprecation policy for classes β†’ now include a specific policy for concrete classes β†’ . All existing class deprecations in core need to be updated to the new policy.

This may not find all of the ones that need to change, but it is a start.
git grep "@trigger_error(" | grep NAMESPACE | awk -F: '{print $1}' | sort -u | nl

Steps to reproduce

Proposed resolution

Convert existing class deprecations to use the new policy.

Remaining tasks

Patch
Review
Commit

User interface changes

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Active

Version

10.1 ✨

Component
OtherΒ  β†’

Last updated about 11 hours ago

Created by

πŸ‡³πŸ‡ΏNew Zealand quietone

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

Merge Requests

Comments & Activities

  • Issue created by @quietone
  • πŸ‡³πŸ‡±Netherlands spokje
  • First commit to issue fork.
  • Merge request !4272updated deprecation policy β†’ (Open) created by lucienchalom
  • last update almost 2 years ago
    29,559 pass
  • Status changed to Needs review almost 2 years ago
  • πŸ‡§πŸ‡·Brazil lucienchalom

    I moved the deprecation error triger in classes:
    3 core/lib/Drupal/Core/Asset/JsCollectionOptimizer.php
    2 core/lib/Drupal/Core/Asset/CssCollectionOptimizer.php

    and deleted the redundant trigger from
    4 core/lib/Drupal/Core/Http/RequestStack.php

    I am not really sure how to proceed with
    5 core/modules/system/tests/modules/deprecation_test/src/Deprecation/DrupalStandardsListenerDeprecatedClass.php
    6 core/modules/system/tests/modules/deprecation_test/src/Deprecation/FixtureDeprecatedClass.php
    because they are "arbitrarily deprecated in order to test the deprecation error handling properties of DrupalStandardsListener."

    and
    1 core/lib/Drupal/Component/Plugin/PluginHelper.php
    does not accept a contruct.

    I tried to look for other classes deprecated but could not find any concrete, instantiated classes.

    please help and review

  • Status changed to RTBC almost 2 years ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    I think this is good but not sure the policy for moving existing deprecation triggers.

  • last update almost 2 years ago
    29,567 pass
  • last update almost 2 years ago
    29,571 pass
  • last update almost 2 years ago
    29,801 pass
  • Status changed to Needs work almost 2 years ago
  • πŸ‡³πŸ‡ΏNew Zealand quietone

    @lucienchalom, thanks for working on this! This is a good start. For PluginHelper and RequestStack add a constructor (stated in policy) and then the test will need to be changed to instantiate the class. And the same for the test modules because we should be using the standard set in policy and well as testing that.

    @smustgrave, There is no policy for moving deprecations. There is a policy for concrete classes and core needs to change to met the current standard.

    The issue summary has a sample grep to find the instances that need to be changed. Has anyone worked to improve on that or verify that it is accurate?

  • Status changed to Active 2 days ago
  • πŸ‡³πŸ‡ΏNew Zealand quietone

    Rebased and updated the issue summary.

    I think that this is suitable as a novice level issue.

Production build 0.71.5 2024