Lines Matching refs:tokens

72         $tokens = new \ArrayIterator(token_get_all($fileContents));
74 while ($tokens->valid()) {
75 switch ($tokens->current()[0]) {
77 $currentNamespace = $this->parseNamespace($tokens);
85 while ($tokens->valid() && ($braceLevel > 0 || !$firstBraceFound)) {
86 if ($tokens->current() === '{'
87 || $tokens->current()[0] === T_CURLY_OPEN
88 || $tokens->current()[0] === T_DOLLAR_OPEN_CURLY_BRACES) {
95 if ($tokens->current() === '}') {
98 $tokens->next();
103 … $useStatements = array_merge($useStatements, $this->parseUseStatement($tokens));
107 $tokens->next();
120 private function parseNamespace(\ArrayIterator $tokens) argument
123 $this->skipToNextStringOrNamespaceSeparator($tokens);
126 …while ($tokens->valid() && ($tokens->current()[0] === T_STRING || $tokens->current()[0] === T_NS_S…
128 $name .= $tokens->current()[1];
129 $tokens->next();
142 private function parseUseStatement(\ArrayIterator $tokens) argument
148 $this->skipToNextStringOrNamespaceSeparator($tokens);
150 list($alias, $fqnn) = $this->extractUseStatement($tokens);
152 if ($tokens->current()[0] === self::T_LITERAL_END_OF_USE) {
167 private function skipToNextStringOrNamespaceSeparator(\ArrayIterator $tokens) argument
169 …while ($tokens->valid() && ($tokens->current()[0] !== T_STRING) && ($tokens->current()[0] !== T_NS…
170 $tokens->next();
182 private function extractUseStatement(\ArrayIterator $tokens) argument
185 while ($tokens->valid()
186 && ($tokens->current()[0] !== self::T_LITERAL_USE_SEPARATOR)
187 && ($tokens->current()[0] !== self::T_LITERAL_END_OF_USE)
189 if ($tokens->current()[0] === T_AS) {
192 if ($tokens->current()[0] === T_STRING || $tokens->current()[0] === T_NS_SEPARATOR) {
193 $result[count($result) - 1] .= $tokens->current()[1];
195 $tokens->next();