ClassesBigCommerceCLIDocumentationImport Docs

Import_Docs

Class Import_Docs

Handles the import of plugin documentation from a previously built JSON file.

Methods

__construct

Import_Docs constructor.

public __construct(string $plugin_dir): mixed

Parameters:

ParameterTypeDescription
$plugin_dirstringDirectory of the plugin.

command

Declare the command name.

protected command(): string

description

Provide a command description.

protected description(): string

arguments

Declare command arguments.

protected arguments(): array[]

run

Execute the documentation import process.

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

Parameters:

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

Throws:


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