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