Skip to content

v1.2.0

Choose a tag to compare

@RobertWesner RobertWesner released this 12 Oct 09:42
· 11 commits to main since this release
0a491cd

What's Changed

Full Changelog: v1.1.0...v1.2.0

New

args()

The Novara::Call::args() function allows you to ensure novarity yet still have named arguments.

Novara::Call::args(
    [
        'name',
        'age',
    ],
    func_get_args(),
)->age === ...

This can be combined with the spreading.

// Share the args through spreading
return Novara::Call::spread(
    Novara::Call::args(
        [
            'name',
            'age',
        ],
        func_get_args(),
    ),
    function () {
        ... func_get_arg(0)->name ...
    },
    function () {
        ... func_get_arg(0)->age ...
    },
);