Neos\Flow\Reflection\ClassReflection::getMethods PHP Метод

getMethods() публичный Метод

Replacement for the original getMethods() method which makes sure that MethodReflection objects are returned instead of the original ReflectionMethod instances.
public getMethods ( integer $filter = null ) : MethodReflection
$filter integer A filter mask
Результат MethodReflection Method reflection objects of the methods in this class
    public function getMethods($filter = null)
    {
        $extendedMethods = [];
        $methods = $filter === null ? parent::getMethods() : parent::getMethods($filter);
        foreach ($methods as $method) {
            $extendedMethods[] = new MethodReflection($this->getName(), $method->getName());
        }
        return $extendedMethods;
    }

Usage Example

 /**
  * @test
  */
 public function getMethodsReturnsArrayWithNumericIndex()
 {
     $class = new ClassReflection(__CLASS__);
     $methods = $class->getMethods();
     foreach (array_keys($methods) as $key) {
         $this->assertInternalType('integer', $key, 'The index was not an integer.');
     }
 }