/** * Check if $value is a QTI Runtime compliant value. * * @throws InvalidArgumentException If $value is not a QTI Runtime compliant value. */ protected function checkType($value) { if (RuntimeUtils::isRuntimeCompliant($value)) { return; } else { if ($value instanceof MultipleContainer || $value instanceof OrderedContainer || $value instanceof RecordContainer) { return; } else { $value = gettype($value) === 'object' ? get_class($value) : $value; $msg = "The OperandsCollection only accepts QTI Runtime compliant values, '" . $value . "' given."; throw new InvalidArgumentException($msg); } } }
protected function checkType($value) { if (!Utils::isRuntimeCompliant($value)) { Utils::throwTypingError($value); } }