ClassesBigCommerceCLIDocumentationBuild Docs

Build_Docs

Register build docs command and related functionality

Methods

__construct

Constructor for the Build_Docs class.

public __construct(string $plugin_dir): mixed

Parameters:

ParameterTypeDescription
$plugin_dirstringDirectory path of the plugin.

command

Declare command name.

protected command(): string

Return Value:

The CLI command name.


description

Provide a command description.

protected description(): string|void

Return Value:

The CLI command description.


arguments

Declare command arguments.

protected arguments(): array[]

Return Value:

List of command arguments.


run

Get files data and write it to the provided file.

public run(array $args, array $assoc_args): void

Parameters:

ParameterTypeDescription
$argsarrayPositional arguments passed to the command.
$assoc_argsarrayAssociative arguments passed to the command.

Throws:

If there is an issue during execution.


Inherited methods

register

Register the command with WP-CLI.

public register(): void

This method checks if WP-CLI is defined and active. If so, it registers the command with WP-CLI, using the specific command name defined in the child class.


command

Get the command name.

protected command(): string

This method must be implemented in the child class to return the specific command name.

  • This method is abstract.

Return Value:

The name of the WP-CLI command.


description

Get a short description of the command.

protected description(): string

This method must be implemented in the child class to provide a brief description of the command’s functionality, which will be shown in the WP-CLI help output.

  • This method is abstract.

Return Value:

The short description of the command.


arguments

Get the command arguments.

protected arguments(): string

This method must be implemented in the child class to return the arguments required by the command. The arguments will be shown in the WP-CLI help output.

  • This method is abstract.

Return Value:

The arguments for the command.


run

Run the command.

public run(array $args, array $assoc_args): void

This method must be implemented in the child class to define the logic for executing the command. It accepts arguments and associative arguments passed to the command via WP-CLI.

  • This method is abstract.

Parameters:

ParameterTypeDescription
$argsarrayThe positional arguments passed to the command.
$assoc_argsarrayThe associative arguments passed to the command.


Automatically generated on 2025-01-21