/** * Set the source of the error. * * @param Processable $source The source of the error. * @throws InvalidArgumentException If $source is not an ExpressionProcessor object. */ public function setSource(Processable $source) { if ($source instanceof RuleProcessor) { parent::setSource($source); } else { $msg = "RuleProcessingException::setSource only accept RuleProcessor objects."; throw new InvalidArgumentException($msg); } }
/** * Set the source of the error. * * @param \qtism\runtime\common\Processable $source The source of the error. * @throws \InvalidArgumentException If $source is not a PrintedVariableEngine object. */ public function setSource(Processable $source) { if ($source instanceof PrintedVariableEngine) { parent::setSource($source); } else { $msg = "PrintedVariableProcessingException::setSource only accepts PrintedVariableEngine objects."; throw new InvalidArgumentException($msg); } }