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

?string string|null is not parsed #44

Open
kaurov opened this issue Sep 7, 2021 · 1 comment
Open

?string string|null is not parsed #44

kaurov opened this issue Sep 7, 2021 · 1 comment

Comments

@kaurov
Copy link

kaurov commented Sep 7, 2021

try this code:

 /**
     * Some description
     * @param array  $res
     * @return string|null
     */
    public function sellVoucher(
        array $res
    ): ?string {
        
        if ($res && isset($res['certNumber']))  {
            return (string)$res['certNumber'];
        }

        return null;
    }

and get
WARNING @return string|null does not match method signature (Array).

but this annotation is ok and should be accepted

@corpsee
Copy link

corpsee commented Sep 7, 2021

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

No branches or pull requests

2 participants