Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
crazyfactory/phpunit-extensions / src / TestCaseHelper.php
Size: Mime:
<?php

namespace CrazyFactory\PHPUnitExtensions;

use ReflectionClass;
use ReflectionParameter;

class TestCaseHelper
{

    /**
     * @param string $class
     * @param string $method
     * @param int $paramPosition
     * @return ReflectionParameter|null
     * @throws \ReflectionException
     */
    public static function getParam(string $class, string $method, int $paramPosition): ?ReflectionParameter
    {
        return (new ReflectionClass($class))
                ->getMethod($method)
                ->getParameters()[$paramPosition]
            ?? null;
    }
}