src/VCR/VCRFactory.php
public function getOrCreate($className, $params = array())
    {
        $key = $className . join('-', $params);

        if (isset($this->mapping[$key])) {
            return $this->mapping[$key];
        }

        if (method_exists($this, $this->getMethodName($className))) {
            $callback = array($this, $this->getMethodName($className));
            $instance =  call_user_func_array($callback, $params);
        } else {
            $instance = new $className;
        }

        return $this->mapping[$key] = $instance;
    }
public function getOrCreate($className, $params = array())
    {
        $key = $className . join('-', $params);

        if (isset($this->mapping[$key])) {
            return $this->mapping[$key];
        }

        if (method_exists($this, $this->getMethodName($className))) {
            $callback = array($this, $this->getMethodName($className));
            $instance =  call_user_func_array($callback, $params);
        } else {
            $instance = new $className;
        }

        return $this->mapping[$key] = $instance;
    }
public function getOrCreate ( $ className , $ params = array ( ) ) { $ key = $ className . join ( '-' , $ params ) ; if ( isset ( $ this -> mapping [ $ key ] ) ) { return $ this -> mapping [ $ key ] ; } if ( method_exists ( $ this , $ this -> getMethodName ( $ className ) ) ) { $ callback = array ( $ this , $ this -> getMethodName ( $ className ) ) ; $ instance = call_user_func_array ( $ callback , $ params ) ; } else { $ instance = new $ className ; } return $ this -> mapping [ $ key ] = $ instance ; }
Returns an instance for specified classname and parameters.

@param string $className Class name to get a instance for.
@param array $params Constructor arguments for this class.

@return mixed
Returns an instance for specified classname and parameters .