本文整理匯總了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);
});
}