/** * Extracts all tokens from this file and initializes the iterator used to * walk through this file. * * @param string $contents The text to parse into tokens. * @param string $filename The path of this file, if present. * * @return DocBlox_Token_Iterator */ public function initializeTokens($contents, $filename = null) { $tokens = token_get_all($contents); $this->debug(count($tokens) . ' tokens found in class ' . $this->getName()); $tokens = new DocBlox_Token_Iterator($tokens); if ($filename != null) { $tokens->setFilename($filename); } return $tokens; }
/** * Extracts all tokens from this file and initializes the iterator used to * walk through this file. * * @param string $contents The text to parse into tokens. * @param string $filename The path of this file, if present. * * @return DocBlox_Token_Iterator */ public function initializeTokens($contents, $filename = null) { $this->debug('Started splitting the file into tokens'); $tokens = token_get_all($contents); $this->debug(count($tokens) . ' tokens found in class ' . $this->getName()); $tokens = new DocBlox_Token_Iterator($tokens); if ($filename != null) { $tokens->setFilename($filename); } $this->debug('Imported tokens into the Iterator'); return $tokens; }