all() 공개 정적인 메소드

Example: $array = array(1, 2); $all = Arrays::all($array, function ($element) { return $element < 3; }); Result: true
public static all ( array $elements, callable $predicate ) : boolean
$elements array
$predicate callable
리턴 boolean
예제 #1
0
 /**
  * @return bool
  */
 public function isShittyRound()
 {
     $hitsInRound = Hit::where(['game_user_id' => $this->game->current_game_user_id, 'round' => $this->game->round])->fetchAll();
     return Arrays::all($hitsInRound, function ($hit) {
         return !$this->isScored($hit->field, $hit->multiplier);
     });
 }
예제 #2
0
파일: OrClause.php 프로젝트: letsdrink/ouzo
 public function isNeverSatisfied()
 {
     return Arrays::all($this->conditions, function (WhereClause $where) {
         return $where->isNeverSatisfied();
     });
 }
예제 #3
0
 /**
  * @test
  */
 public function shouldReturnFalseIfNotAllElementSatisfyPredicate()
 {
     //given
     $array = array(1, 2, 3);
     //when
     $all = Arrays::all($array, function ($element) {
         return $element < 3;
     });
     //then
     $this->assertFalse($all);
 }