Skip to content

Commit

Permalink
QA: fix newly introduced parameter name issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfnl committed Sep 23, 2023
1 parent ee01e05 commit eb80f7c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
28 changes: 14 additions & 14 deletions src/wp-includes/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -785,24 +785,24 @@ function make_before_block_visitor( $context ) {
* Furthermore, prepend the markup for any blocks hooked `before` the given block and as its parent's
* `first_child`, respectively, to the serialized markup for the given block.
*
* @param array $block The block to inject the theme attribute into, and hooked blocks before.
* @param array $parent The parent block of the given block.
* @param array $prev The previous sibling block of the given block.
* @param array $block The block to inject the theme attribute into, and hooked blocks before.
* @param array $parent_block The parent block of the given block.
* @param array $prev The previous sibling block of the given block.
* @return string The serialized markup for the given block, with the markup for any hooked blocks prepended to it.
*/
return function ( &$block, $parent = null, $prev = null ) use ( $context ) {
return function ( &$block, $parent_block = null, $prev = null ) use ( $context ) {
_inject_theme_attribute_in_template_part_block( $block );

$markup = '';

if ( $parent && ! $prev ) {
if ( $parent_block && ! $prev ) {
// Candidate for first-child insertion.
$hooked_blocks_for_parent = get_hooked_blocks( $parent['blockName'] );
$hooked_blocks_for_parent = get_hooked_blocks( $parent_block['blockName'] );
foreach ( $hooked_blocks_for_parent as $hooked_block_type => $relative_position ) {
if ( 'first_child' === $relative_position ) {
$hooked_block_markup = get_comment_delimited_block_content( $hooked_block_type, array(), '' );
/** This filter is documented in wp-includes/blocks.php */
$markup .= apply_filters( 'inject_hooked_block_markup', $hooked_block_markup, $hooked_block_type, $relative_position, $parent, $context );
$markup .= apply_filters( 'inject_hooked_block_markup', $hooked_block_markup, $hooked_block_type, $relative_position, $parent_block, $context );
}
}
}
Expand Down Expand Up @@ -852,12 +852,12 @@ function make_after_block_visitor( $context ) {
* Append the markup for any blocks hooked `after` the given block and as its parent's
* `last_child`, respectively, to the serialized markup for the given block.
*
* @param array $block The block to inject the hooked blocks after.
* @param array $parent The parent block of the given block.
* @param array $next The next sibling block of the given block.
* @param array $block The block to inject the hooked blocks after.
* @param array $parent_block The parent block of the given block.
* @param array $next The next sibling block of the given block.
* @return string The serialized markup for the given block, with the markup for any hooked blocks appended to it.
*/
return function ( &$block, $parent = null, $next = null ) use ( $context ) {
return function ( &$block, $parent_block = null, $next = null ) use ( $context ) {
$markup = '';

$hooked_blocks = get_hooked_blocks( $block['blockName'] );
Expand All @@ -869,14 +869,14 @@ function make_after_block_visitor( $context ) {
}
}

if ( $parent && ! $next ) {
if ( $parent_block && ! $next ) {
// Candidate for last-child insertion.
$hooked_blocks_for_parent = get_hooked_blocks( $parent['blockName'] );
$hooked_blocks_for_parent = get_hooked_blocks( $parent_block['blockName'] );
foreach ( $hooked_blocks_for_parent as $hooked_block_type => $relative_position ) {
if ( 'last_child' === $relative_position ) {
$hooked_block_markup = get_comment_delimited_block_content( $hooked_block_type, array(), '' );
/** This filter is documented in wp-includes/blocks.php */
$markup .= apply_filters( 'inject_hooked_block_markup', $hooked_block_markup, $hooked_block_type, $relative_position, $parent, $context );
$markup .= apply_filters( 'inject_hooked_block_markup', $hooked_block_markup, $hooked_block_type, $relative_position, $parent_block, $context );
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions tests/phpunit/tests/admin/wpTermsListTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@ public function set_up() {
/**
* Call an inaccessible (private or protected) method.
*
* @param object|string $object Object instance or class string to call the method of.
* @param object|string $instance Object instance or class string to call the method of.
* @param string $method_name Name of the method to call.
* @param array $args Optional. Array of arguments to pass to the method.
* @return mixed Return value of the method call.
* @throws ReflectionException If the object could not be reflected upon.
*/
private function call_inaccessible_method( $object, $method_name, $args = array() ) {
$method = ( new ReflectionClass( $object ) )->getMethod( $method_name );
private function call_inaccessible_method( $instance, $method_name, $args = array() ) {
$method = ( new ReflectionClass( $instance ) )->getMethod( $method_name );
$method->setAccessible( true );
return $method->invokeArgs( $object, $args );
return $method->invokeArgs( $instance, $args );
}

/**
Expand Down

0 comments on commit eb80f7c

Please sign in to comment.