@phpstan-sealed Ok|Err (実装を特定のクラスだけに限定する) */ interface Result { public function isOk(): bool; public function unwrap(): mixed; } final readonly class Ok implements Result { /* 値 T を持つ */ } final readonly class Err implements Result { /* エラー E を持つ */ } PHP https://github.com/valbeat/php-result 33/41