private function DocParser::findInitialTokenPosition in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php \Doctrine\Common\Annotations\DocParser::findInitialTokenPosition()
Finds the first valid annotation
Parameters
string $input The docblock string to parse:
Return value
int|null
1 call to DocParser::findInitialTokenPosition()
- DocParser::parse in vendor/
doctrine/ annotations/ lib/ Doctrine/ Common/ Annotations/ DocParser.php - Parses the given docblock string for annotations.
File
- vendor/
doctrine/ annotations/ lib/ Doctrine/ Common/ Annotations/ DocParser.php, line 344
Class
- DocParser
- A parser for docblock annotations.
Namespace
Doctrine\Common\AnnotationsCode
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;
}