WooCommerce Code Reference

StepProcessorResult
in package

A class returned by StepProcessor classes containing result of the process and messages.

Table of Contents

MESSAGE_TYPES  = array('error', 'info', 'debug', 'warn')
$messages  : array<string|int, mixed>
Messages
$step_name  : string
Step name
$success  : bool
Indicate whether the process was success or not
__construct()  : mixed
Construct.
add_debug()  : void
Add a new debug message.
add_error()  : void
Add a new error message.
add_info()  : void
Add a new info message.
add_message()  : void
Add a new message.
add_warn()  : void
Add a new warn message.
get_messages()  : array<string|int, mixed>
Filter messages.
get_step_name()  : string
Get the name of the step.
is_success()  : bool
Check to see if the result was success.
merge_messages()  : void
Merge messages from another StepProcessorResult instance.
set_step_name()  : void
Get messages.
success()  : StepProcessorResult
Create a new instance with $success = true.

Constants

Properties

Methods

__construct()

Construct.

public __construct(bool $success, string $step_name) : mixed
Parameters
$success : bool

Indicate whether the process was success or not.

$step_name : string

The name of the step.

Return values
mixed

add_message()

Add a new message.

public add_message(string $message[, string $type = 'error' ]) : void
Parameters
$message : string

message.

$type : string = 'error'

one of error, info.

Tags
throws
InvalidArgumentException

When incorrect type is given.

Return values
void

get_messages()

Filter messages.

public get_messages([string $type = 'all' ]) : array<string|int, mixed>
Parameters
$type : string = 'all'

one of all, error, and info.

Return values
array<string|int, mixed>