本文整理汇总了PHP中Ouzo\Utilities\Arrays::any方法的典型用法代码示例。如果您正苦于以下问题:PHP Arrays::any方法的具体用法?PHP Arrays::any怎么用?PHP Arrays::any使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ouzo\Utilities\Arrays
的用法示例。
在下文中一共展示了Arrays::any方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: join
public function join()
{
$any = Arrays::any($this->_query->joinClauses, function (JoinClause $joinClause) {
return Strings::equalsIgnoreCase($joinClause->type, 'RIGHT');
});
if ($any) {
throw new BadMethodCallException('RIGHT JOIN is not supported in sqlite3');
}
return parent::join();
}
示例2: _buildWhereKeyIn
private static function _buildWhereKeyIn($column, array $array)
{
$useRestrictions = Arrays::any($array, Functions::isInstanceOf('\\Ouzo\\Restriction\\Restriction'));
if ($useRestrictions) {
return DialectUtil::joinClauses($array, 'OR', function (Restriction $restriction) use($column) {
return $restriction->toSql($column);
});
}
$in = implode(', ', array_fill(0, count($array), '?'));
return $column . ' IN (' . $in . ')';
}
示例3: excludes
public function excludes()
{
$elements = func_get_args();
$currentArray = $this->actual;
$foundElement = '';
$anyFound = Arrays::any($elements, function ($element) use($currentArray, &$foundElement) {
$checkInArray = Arrays::contains($currentArray, $element);
if ($checkInArray) {
$foundElement = $element;
}
return $checkInArray;
});
AssertAdapter::assertFalse($anyFound, "Found element {$foundElement} in array {$this->actualString}");
return $this;
}
示例4: isAlreadyAddedToFetch
private function isAlreadyAddedToFetch(RelationToFetch $relationToFetch)
{
return Arrays::any($this->_relationsToFetch, RelationToFetch::equalsPredicate($relationToFetch));
}
示例5: whereClauseNeverSatisfied
private static function whereClauseNeverSatisfied($whereClauses)
{
return Arrays::any($whereClauses, function (WhereClause $whereClause) {
return $whereClause->isNeverSatisfied();
});
}
示例6: shouldCheckIsAnyIsBool
/**
* @test
*/
public function shouldCheckIsAnyIsBool()
{
//given
$array = array('a', true, 'c');
//when
$any = Arrays::any($array, function ($element) {
return is_bool($element);
});
//then
$this->assertTrue($any);
}
示例7: existRouteRule
private static function existRouteRule($methods, $uri)
{
$routeKeys = Route::$routeKeys;
return Arrays::any($methods, function ($method) use($routeKeys, $uri) {
return Arrays::keyExists($routeKeys, $method . $uri);
});
}