You are here

public function ObjectManagerDecoratorTest::getMethodParameters in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/ObjectManagerDecoratorTest.php \Doctrine\Tests\Common\Persistence\ObjectManagerDecoratorTest::getMethodParameters()

File

vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/ObjectManagerDecoratorTest.php, line 27

Class

ObjectManagerDecoratorTest

Namespace

Doctrine\Tests\Common\Persistence

Code

public function getMethodParameters() {
  $class = new \ReflectionClass('Doctrine\\Common\\Persistence\\ObjectManager');
  $methods = array();
  foreach ($class
    ->getMethods() as $method) {
    if ($method
      ->getNumberOfRequiredParameters() === 0) {
      $methods[] = array(
        $method
          ->getName(),
        array(),
      );
    }
    elseif ($method
      ->getNumberOfRequiredParameters() > 0) {
      $methods[] = array(
        $method
          ->getName(),
        array_fill(0, $method
          ->getNumberOfRequiredParameters(), 'req') ?: array(),
      );
    }
    if ($method
      ->getNumberOfParameters() != $method
      ->getNumberOfRequiredParameters()) {
      $methods[] = array(
        $method
          ->getName(),
        array_fill(0, $method
          ->getNumberOfParameters(), 'all') ?: array(),
      );
    }
  }
  return $methods;
}