Make WordPress Core


Ignore:
Timestamp:
09/29/2022 06:03:42 PM (4 years ago)
Author:
davidbaumwald
Message:

Editor: Remove deprecated callable in WP_Style_Engine class.

Resolves a Use of "static" in callables is deprecated notice in = PHP 8.2 and mark WP_Style_Engine as a final class that will not be extended.

Follow-up to [54156].

Props ramonopoly, jrf, andrewserong.
See #56467.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/style-engine/class-wp-style-engine.php

    r54156 r54357  
    1515 * The Style Engine aims to provide a consistent API for rendering styling for blocks across both client-side and server-side applications.
    1616 *
     17 * This class is final and should not be extended.
    1718 * This class is for internal Core usage and is not supposed to be used by extenders (plugins and/or themes).
    1819 * This is a low-level API that may need to do breaking changes. Please, use wp_style_engine_get_styles instead.
    … …  
    2122 * @since 6.1.0
    2223 */
    23 class WP_Style_Engine {
     24final class WP_Style_Engine {
    2425        /**
    2526         * Style definitions that contain the instructions to
    … …  
    108109                        ),
    109110                        'top'    => array(
    110                                 'value_func' => 'static::get_individual_property_css_declarations',
     111                                'value_func' => array( self::class, 'get_individual_property_css_declarations' ),
    111112                                'path'       => array( 'border', 'top' ),
    112113                                'css_vars'   => array(
    … …  
    115116                        ),
    116117                        'right'  => array(
    117                                 'value_func' => 'static::get_individual_property_css_declarations',
     118                                'value_func' => array( self::class, 'get_individual_property_css_declarations' ),
    118119                                'path'       => array( 'border', 'right' ),
    119120                                'css_vars'   => array(
    … …  
    122123                        ),
    123124                        'bottom' => array(
    124                                 'value_func' => 'static::get_individual_property_css_declarations',
     125                                'value_func' => array( self::class, 'get_individual_property_css_declarations' ),
    125126                                'path'       => array( 'border', 'bottom' ),
    126127                                'css_vars'   => array(
    … …  
    129130                        ),
    130131                        'left'   => array(
    131                                 'value_func' => 'static::get_individual_property_css_declarations',
     132                                'value_func' => array( self::class, 'get_individual_property_css_declarations' ),
    132133                                'path'       => array( 'border', 'left' ),
    133134                                'css_vars'   => array(
Note: See TracChangeset for help on using the changeset viewer.