final protected function getDescription(string $className): ?string
    {
        $class = new \ReflectionClass($className);

        $comment = $class->getDocComment() ?: '';

        // Remove the comment markers
        $comment = preg_replace('~^\s*(/\*\*|\* ?|\*/)~m', '', $comment);

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

        if (!$comment) {
            $comment = null;
        }

        return $comment;
    }
final protected function getDescription(string $className): ?string
    {
        $class = new \ReflectionClass($className);

        $comment = $class->getDocComment() ?: '';

        // Remove the comment markers
        $comment = preg_replace('~^\s*(/\*\*|\* ?|\*/)~m', '', $comment);

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

        if (!$comment) {
            $comment = null;
        }

        return $comment;
    }
final protected function getDescription ( string $ className ) : ? string { $ class = new \ ReflectionClass ( $ className ) ; $ comment = $ class -> getDocComment ( ) ? : '' ; // Remove the comment markers $ comment = preg_replace ( '~^\s*(/\*\*|\* ?|\*/)~m' , '' , $ comment ) ; // Keep everything before the first annotation $ comment = trim ( explode ( '@' , $ comment ) [ 0 ] ) ; if ( ! $ comment ) { $ comment = null ; } return $ comment ; }
Get the description of a class from the doc block

@param string $className

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