Skip to editor
Psalm
Docs
Playground
Plugins
Blog
Paid support
Share
Fix issues
Show original
PHP
Settings
<?php enum Action { case Create; case Read; case Delete; } function exhaustiveMatch(Action $value): string { return match ($value) { Action::Create => 'foo', Action::Delete => 'bar', }; } function exhaustiveSwitch(Action $value): string { $someResult = ''; switch ($value) { case Action::Create: $someResult = 'foo'; break; case Action::Delete: $someResult = 'bar'; break; } return $someResult; } /** * @psalm-suppress RedundantCondition https://github.com/vimeo/psalm/issues/10054 */ function exhaustiveIf(Action $value): string { $someResult = ''; if ($value === Action::Create) { $someResult = 'foo'; } elseif ($value === Action::Delete) { $someResult = 'bar'; } return $someResult; }
Issues
Types
idle
Saved Jul 27 2023 17:32 UTC
⌘/Ctrl+Enter
run
⌘/Ctrl+S
share
F8
/
⇧F8
next/prev issue