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