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

Invalid Assertion::eq evaluation #5

Closed
simPod opened this issue Apr 1, 2019 · 3 comments
Closed

Invalid Assertion::eq evaluation #5

simPod opened this issue Apr 1, 2019 · 3 comments

Comments

@simPod
Copy link
Contributor

simPod commented Apr 1, 2019

    private function first()
    {
        $var = getenv('env');
        Assertion::eq($var, 'value');
        $this->second($var);
    }

    private function second(string $needsString)
    {

    }

Returns

Parameter #1 $needsString of method ::second() expects string, string|false given.

Even though we know the possible set of types for $var is string when passed into second(). Or am I wrong?

@ondrejmirtes
Copy link
Member

Is eq the equivalent to == or ===? Anyway, adding another assertion to string() will not kill you ;)

@simPod
Copy link
Contributor Author

simPod commented Apr 1, 2019

I see, there's ::same method ;) thanks

@simPod simPod closed this as completed Apr 1, 2019
@github-actions
Copy link

github-actions bot commented May 1, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants