all() public static method

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
return boolean
Ejemplo n.º 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);
     });
 }
Ejemplo n.º 2
0
 public function isNeverSatisfied()
 {
     return Arrays::all($this->conditions, function (WhereClause $where) {
         return $where->isNeverSatisfied();
     });
 }
Ejemplo n.º 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);
 }