예제 #1
0
 /**
  * Processes the parent reflection object.
  *
  * @param \TokenReflection\IReflection $parent Parent reflection object
  * @param \TokenReflection\Stream\StreamBase $tokenStream Token substream
  * @return \TokenReflection\ReflectionElement
  * @throws \TokenReflection\Exception\ParseException If an invalid parent reflection object was provided.
  */
 protected function processParent(IReflection $parent, Stream $tokenStream)
 {
     if (!$parent instanceof ReflectionFunctionBase) {
         throw new Exception\ParseException($this, $tokenStream, 'The parent object has to be an instance of TokenReflection\\ReflectionFunctionBase.', Exception\ParseException::INVALID_PARENT);
     }
     // Declaring function name
     $this->declaringFunctionName = $parent->getName();
     // Position
     $this->position = count($parent->getParameters());
     // Declaring class name
     if ($parent instanceof ReflectionMethod) {
         $this->declaringClassName = $parent->getDeclaringClassName();
     }
     return parent::processParent($parent, $tokenStream);
 }
예제 #2
0
 /**
  *
  * @param IReflection $reflection
  * @return string
  */
 protected static function getOperationParameters(IReflection $reflection)
 {
     $parameters = $reflection->getParameters();
     $operationsParameters = [];
     foreach ($parameters as $parameter) {
         $operationsParameters[] = $parameter->getName();
     }
     return implode(', ', $operationsParameters);
 }