Пример #1
0
 /**
  * Creates a function code from Reflection
  *
  * @param ParsedFunction $function Reflection for function
  * @param string $body Body of function
  *
  * @return string
  */
 protected function getOverriddenFunction($function, $body)
 {
     static $inMemoryCache = array();
     $functionName = $function->getName();
     if (isset($inMemoryCache[$functionName])) {
         return $inMemoryCache[$functionName];
     }
     $code = preg_replace('/ {4}|\\t/', '', $function->getDocComment()) . "\n" . 'function ' . ($function->returnsReference() ? '&' : '') . $functionName . '(' . join(', ', $this->getParameters($function->getParameters())) . ")\n" . "{\n" . $this->indent($body) . "\n" . "}\n";
     $inMemoryCache[$functionName] = $code;
     return $code;
 }