From 4722fcfca8da808ebd8adf96b2bac4a8d6785a87 Mon Sep 17 00:00:00 2001 From: davidbaumwald Date: Thu, 29 Sep 2022 18:05:09 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@54357 git-svn-id: http://core.svn.wordpress.org/trunk@53916 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/style-engine/class-wp-style-engine.php | 11 ++++++----- wp-includes/version.php | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/wp-includes/style-engine/class-wp-style-engine.php b/wp-includes/style-engine/class-wp-style-engine.php index 7aab1cbb22..c6554c5dd9 100644 --- a/wp-includes/style-engine/class-wp-style-engine.php +++ b/wp-includes/style-engine/class-wp-style-engine.php @@ -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. @@ -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', diff --git a/wp-includes/version.php b/wp-includes/version.php index baad42a7fb..fdcd857993 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.1-beta2-54356'; +$wp_version = '6.1-beta2-54357'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.