コード例 #1
0
 /**
  * If a method startline was found in the current line
  * @param array $methodMatches (regex matches)
  * @throws Tx_ExtensionBuilder_Exception_ParseError
  * @return void
  */
 protected function onMethodFound($methodMatches)
 {
     $this->inMethodBody = TRUE;
     $methodName = $methodMatches['methodName'][0];
     try {
         // the method has to exist in the classReflection
         $this->currentMethod['reflection'] = $this->classReflection->getMethod($methodName);
         if ($this->currentMethod['reflection']) {
             $classMethod = new Tx_ExtensionBuilder_Domain_Model_Class_Method($methodName, $this->currentMethod['reflection']);
             $precedingBlock = $this->concatLinesFromArray($this->lines, $this->lastMatchedLineNumber, NULL, FALSE);
             $classMethod->setPrecedingBlock($precedingBlock);
             $this->currentMethod['methodObject'] = $classMethod;
         } else {
             throw new Tx_ExtensionBuilder_Exception_ParseError('Method ' . $methodName . ' does not exist. Parsed from line ' . $this->lineCount . 'in ' . $this->classReflection->getFileName());
         }
     } catch (ReflectionException $e) {
         // ReflectionClass throws an exception if a method was not found
         t3lib_div::devlog('Exception: ' . $e->getMessage(), 'extension_builder', 2);
     }
 }