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


PHP Assertion::allInArray方法代碼示例

本文整理匯總了PHP中Assert\Assertion::allInArray方法的典型用法代碼示例。如果您正苦於以下問題:PHP Assertion::allInArray方法的具體用法?PHP Assertion::allInArray怎麽用?PHP Assertion::allInArray使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Assert\Assertion的用法示例。


在下文中一共展示了Assertion::allInArray方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: guardOptions

 private function guardOptions($options, $constraints)
 {
     Assertion::allInArray(array_keys($options), array_keys($constraints));
     foreach ($options as $key => $value) {
         $constraint = $constraints[$key];
         if (is_callable($constraint)) {
             call_user_func($constraint, $value);
         }
     }
 }
開發者ID:armetiz,項目名稱:tapfiliate-php,代碼行數:10,代碼來源:Tapfiliate.php

示例2: validate

 private function validate()
 {
     Assertion::nullOrString($this->logMessageRegExp);
     Assertion::nullOrString($this->logMessageInString);
     Assertion::nullOrString($this->logContextFuzzy);
     Assertion::nullOrIsInstanceOf($this->logTimeLowerBounds, DateTimeInterface::class);
     Assertion::nullOrIsInstanceOf($this->logTimeUpperBounds, DateTimeInterface::class);
     Assertion::nullOrIsArray($this->logLevelList);
     if (!is_null($this->logLevelList)) {
         Assertion::notEmpty($this->logLevelList);
         Assertion::allInArray($this->logLevelList, array_values((new ReflectionClass(LogLevel::class))->getConstants()));
     }
     if (!is_null($this->logMessageRegExp)) {
         Assertion::true(RegexGuardFactory::getGuard()->isRegexValid($this->logMessageRegExp));
     }
     if (!is_null($this->logTimeLowerBounds) && !is_null($this->logTimeUpperBounds)) {
         Assertion::false($this->logTimeLowerBounds->diff($this->logTimeUpperBounds)->invert);
     }
 }
開發者ID:metasyntactical,項目名稱:inmemory-logger,代碼行數:19,代碼來源:LogQuery.php

示例3: validateNames

 /**
  * @Then I should see the following names:
  *
  * @param TableNode $table
  */
 public function validateNames(TableNode $table)
 {
     $list = array_column($table->getHash(), 'username');
     Assertion::allInArray($this->filterResult, $list);
     Assertion::count($this->filterResult, count($list));
 }
開發者ID:sententiaregum,項目名稱:sententiaregum,代碼行數:11,代碼來源:UsersContext.php


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