Skip to content

Commit c861d58

Browse files
committed
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. git-svn-id: https://develop.svn.wordpress.org/trunk@54357 602fd350-edb4-49c9-b593-d223f7449a82
1 parent d7750e4 commit c861d58

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/wp-includes/style-engine/class-wp-style-engine.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@
1414
*
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.
1920
*
2021
* @access private
2122
* @since 6.1.0
2223
*/
23-
class WP_Style_Engine {
24+
final class WP_Style_Engine {
2425
/**
2526
* Style definitions that contain the instructions to
2627
* parse/output valid Gutenberg styles from a block's attributes.
@@ -107,28 +108,28 @@ class WP_Style_Engine {
107108
'path' => array( 'border', 'width' ),
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(
113114
'color' => '--wp--preset--color--$slug',
114115
),
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(
120121
'color' => '--wp--preset--color--$slug',
121122
),
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(
127128
'color' => '--wp--preset--color--$slug',
128129
),
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(
134135
'color' => '--wp--preset--color--$slug',

0 commit comments

Comments
 (0)