phprs\util\DocParser::findInitialTokenPosition PHP Method

findInitialTokenPosition() private method

Finds the first valid annotation
private findInitialTokenPosition ( string $input ) : integer | null
$input string The docblock string to parse
return integer | null
    private function findInitialTokenPosition($input)
    {
        $pos = 0;
        // search for first valid annotation
        while (($pos = strpos($input, '@', $pos)) !== false) {
            // if the @ is preceded by a space or * it is valid
            if ($pos === 0 || $input[$pos - 1] === ' ' || $input[$pos - 1] === '*') {
                return $pos;
            }
            $pos++;
        }
        return null;
    }