public function testGetLineNumber() { $this->assertEquals(100, $this->fixture->getLineNumber()); }
protected function processToken(DocBlox_Token $token, DocBlox_TokenIterator $tokens) { static $token_method_exists_cache = array(); // cache method name; I expect to find this a lot $token_name = $token->getName(); if (!isset(self::$token_method_cache[$token_name])) { self::$token_method_cache[$token_name] = 'process'.str_replace(' ', '', ucwords(strtolower(substr(str_replace('_', ' ', $token_name), 2)))); } // cache the method_exists calls to speed up processing $method_name = self::$token_method_cache[$token_name]; if (!isset($token_method_exists_cache[$method_name])) { $token_method_exists_cache[$method_name] = method_exists($this, $method_name); } // if method exists; parse the token if ($token_method_exists_cache[$method_name]) { $this->$method_name($tokens); } }