Doctrine\Common\Annotations\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) {
            $preceding = substr($input, $pos - 1, 1);
            // if the @ is preceded by a space, a tab or * it is valid
            if ($pos === 0 || $preceding === ' ' || $preceding === '*' || $preceding === "\t") {
                return $pos;
            }
            $pos++;
        }
        return null;
    }