protected function parse()
    {
        $lines = explode("\n", $this->comment);

        $current_annotation = null;
        $value = null;
        foreach ($lines as $line)
        {
            $line = trim(ltrim($line, "/* \t"));

            if (preg_match("/^@(\w+)( (.*))?$/", $line, $matches) === 1)
            {
                if (!empty($value))
                    $this->annotations[$current_annotation][] = $value;

                $current_annotation = $matches[1];
                $value = $matches[3] ?? '';
            }
            elseif ($current_annotation !== null)
            {
                $value .= "\n" . $line;
            }
            else
            {
                $this->preamble[] = $line;
            }
        }

        if (!empty($value))
            $this->annotations[$current_annotation][] = rtrim($value);
    }
protected function parse()
    {
        $lines = explode("\n", $this->comment);

        $current_annotation = null;
        $value = null;
        foreach ($lines as $line)
        {
            $line = trim(ltrim($line, "/* \t"));

            if (preg_match("/^@(\w+)( (.*))?$/", $line, $matches) === 1)
            {
                if (!empty($value))
                    $this->annotations[$current_annotation][] = $value;

                $current_annotation = $matches[1];
                $value = $matches[3] ?? '';
            }
            elseif ($current_annotation !== null)
            {
                $value .= "\n" . $line;
            }
            else
            {
                $this->preamble[] = $line;
            }
        }

        if (!empty($value))
            $this->annotations[$current_annotation][] = rtrim($value);
    }
protected function parse ( ) { $ lines = explode ( "\n" , $ this -> comment ) ; $ current_annotation = null ; $ value = null ; foreach ( $ lines as $ line ) { $ line = trim ( ltrim ( $ line , "/* \t" ) ) ; if ( preg_match ( "/^@(\w+)( (.*))?$/" , $ line , $ matches ) === 1 ) { if ( ! empty ( $ value ) ) $ this -> annotations [ $ current_annotation ] [ ] = $ value ; $ current_annotation = $ matches [ 1 ] ; $ value = $ matches [ 3 ] ?? '' ; } elseif ( $ current_annotation !== null ) { $ value .= "\n" . $ line ; } else { $ this -> preamble [ ] = $ line ; } } if ( ! empty ( $ value ) ) $ this -> annotations [ $ current_annotation ] [ ] = rtrim ( $ value ) ; }
Helper method that parses the doc comment
Helper method that parses the doc comment