/** * Returns the method parameters. * * @return array The method parameters * @see \AppserverIo\Lang\Reflection\MethodInterface::getParameters() */ public function getParameters() { // check if the parameters has been loaded if (isset($this->parameters) === false) { $this->parameters = ReflectionParameter::fromReflectionMethod($this); } // return the parameters return $this->parameters; }
/** * Creates a new reflection parameter instance from the passed PHP reflection parameter. * * @param \ReflectionParameter $reflectionParameter The reflection parameter to load the data from * * @return \AppserverIo\Lang\Reflection\ReflectionParameter The instance */ public static function fromPhpReflectionParameter(\ReflectionParameter $reflectionParameter) { // load class, method and parameter name from the reflection parameter $className = $reflectionParameter->getDeclaringClass()->getName(); $methodName = $reflectionParameter->getDeclaringFunction()->getName(); $parameterName = $reflectionParameter->getName(); // initialize and return the parameter instance return new ReflectionParameter($className, $methodName, $parameterName); }