Use match for value mapping because it uses strict comparison and is exhaustive: ~~~php $statusLabel = match ($status) { 'pending' => 'Waiting', 'paid' => 'Complete', 'failed' => 'Failed', default => throw new InvalidArgumentException("Unknown status: {$status}"), }; ~~~ Return the expression directly where possible and provide a deliberate default for unknown values.
Installs into .claude/skills of the current project.
Are you the author of Php Language?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/hoangnguyen0403-php-language-agent-skills-standard)
Use match for value mapping because it uses strict comparison and is exhaustive:
~~~php
$statusLabel = match ($status) {
'pending' => 'Waiting',
'paid' => 'Complete',
'failed' => 'Failed',
default => throw new InvalidArgumentException("Unknown status: {$status}"),
};
~~~
Return the expression directly where possible and provide a deliberate default for unknown values.