API / Minn\Runtime / AbilityRun

AbilityRun final class

Minn\Runtime\AbilityRun · public/minn/src/Minn/Runtime/AbilityRun.php · 28 lines

The checks of an ability's run, as the reference makes them (probes abilities-registry, abilities-classes); WP_Ability::execute strings them: input left out takes the input schema's default, input given to an ability without an input schema is refused, input that its schema refuses is ability_invalid_input; a permission callback that does not answer true is ability_invalid_permissions (an error it returns is reported as a notice); then wp_before_execute_ability, the callback (an error it returns is the answer), the output checked against the output schema (ability_invalid_output), and wp_after_execute_ability.

Public

staticinput(string $name, array $schema, mixed $input): Minn\Objects\Errors|true#

True, or why the input does not fit.

staticallowed(string $name, mixed $answer): Minn\Objects\Errors|true#

True, or the error a permission answer other than true becomes (an error it returns is reported as a notice).

staticoutput(string $name, array $schema, mixed $output): Minn\Objects\Errors|true#

True, or why the output does not fit the output schema.