public function setRule(Rule $rule)
    {
        $expectedType = $this->getRuleType();
        
        if (Reflection::isInstanceOf($rule, $expectedType) === true) {
            $this->rule = $rule;
        } else {
            $procClass = get_class($this);
            $givenType = get_class($rule);
            $msg = "The ${procClass} Rule Processor only processes ${expectedType} Rule objects, ${givenType} given.";
            throw new InvalidArgumentException($msg);
        }
    }
public function setRule(Rule $rule)
    {
        $expectedType = $this->getRuleType();
        
        if (Reflection::isInstanceOf($rule, $expectedType) === true) {
            $this->rule = $rule;
        } else {
            $procClass = get_class($this);
            $givenType = get_class($rule);
            $msg = "The ${procClass} Rule Processor only processes ${expectedType} Rule objects, ${givenType} given.";
            throw new InvalidArgumentException($msg);
        }
    }
public function setRule ( Rule $ rule ) { $ expectedType = $ this -> getRuleType ( ) ; if ( Reflection :: isInstanceOf ( $ rule , $ expectedType ) === true ) { $ this -> rule = $ rule ; } else { $ procClass = get_class ( $ this ) ; $ givenType = get_class ( $ rule ) ; $ msg = "The ${procClass} Rule Processor only processes ${expectedType} Rule objects, ${givenType} given." ; throw new InvalidArgumentException ( $ msg ) ; } }
Set the QTI Data Model Rule object to be processed.

@param \qtism\runtime\rules\Rule $rule
@throws \InvalidArgumentException If $rule is not compliant with the rule processor implementation.
Set the QTI Data Model Rule object to be processed .