/** * 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); }