本文整理汇总了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);
}
}