From f8399f42dc61b14393e1d46b0962c4660df0d396 Mon Sep 17 00:00:00 2001 From: Glen Davies Date: Thu, 10 Feb 2022 17:02:39 +1300 Subject: [PATCH] Fix linting errors and elements unit tests --- lib/block-supports/elements.php | 10 +++++----- phpunit/class-elements-test.php | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/block-supports/elements.php b/lib/block-supports/elements.php index cd48fc1d955ac1..88f9cdad37c648 100644 --- a/lib/block-supports/elements.php +++ b/lib/block-supports/elements.php @@ -8,10 +8,10 @@ /** * Get the elements class names. * - * @param array $block Block object. - * @return string The unique class name. + * @param array $block Block object. + * @return string The unique class name. */ -function gutenberg_get_elements_class_name ( $block ) { +function gutenberg_get_elements_class_name( $block ) { return 'wp-elements-' . md5( serialize( $block ) ); } @@ -74,8 +74,8 @@ function gutenberg_render_elements_support( $block_content, $block ) { * This solves the issue of an element (e.g.: link color) being styled in both the parent and a descendant: * we want the descendant style to take priority, and this is done by loading it after, in DOM order. * - * @param string|null $pre_render The pre-rendered content. Default null. - * @param array $parsed_block The block being rendered. + * @param string|null $pre_render The pre-rendered content. Default null. + * @param array $block The block being rendered. * * @return null */ diff --git a/phpunit/class-elements-test.php b/phpunit/class-elements-test.php index 349b6328557110..56b418f54407a4 100644 --- a/phpunit/class-elements-test.php +++ b/phpunit/class-elements-test.php @@ -13,7 +13,7 @@ class Gutenberg_Elements_Test extends WP_UnitTestCase { * @return string String where the unique id classes were replaced with "wp-elements-1". */ private static function make_unique_id_one( $string ) { - return preg_replace( '/wp-elements-.{13}/', 'wp-elements-1', $string ); + return preg_replace( '/wp-elements-[a-zA-Z0-9]+/', 'wp-elements-1', $string ); } /**