Skip to content

Commit 82cbe76

Browse files
committed
phpstan
1 parent 0071c86 commit 82cbe76

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/WP_CLI/SearchReplacer.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ class SearchReplacer {
5757
*/
5858
private $max_recursion;
5959

60+
/**
61+
* @var bool
62+
*/
63+
private $callback;
64+
6065
/**
6166
* @param string $from String we're looking to replace.
6267
* @param string $to What we want it to be replaced with.
@@ -219,12 +224,12 @@ private function run_recursively( $data, $serialised, $recursion_level = 0, $vis
219224

220225
if ( $this->callback ) {
221226
if ( false === $result ) {
222-
WP_CLI::error( 'The callback function return false. Stopping operation.' );
227+
\WP_CLI::error( 'The callback function return false. Stopping operation.' );
223228
} elseif ( is_wp_error( $result ) ) {
224229
$message = $errors->get_error_message();
225-
WP_CLI::error( 'The callback function threw an error. Stopping operation. ' . $message );
230+
\WP_CLI::error( 'The callback function threw an error. Stopping operation. ' . $message );
226231
} elseif ( ! is_string( $result ) ) {
227-
WP_CLI::error( 'The callback function did not return a string. Stopping operation.' );
232+
\WP_CLI::error( 'The callback function did not return a string. Stopping operation.' );
228233
}
229234
}
230235

0 commit comments

Comments
 (0)