phpstan/phpstan-beberlei-assert

Invalid Assertion::eq evaluation

simPod opened this issue · 3 comments

    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?

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

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

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.