bmewburn / vscode-intelephense

PHP intellisense for Visual Studio Code
https://intelephense.com
Other
1.56k stars 92 forks source link

An incorrect warning appears #2895

Closed tkanzaki42 closed 3 weeks ago

tkanzaki42 commented 4 weeks ago

Describe the bug An incorrect warning appears Expected type 'null|string'. Found 'void'.intelephense(P1006)

To Reproduce Please try writing this code

    public function signup($credentials): ?string
    {
        try {
            $user = $this->userRepository->create($credentials);
            $token = auth()->login($user);

            return $token;
        } catch (\Exception $e) {
            throw new UnauthorizedHttpException('Unauthorized', 'User creation failed.');
        }
    }

Expected behavior There should be no warning

Screenshots image

Platform and version

bmewburn commented 3 weeks ago

What is the return type of login() when you hover over it?