Ejemplo n.º 1
0
 /**
  * @param ClassReflectionInterface|ParameterReflectionInterface|FunctionReflectionInterface $reflectionElement
  * @return ClassReflectionInterface|FunctionReflectionInterface
  */
 private function correctContextForParameterOrClassMember($reflectionElement)
 {
     if ($reflectionElement instanceof ParameterReflectionInterface && $reflectionElement->getDeclaringClassName() === null) {
         // Parameter of function in namespace or global space
         return $this->getFunction($reflectionElement->getDeclaringFunctionName());
     } elseif ($reflectionElement instanceof InClassInterface) {
         // Member of a class
         return $this->getClass($reflectionElement->getDeclaringClassName());
     }
     return $reflectionElement;
 }
Ejemplo n.º 2
0
 /**
  * @return string
  */
 private function getFunctionFqnName(FunctionReflectionInterface $reflection)
 {
     return $reflection->getNamespaceName() . '\\' . $reflection->getName();
 }
Ejemplo n.º 3
0
 /**
  * @return string
  */
 public function createForFunction(FunctionReflectionInterface $function)
 {
     return sprintf($this->configuration->getOption(CO::TEMPLATE)['templates']['function']['filename'], Filters::urlize($function->getName()));
 }