public static function getInstance(RuleProviderInterface $ruleProvider)
    {
        if (func_num_args() > 1) {
            throw new BadMethodCallException(
                'Method allows only one argument (a rule provider), passing options would void warranty'
                . ' that requested and returned instance are effectvely identical, saw secondary argument type['
                . Utils::getType(func_get_arg(1)) . '].'
            );
        }
        $provider_class = get_class($ruleProvider);
        return static::$instanceByValidateClass[$provider_class] ??
            (static::$instanceByValidateClass[$provider_class] = new static($ruleProvider));
    }
public static function getInstance(RuleProviderInterface $ruleProvider)
    {
        if (func_num_args() > 1) {
            throw new BadMethodCallException(
                'Method allows only one argument (a rule provider), passing options would void warranty'
                . ' that requested and returned instance are effectvely identical, saw secondary argument type['
                . Utils::getType(func_get_arg(1)) . '].'
            );
        }
        $provider_class = get_class($ruleProvider);
        return static::$instanceByValidateClass[$provider_class] ??
            (static::$instanceByValidateClass[$provider_class] = new static($ruleProvider));
    }
public static function getInstance ( RuleProviderInterface $ ruleProvider ) { if ( func_num_args ( ) > 1 ) { throw new BadMethodCallException ( 'Method allows only one argument (a rule provider), passing options would void warranty' . ' that requested and returned instance are effectvely identical, saw secondary argument type[' . Utils :: getType ( func_get_arg ( 1 ) ) . '].' ) ; } $ provider_class = get_class ( $ ruleProvider ) ; return static :: $ instanceByValidateClass [ $ provider_class ] ?? ( static :: $ instanceByValidateClass [ $ provider_class ] = new static ( $ ruleProvider ) ) ; }
First object instantiated via this method, using that rule provider,
disregarding which ValidateAgainstRuleSet class called on.

Does not allow constructor $options argument because that would affect
instance state, voiding the warranty that the requested and referred
returned instances are effectively identical.

@see Validate::challenge()

@param RuleProviderInterface $ruleProvider

@return ValidateAgainstRuleSet
static, really, but IDE might not resolve that.

@throws BadMethodCallException
If passed more than one argument.
First object instantiated via this method using that rule provider disregarding which ValidateAgainstRuleSet class called on .