[ 'name' => $enum->toLabel(), 'value' => $enum->value, 'hint' => $enum->toHint(), ], self::cases()); } public function toLabel(): string { return match ($this) { self::Web => 'Web Applications', self::SPA => 'Single Page Applications', // self::Machine => 'Microservices', }; } public function toHint(): string { return match ($this) { self::Web => 'Server-side rendered web application, where authentication is handled by the server.', self::SPA => 'Single Page Application where client side framework e.g. React, Vue, Angular is used, and gets the authentication token from the server.', // self::Machine => 'Application that runs on a machine, e.g. a serverless function, or a container.', }; } }