You are here

public function ObjectManagerDecoratorTest::getMethodParameters in Plug 7

File

lib/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;
}