當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Assertion::allScalar方法代碼示例

本文整理匯總了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);
 }
開發者ID:luisbrito,項目名稱:Phraseanet,代碼行數:19,代碼來源:Field.php

示例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]);
 }
開發者ID:refinery29,項目名稱:newrelic,代碼行數:8,代碼來源:Agent.php


注:本文中的Assert\Assertion::allScalar方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。