OEModule\PASAPI\resources\BaseResource::getInstanceForClass PHP Method

getInstanceForClass() protected method

Abstraction for getting instance of class.
protected getInstanceForClass ( $class, $args = [] ) : mixed
$class
return mixed
    protected function getInstanceForClass($class, $args = array())
    {
        if (empty($args)) {
            return new $class();
        }
        $cls = new ReflectionClass($class);
        return $cls->newInstanceArgs($args);
    }