public function getMethodDescription(): ?string
    {
        // Remove the comment markers
        $description = preg_replace('~\*/$~', '', $this->comment);
        $description = preg_replace('~^\s*(/\*\*|\* ?|\*/)~m', '', $description);

        // Keep everything before the first annotation
        $description = trim(explode('@', $description)[0]);

        // Drop common "Get" or "Return" in front of comment
        $description = ucfirst(preg_replace('~^(set|get|return)s? ~i', '', $description));

        return $description ?: null;
    }
public function getMethodDescription(): ?string
    {
        // Remove the comment markers
        $description = preg_replace('~\*/$~', '', $this->comment);
        $description = preg_replace('~^\s*(/\*\*|\* ?|\*/)~m', '', $description);

        // Keep everything before the first annotation
        $description = trim(explode('@', $description)[0]);

        // Drop common "Get" or "Return" in front of comment
        $description = ucfirst(preg_replace('~^(set|get|return)s? ~i', '', $description));

        return $description ?: null;
    }
public function getMethodDescription ( ) : ? string { // Remove the comment markers $ description = preg_replace ( '~\*/$~' , '' , $ this -> comment ) ; $ description = preg_replace ( '~^\s*(/\*\*|\* ?|\*/)~m' , '' , $ description ) ; // Keep everything before the first annotation $ description = trim ( explode ( '@' , $ description ) [ 0 ] ) ; // Drop common "Get" or "Return" in front of comment $ description = ucfirst ( preg_replace ( '~^(set|get|return)s? ~i' , '' , $ description ) ) ; return $ description ? : null ; }
Get the description of a method from the doc block

@return null|string
Get the description of a method from the doc block