Skip to content

Add support for lazy messages #265

@theofidry

Description

@theofidry

On some occasions, in order to provide a helpful error message, more processing is required to provide a helpful message:

$message = $createMessage(...); // heavy stuff happening there

Assert::smth(..., $message);

Maybe it would be cool to have support for $message being string|():string instead of just string:

Assert::smth(..., $createMessage);

In some cases this may end up more verbose, but on the other hand it prevents the assertion from being expensive in case of non-failure (the happy path).

WDYT?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions