Skip to content
This repository has been archived by the owner on Feb 15, 2025. It is now read-only.

?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 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