Skip to content
docsv0.24.0

Flavor

The two controller conventions `coa:make controller` can target — see {@see ConventionDetector} for how one is chosen. - `Runtime`: a plain, dependency-free PSR-7 class (`index(ServerRequestInterface): ResponseInterface`, no base class, no `#[Route]`) wired through a `RouteProviderInterface` plugin — the `milpa/runtime` + skeleton convention. - `Legacy`: extends the host's `Milpa\app\Providers\BaseController` and routes via `#[Route]` attributes — the existing Milpa host convention (`src/Make/stubs/controller.php.stub`).

Flavor::fromOption()

public static function fromOption(string $value): self

Parses a `--flavor` CLI value into a case.

Parameters

Parameters of fromOption()
NameTypeDescription
$valuestring

Throws

\InvalidArgumentException When `$value` is neither 'runtime' nor 'legacy'.

Flavor::cases()

public static function cases(): array

Flavor::from()

public static function from(string|int $value): static

Parameters

Parameters of from()
NameTypeDescription
$valuestring|int

Flavor::tryFrom()

public static function tryFrom(string|int $value): ?static

Parameters

Parameters of tryFrom()
NameTypeDescription
$valuestring|int