1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 20:34:47 +01:00
psalm/docs/running_psalm/issues/UnhandledMatchCondition.md
2021-01-29 11:38:50 +01:00

343 B

UnhandledMatchCondition

Emitted when a match expression does not handle one or more options.

<?php

function matchOne(): string {
    $foo = rand(0, 1) ? "foo" : "bar";

    return match ($foo) {
        'foo' => 'foo',
    };
}

Why this is bad

The above code will fail 50% of the time with an UnhandledMatchError error.