Skip to content

Simplify usage when the matcher is used to write a function #5

@krtek4

Description

@krtek4
function factorial($n)
{
    return Matcher::match($n, [
        '0' => 1,
        'n' => function($n) {
            return $n * factorial($n - 1);
        }
    ]);
}

Find a way to make this "cleaner"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions