getParameters() public method

Replacement for the original getParameters() method which makes sure that ParameterReflection objects are returned instead of the original ReflectionParameter instances.
public getParameters ( ) : array
return array
 /**
  * @test
  */
 public function getParametersReturnsFlowsParameterReflection($dummyArg1 = null, $dummyArg2 = null)
 {
     $method = new Reflection\MethodReflection(__CLASS__, __FUNCTION__);
     foreach ($method->getParameters() as $parameter) {
         $this->assertInstanceOf(Reflection\ParameterReflection::class, $parameter);
         $this->assertEquals(__CLASS__, $parameter->getDeclaringClass()->getName());
     }
 }
Beispiel #2
0
 /**
  * @param string $className
  * @param \Neos\Flow\Reflection\MethodReflection $method
  * @return void
  */
 protected function reflectClassMethod($className, MethodReflection $method)
 {
     $methodName = $method->getName();
     if ($method->isFinal()) {
         $this->classReflectionData[$className][self::DATA_CLASS_METHODS][$methodName][self::DATA_METHOD_FINAL] = true;
     }
     if ($method->isStatic()) {
         $this->classReflectionData[$className][self::DATA_CLASS_METHODS][$methodName][self::DATA_METHOD_STATIC] = true;
     }
     $visibility = $method->isPublic() ? self::VISIBILITY_PUBLIC : ($method->isProtected() ? self::VISIBILITY_PROTECTED : self::VISIBILITY_PRIVATE);
     $this->classReflectionData[$className][self::DATA_CLASS_METHODS][$methodName][self::DATA_METHOD_VISIBILITY] = $visibility;
     foreach ($this->getMethodAnnotations($className, $methodName) as $methodAnnotation) {
         $annotationClassName = get_class($methodAnnotation);
         if (!isset($this->classesByMethodAnnotations[$annotationClassName][$className])) {
             $this->classesByMethodAnnotations[$annotationClassName][$className] = [];
         }
         $this->classesByMethodAnnotations[$annotationClassName][$className][] = $methodName;
     }
     $returnType = $method->getDeclaredReturnType();
     if ($returnType !== null) {
         $this->classReflectionData[$className][self::DATA_CLASS_METHODS][$methodName][self::DATA_METHOD_DECLARED_RETURN_TYPE] = $returnType;
     }
     foreach ($method->getParameters() as $parameter) {
         $this->reflectClassMethodParameter($className, $method, $parameter);
     }
 }