SpecRunner
in package
Runs a single spec.
Table of Contents
- get_action_locale() : object
- Get the action locale that matches the note locale, or fall back to the en_US locale.
- get_actions() : array<string|int, mixed>
- Get the actions for a note.
- get_locale() : mixed
- Get the locale for the WordPress locale, or fall back to the en_US locale.
- run_spec() : mixed
- Run the spec.
- get_url() : string
- Get the URL for an action.
Methods
get_action_locale()
Get the action locale that matches the note locale, or fall back to the en_US locale.
public
static get_action_locale(array<string|int, mixed> $action_locales) : object
Parameters
- $action_locales : array<string|int, mixed>
-
The locales from the spec's action.
Return values
object — The matching locale, or the en_US fallback locale, or null if neither was found.get_actions()
Get the actions for a note.
public
static get_actions(object $spec) : array<string|int, mixed>
Parameters
- $spec : object
-
The spec.
Return values
array<string|int, mixed> — The actions.get_locale()
Get the locale for the WordPress locale, or fall back to the en_US locale.
public
static get_locale(array<string|int, mixed> $locales) : mixed
Parameters
- $locales : array<string|int, mixed>
-
The locales to search through.
Tags
Return values
mixed —run_spec()
Run the spec.
public
static run_spec(object $spec, object $stored_state) : mixed
Parameters
- $spec : object
-
The spec to run.
- $stored_state : object
-
Stored state.
Return values
mixed —get_url()
Get the URL for an action.
private
static get_url(object $action) : string
Parameters
- $action : object
-
The action.