本文整理汇总了PHP中Webmozart\Assert\Assert::isArray方法的典型用法代码示例。如果您正苦于以下问题:PHP Assert::isArray方法的具体用法?PHP Assert::isArray怎么用?PHP Assert::isArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Webmozart\Assert\Assert
的用法示例。
在下文中一共展示了Assert::isArray方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: validateTuples
/**
* @param array $setTuples
* @param int $countTuples
*
* @return array
*
* @throws \InvalidArgumentException
*/
private function validateTuples(array $setTuples, $countTuples)
{
Assert::notEq(0, $countTuples, 'The set builder requires a single array of one or more array sets.1');
foreach ($setTuples as $tuple) {
Assert::isArray($tuple, 'The set builder requires a single array of one or more array sets.');
}
return $setTuples;
}
示例2: findBy
/**
* @param RepositoryInterface $repository
* @param string $field
*
* @return \Closure
*/
public static function findBy(RepositoryInterface $repository, $field)
{
return function (Options $options, $previousValues) use($repository, $field) {
if (null === $previousValues || [] === $previousValues) {
return $previousValues;
}
Assert::isArray($previousValues);
$resources = [];
foreach ($previousValues as $previousValue) {
if (is_object($previousValue)) {
$resources[] = $previousValue;
} else {
$resources[] = $repository->findOneBy([$field => $previousValue]);
}
}
return $resources;
};
}
示例3: getCollectionItems
/**
* @param string $collection
*
* @return NodeElement[]
*/
private function getCollectionItems($collection)
{
$items = $this->getElement($collection)->findAll('css', 'div[data-form-collection="item"]');
Assert::isArray($items);
return $items;
}
示例4: assertValidDca
/**
* Assert that an valid dca is loaded.
*
* @param string $name Dca name.
*
* @return void
*
* @SuppressWarnings(PHPMD.Superglobals)
*/
protected function assertValidDca($name)
{
Assert::keyExists($GLOBALS['TL_DCA'], $name);
Assert::isArray($GLOBALS['TL_DCA'][$name]);
}
示例5: __construct
public function __construct($scope)
{
Assert::isArray($scope);
$this->scope = $scope;
}