/** * Set the mapping indicator to use between field name and field value when * displaying variables of record cardinality. * * @param string $mappingIndicator A non-empty string with at most 256 characters. * @throws InvalidArgumentException If $mappingIndicator is not a non-empty string with at most 256 characters. */ public function setMappingIndicator($mappingIndicator) { if (empty($mappingIndicator) === false && Format::isString256($mappingIndicator) === true) { $this->mappingIndicator = $mappingIndicator; } else { $msg = "The 'mappingIndicator' argument must be a non-empty string with at most 256 characters, '" . gettype($mappingIndicator) . "' given."; throw new InvalidArgumentException($msg); } }
/** * Set the label of the body element. * * @param string $label A string of 256 characters maximum. * @throws \InvalidArgumentException If $label is not or a string or contains more than 256 characters. */ public function setLabel($label = '') { if (Format::isString256($label) === true) { $this->label = $label; } else { $msg = "The 'label' argument must be a string that does not exceed 256 characters."; throw new InvalidArgumentException($msg); } }
/** * @dataProvider invalidString256FormatProvider */ public function testInvalidString256Provider($string) { $this->assertFalse(Format::isString256($string)); }
/** * Set the hotspotLabel of the associableHotspot. * * @param string $hotspotLabel A string with at most 256 characters. * @throws \InvalidArgumentException If $hotspotLabel has more than 256 characters. */ public function setHotspotLabel($hotspotLabel) { if (Format::isString256($hotspotLabel) === true) { $this->hotspotLabel = $hotspotLabel; } else { $msg = "The 'hotspotLabel' argument must be a string value with at most 256 characters."; throw new InvalidArgumentException($msg); } }
/** * Set the version of the tool with which the item was created. * * @param string $toolVersion A tool version with at most 256 characters. * @throws InvalidArgumentException If $toolVersion is not a string value with at most 256 characters. */ public function setToolVersion($toolVersion) { if (Format::isString256($toolVersion) === true) { $this->toolVersion = $toolVersion; } else { $msg = "The toolVersion argument must be a string with at most 256 characters."; throw new InvalidArgumentException($msg); } }