Skip to content

Commit 1488fc1

Browse files
authored
Merge pull request #6034 from PARTHVATALIYA/fix/6033
Added PHPDoc for cmd_starts_with() method
2 parents 8dee816 + 0a4ad95 commit 1488fc1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

php/WP_CLI/Runner.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,14 @@ private static function guess_url( $assoc_args ) {
344344
return false;
345345
}
346346

347+
/**
348+
* Checks if the arguments passed to the WP-CLI binary start with the specified prefix.
349+
*
350+
* @param array $prefix An array of strings specifying the expected start of the arguments passed to the WP-CLI binary.
351+
* For example, `['user', 'list']` checks if the arguments passed to the WP-CLI binary start with `user list`.
352+
*
353+
* @return bool `true` if the arguments passed to the WP-CLI binary start with the specified prefix, `false` otherwise.
354+
*/
347355
private function cmd_starts_with( $prefix ) {
348356
return array_slice( $this->arguments, 0, count( $prefix ) ) === $prefix;
349357
}

0 commit comments

Comments
 (0)