Ejemplo n.º 1
0
 /**
  * Returns an array of reflection parameter instances from the passed reflection method.
  *
  * @param \AppserverIo\Lang\Reflection\ReflectionMethod $reflectionMethod The reflection method to return the parameters for
  *
  * @return array An array with ReflectionParameter instances
  */
 public static function fromReflectionMethod(ReflectionMethod $reflectionMethod)
 {
     // initialize the array for the reflection parameters
     $reflectionParameters = array();
     // load the reflection parameters and initialize the array with the reflection parameters
     $phpReflectionMethod = $reflectionMethod->toPhpReflectionMethod();
     foreach ($phpReflectionMethod->getParameters() as $phpReflectionParameter) {
         $reflectionParameters[$phpReflectionParameter->getName()] = ReflectionParameter::fromPhpReflectionParameter($phpReflectionParameter);
     }
     // return the array with the initialized reflection parameters
     return $reflectionParameters;
 }
Ejemplo n.º 2
0
 /**
  * Creates a new reflection method instance from the passed PHP reflection method.
  *
  * @param \ReflectionMethod $reflectionMethod    The reflection method to load the data from
  * @param array             $annotationsToIgnore An array with annotations names we want to ignore when loaded
  * @param array             $annotationAliases   An array with annotation aliases used when create annotation instances
  *
  * @return \AppserverIo\Lang\Reflection\ReflectionMethod The instance
  */
 public static function fromPhpReflectionMethod(\ReflectionMethod $reflectionMethod, array $annotationsToIgnore = array(), array $annotationAliases = array())
 {
     // load class and method name from the reflection class
     $className = $reflectionMethod->getDeclaringClass()->getName();
     $methodName = $reflectionMethod->getName();
     // initialize and return the timeout method instance
     return new ReflectionMethod($className, $methodName, $annotationsToIgnore, $annotationAliases);
 }
Ejemplo n.º 3
0
 /**
  * Returns the class methods.
  *
  * @param integer $filter Filter the results to include only methods with certain attributes
  *
  * @return array The class methods
  * @see \AppserverIo\Lang\Reflection\ClassInterface::getMethods()
  * @link http://php.net/manual/en/reflectionclass.getmethods.php
  */
 public function getMethods($filter = ReflectionProperty::ALL_MODIFIERS)
 {
     // check if the methods for the requested filter has been loaded
     if (isset($this->methods[$filter]) === false) {
         $this->methods[$filter] = ReflectionMethod::fromReflectionClass($this, $filter, $this->getAnnotationsToIgnore(), $this->getAnnotationAliases());
     }
     // return the requested method
     return $this->methods[$filter];
 }