Make WordPress Core

Changeset 56544


Ignore:
Timestamp:
09/07/2023 08:46:53 PM (9 months ago)
Author:
hellofromTonya
Message:

Code Modernization: Use wp_trigger_error() in WP_Text_Diff_Renderer_Table magic methods.

Replaces trigger_error() with wp_trigger_error() in each of the WP_Text_Diff_Renderer_Table magic methods.

[56354] added the dynamic properties deprecation messages to the __get(), __set(), __isset(), __unset() magic methods. Since that commit, wp_trigger_error() was introduced (see [56530]) as a wrapper for trigger_error().

Follow-up to [56354], [56530].

See #58898, #57686.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-text-diff-renderer-table.php

    r56354 r56544  
    522522        }
    523523
    524         trigger_error(
     524        wp_trigger_error(
     525            __METHOD__,
    525526            "The property `{$name}` is not declared. Getting a dynamic property is " .
    526527            'deprecated since version 6.4.0! Instead, declare the property on the class.',
     
    545546        }
    546547
    547         trigger_error(
     548        wp_trigger_error(
     549            __METHOD__,
    548550            "The property `{$name}` is not declared. Setting a dynamic property is " .
    549551            'deprecated since version 6.4.0! Instead, declare the property on the class.',
     
    566568        }
    567569
    568         trigger_error(
     570        wp_trigger_error(
     571            __METHOD__,
    569572            "The property `{$name}` is not declared. Checking `isset()` on a dynamic property " .
    570573            'is deprecated since version 6.4.0! Instead, declare the property on the class.',
     
    588591        }
    589592
    590         trigger_error(
     593        wp_trigger_error(
     594            __METHOD__,
    591595            "A property `{$name}` is not declared. Unsetting a dynamic property is " .
    592596            'deprecated since version 6.4.0! Instead, declare the property on the class.',
  • trunk/tests/phpunit/tests/diff/wpTextDiffRendererTable.php

    r56354 r56544  
    4444        $this->expectDeprecation();
    4545        $this->expectDeprecationMessage(
     46            'WP_Text_Diff_Renderer_Table::__get(): ' .
    4647            'The property `undeclared_property` is not declared. Getting a dynamic property is ' .
    4748            'deprecated since version 6.4.0! Instead, declare the property on the class.'
     
    7374        $this->expectDeprecation();
    7475        $this->expectDeprecationMessage(
     76            'WP_Text_Diff_Renderer_Table::__set(): ' .
    7577            'The property `undeclared_property` is not declared. Setting a dynamic property is ' .
    7678            'deprecated since version 6.4.0! Instead, declare the property on the class.'
     
    105107        $this->expectDeprecation();
    106108        $this->expectDeprecationMessage(
     109            'WP_Text_Diff_Renderer_Table::__isset(): ' .
    107110            'The property `undeclared_property` is not declared. Checking `isset()` on a dynamic property ' .
    108111            'is deprecated since version 6.4.0! Instead, declare the property on the class.'
     
    132135        $this->expectDeprecation();
    133136        $this->expectDeprecationMessage(
     137            'WP_Text_Diff_Renderer_Table::__unset(): ' .
    134138            'A property `undeclared_property` is not declared. Unsetting a dynamic property is ' .
    135139            'deprecated since version 6.4.0! Instead, declare the property on the class.'
Note: See TracChangeset for help on using the changeset viewer.