Skip to content

Commit

Permalink
style: add return type in TraverseHelpers
Browse files Browse the repository at this point in the history
  • Loading branch information
theodesp committed Jun 28, 2024
1 parent cf81fc3 commit 9f86755
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions includes/Utilities/TraverseHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ final class TraverseHelpers {
* @param int $depth The current depth of traversal.
* @param int $max_depth The maximum depth to traverse.
*/
public static function traverse_blocks( &$blocks, $callback, $depth = 0, $max_depth = PHP_INT_MAX ) {
public static function traverse_blocks( &$blocks, $callback, $depth = 0, $max_depth = PHP_INT_MAX ): void {
foreach ( $blocks as &$block ) {
$callback( $block );
if ( ! empty( $block['innerBlocks'] ) && $depth < $max_depth ) {
Expand All @@ -35,7 +35,7 @@ public static function traverse_blocks( &$blocks, $callback, $depth = 0, $max_de
*
* @param array $block The block to potentially replace.
*/
public static function replace_reusable_blocks( &$block ) {
public static function replace_reusable_blocks( &$block ): void {
if ( 'core/block' === $block['blockName'] && isset( $block['attrs']['ref'] ) ) {
$post = get_post( $block['attrs']['ref'] );
$reusable_blocks = ! empty( $post->post_content ) ? parse_blocks( $post->post_content ) : null;
Expand Down

0 comments on commit 9f86755

Please sign in to comment.