php-docblock-checker icon indicating copy to clipboard operation
php-docblock-checker copied to clipboard

?string string|null is not parsed

Open kaurov opened this issue 4 years ago • 1 comments

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

kaurov avatar Sep 07 '21 08:09 kaurov

@kaurov Try https://github.com/php-censor/phpdoc-checker.

corpsee avatar Sep 07 '21 08:09 corpsee