PHP Class WP_CLI\DocParser

Used to determine execution characteristics (arguments, etc.).
Show file Open project: wp-cli/wp-cli Class Usage Examples

Protected Properties

Property Type Description
$docComment string PHPdoc command for the command.

Public Methods

Method Description
__construct ( string $docComment )
get_arg_args ( string $name ) : mixed | null Get the arguments for a given argument.
get_arg_desc ( string $name ) : string Get the description for a given argument.
get_longdesc ( ) : string Get the command's full description
get_param_args ( string $key ) : mixed | null Get the arguments for a given parameter.
get_param_desc ( string $key ) : string Get the description for a given parameter.
get_shortdesc ( ) : string Get the command's short description (e.g. summary).
get_synopsis ( ) : string Get the command's synopsis.
get_tag ( string $name ) : string Get the value for a given tag (e.g. "@alias" or "@subcommand")

Private Methods

Method Description
get_arg_or_param_args ( string $regex ) : array | null Get the args for an arg or param
remove_decorations ( string $comment ) : string Remove unused cruft from PHPdoc comment.

Method Details

__construct() public method

public __construct ( string $docComment )
$docComment string

get_arg_args() public method

Get the arguments for a given argument.
public get_arg_args ( string $name ) : mixed | null
$name string Argument's doc name.
return mixed | null

get_arg_desc() public method

Get the description for a given argument.
public get_arg_desc ( string $name ) : string
$name string Argument's doc name.
return string

get_longdesc() public method

Get the command's full description
public get_longdesc ( ) : string
return string

get_param_args() public method

Get the arguments for a given parameter.
public get_param_args ( string $key ) : mixed | null
$key string Parameter's key.
return mixed | null

get_param_desc() public method

Get the description for a given parameter.
public get_param_desc ( string $key ) : string
$key string Parameter's key.
return string

get_shortdesc() public method

Get the command's short description (e.g. summary).
public get_shortdesc ( ) : string
return string

get_synopsis() public method

Get the command's synopsis.
public get_synopsis ( ) : string
return string

get_tag() public method

Get the value for a given tag (e.g. "@alias" or "@subcommand")
public get_tag ( string $name ) : string
$name string Name for the tag, without '@'
return string

Property Details

$docComment protected property

PHPdoc command for the command.
protected string $docComment
return string