本文整理匯總了PHP中Assert\Assertion::allScalar方法的典型用法代碼示例。如果您正苦於以下問題:PHP Assertion::allScalar方法的具體用法?PHP Assertion::allScalar怎麽用?PHP Assertion::allScalar使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Assert\Assertion
的用法示例。
在下文中一共展示了Assertion::allScalar方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
public function __construct($name, $type, array $options = [])
{
$this->name = (string) $name;
$this->type = $type;
$this->is_searchable = \igorw\get_in($options, ['searchable'], true);
$this->is_private = \igorw\get_in($options, ['private'], false);
$this->facet = \igorw\get_in($options, ['facet']);
$this->thesaurus_roots = \igorw\get_in($options, ['thesaurus_roots'], null);
$this->used_by_collections = \igorw\get_in($options, ['used_by_collections'], []);
Assertion::boolean($this->is_searchable);
Assertion::boolean($this->is_private);
if ($this->facet !== self::FACET_DISABLED) {
Assertion::integer($this->facet);
}
if ($this->thesaurus_roots !== null) {
Assertion::allIsInstanceOf($this->thesaurus_roots, Concept::class);
}
Assertion::allScalar($this->used_by_collections);
}
示例2: recordCustomEvent
public function recordCustomEvent($name, array $attributes)
{
Assertion::string($name);
Assertion::notBlank($name);
Assertion::allString(array_keys($attributes));
Assertion::allScalar(array_values($attributes));
$this->handle('newrelic_record_custom_event', [$name, $attributes]);
}