final class RefusalStatus (View source)

The one place a Domain refusal becomes an HTTP status. API controllers call this where they used to read a status number off the result.

Methods

static int
of(Refusal $refusal)

No description

static int
ofResult(array $result, int $default = 400)

Status for a ['success' => false, ...] array: a Domain result carries a refusal, an Application-built one may still carry a status number.

Details

static int of(Refusal $refusal)

No description

Parameters

Refusal $refusal

Return Value

int

static int ofResult(array $result, int $default = 400)

Status for a ['success' => false, ...] array: a Domain result carries a refusal, an Application-built one may still carry a status number.

Parameters

array $result
int $default

Return Value

int