Skip to content

Commit 1cfeb85

Browse files
committed
Fix php 7.x compat
1 parent e7d649c commit 1cfeb85

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/phpunit/tests/html-api/wpHtmlProcessor.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,9 @@ public function test_deep_nesting_fails_process_without_error() {
10921092
$processor = WP_HTML_Processor::create_fragment( $html );
10931093

10941094
// The fragment parser starts with a few context tokens already bookmarked.
1095-
$reached_tokens = ( fn() => count( $this->bookmarks ) )->call( $processor );
1095+
$reached_tokens = ( function () {
1096+
return count( $this->bookmarks );
1097+
} )->call( $processor );
10961098
while ( $processor->next_token() ) {
10971099
++$reached_tokens;
10981100
}
@@ -1109,7 +1111,9 @@ public function test_deep_nesting_fails_processing_virtual_tokens_without_error(
11091111
$processor = WP_HTML_Processor::create_fragment( $html );
11101112

11111113
// The fragment parser starts with a few context tokens already bookmarked.
1112-
$reached_tokens = ( fn() => count( $this->bookmarks ) )->call( $processor );
1114+
$reached_tokens = ( function () {
1115+
return count( $this->bookmarks );
1116+
} )->call( $processor );
11131117
while ( $processor->next_token() ) {
11141118
++$reached_tokens;
11151119
}

0 commit comments

Comments
 (0)