本文整理匯總了PHP中qtism\common\utils\Format::isString256方法的典型用法代碼示例。如果您正苦於以下問題:PHP Format::isString256方法的具體用法?PHP Format::isString256怎麽用?PHP Format::isString256使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類qtism\common\utils\Format
的用法示例。
在下文中一共展示了Format::isString256方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setMappingIndicator
/**
* 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);
}
}
示例2: setLabel
/**
* 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);
}
}
示例3: testInvalidString256Provider
/**
* @dataProvider invalidString256FormatProvider
*/
public function testInvalidString256Provider($string)
{
$this->assertFalse(Format::isString256($string));
}
示例4: setHotspotLabel
/**
* 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);
}
}
示例5: setToolVersion
/**
* 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);
}
}