Skip to content

Commit

Permalink
Editor: Remove deprecated callable in WP_Style_Engine class.
Browse files Browse the repository at this point in the history
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.

git-svn-id: https://develop.svn.wordpress.org/trunk@54357 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
dream-encode committed Sep 29, 2022
1 parent d7750e4 commit c861d58
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/wp-includes/style-engine/class-wp-style-engine.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@
*
* The Style Engine aims to provide a consistent API for rendering styling for blocks across both client-side and server-side applications.
*
* This class is final and should not be extended.
* This class is for internal Core usage and is not supposed to be used by extenders (plugins and/or themes).
* This is a low-level API that may need to do breaking changes. Please, use wp_style_engine_get_styles instead.
*
* @access private
* @since 6.1.0
*/
class WP_Style_Engine {
final class WP_Style_Engine {
/**
* Style definitions that contain the instructions to
* parse/output valid Gutenberg styles from a block's attributes.
Expand Down Expand Up @@ -107,28 +108,28 @@ class WP_Style_Engine {
'path' => array( 'border', 'width' ),
),
'top' => array(
'value_func' => 'static::get_individual_property_css_declarations',
'value_func' => array( self::class, 'get_individual_property_css_declarations' ),
'path' => array( 'border', 'top' ),
'css_vars' => array(
'color' => '--wp--preset--color--$slug',
),
),
'right' => array(
'value_func' => 'static::get_individual_property_css_declarations',
'value_func' => array( self::class, 'get_individual_property_css_declarations' ),
'path' => array( 'border', 'right' ),
'css_vars' => array(
'color' => '--wp--preset--color--$slug',
),
),
'bottom' => array(
'value_func' => 'static::get_individual_property_css_declarations',
'value_func' => array( self::class, 'get_individual_property_css_declarations' ),
'path' => array( 'border', 'bottom' ),
'css_vars' => array(
'color' => '--wp--preset--color--$slug',
),
),
'left' => array(
'value_func' => 'static::get_individual_property_css_declarations',
'value_func' => array( self::class, 'get_individual_property_css_declarations' ),
'path' => array( 'border', 'left' ),
'css_vars' => array(
'color' => '--wp--preset--color--$slug',
Expand Down

0 comments on commit c861d58

Please sign in to comment.