Make WordPress Core


Ignore:
Timestamp:
08/03/2023 07:50:20 PM (22 months ago)
Author:
hellofromTonya
Message:

Code Modernization: Use "declare" in WP_List_Table magic methods deprecation message

Changes "define" to "declare" in the deprecation message in WP_List_Table magic methods.

Why is "declare" better?
It aligns well to:

  • the topic of and published information about dynamic properties.
  • the act of explicitly listing the variable as a property on the class.

The goal of this message is guide developers to change their code. Changing the term to "declare" hopefully will aid in the understanding of what is being asked of developers when this deprecation is thrown.

Follow-up [56349].

Props hellofromTonya, antonvlasenko.
Fixes #58896.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-list-table.php

    r56349 r56356  
    188188
    189189        trigger_error(
    190             "The property `{$name}` is not defined. Getting a dynamic (undefined) property is " .
    191             'deprecated since version 6.4.0! Instead, define the property on the class.',
     190            "The property `{$name}` is not declared. Getting a dynamic property is " .
     191            'deprecated since version 6.4.0! Instead, declare the property on the class.',
    192192            E_USER_DEPRECATED
    193193        );
     
    211211
    212212        trigger_error(
    213             "The property `{$name}` is not defined. Setting a dynamic (undefined) property is " .
    214             'deprecated since version 6.4.0! Instead, define the property on the class.',
     213            "The property `{$name}` is not declared. Setting a dynamic property is " .
     214            'deprecated since version 6.4.0! Instead, declare the property on the class.',
    215215            E_USER_DEPRECATED
    216216        );
     
    232232
    233233        trigger_error(
    234             "The property `{$name}` is not defined. Checking `isset()` on a dynamic (undefined) property " .
    235             'is deprecated since version 6.4.0! Instead, define the property on the class.',
     234            "The property `{$name}` is not declared. Checking `isset()` on a dynamic property " .
     235            'is deprecated since version 6.4.0! Instead, declare the property on the class.',
    236236            E_USER_DEPRECATED
    237237        );
     
    254254
    255255        trigger_error(
    256             "A property `{$name}` is not defined. Unsetting a dynamic (undefined) property is " .
    257             'deprecated since version 6.4.0! Instead, define the property on the class.',
     256            "A property `{$name}` is not declared. Unsetting a dynamic property is " .
     257            'deprecated since version 6.4.0! Instead, declare the property on the class.',
    258258            E_USER_DEPRECATED
    259259        );
Note: See TracChangeset for help on using the changeset viewer.