/** * @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; }
/** * @return string */ private function getFunctionFqnName(FunctionReflectionInterface $reflection) { return $reflection->getNamespaceName() . '\\' . $reflection->getName(); }
/** * @return string */ public function createForFunction(FunctionReflectionInterface $function) { return sprintf($this->configuration->getOption(CO::TEMPLATE)['templates']['function']['filename'], Filters::urlize($function->getName())); }