Skip to content

Commit

Permalink
Fix linting errors and elements unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Glen Davies committed Feb 10, 2022
1 parent daf9bf4 commit f8399f4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions lib/block-supports/elements.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) );
}

Expand Down Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion phpunit/class-elements-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}

/**
Expand Down

0 comments on commit f8399f4

Please sign in to comment.