Skip to content
docsv0.1.0

GenerationContext

Everything a generator needs: the target plugin, the artifact name, CLI options, and repo root.

GenerationContext::__construct()

public function __construct(string $plugin, string $name, array $options, string $root):

Parameters

Parameters of __construct()
NameTypeDescription
$pluginstring
$namestring
$optionsarray<string, mixed>
$rootstring

GenerationContext::option()

public function option(string $key): ?string

Reads a CLI `--option` value; `null` when absent or not a string.

Parameters

Parameters of option()
NameTypeDescription
$keystring