Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default value for $numberOfBacktraces in SettledResult::throw #149

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

inxilpro
Copy link
Contributor

#131 changed the signature of SettledResult::throw so that calling ->throw() without a parameter is no longer allowed. This just sets the default to NULL so that it's backwards-compatible.

@daniel-g-wood
Copy link

Hey @inxilpro , unfortunately this will still fail in some cases. If you pass null to this function and there are errors, it fails on $this->errorAsString($numberOfBacktraces). errorAsString requires an int parameter, so it throws a type error there instead. You'll also need make the following change (or something like this):

    public function errorAsString(?int $numberOfBacktraces = 2)
    {
        $numberOfBacktraces ??= 2;
        ....
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants