Ouzo\Utilities\Functions::notInArray PHP Méthode

notInArray() public static méthode

public static notInArray ( $array )
    public static function notInArray($array)
    {
        return function ($value) use($array) {
            return !in_array($value, $array);
        };
    }

Usage Example

Exemple #1
0
 /**
  * @test
  */
 public function shouldCheckIsNotInArray()
 {
     //given
     $array = array('white', 'snow');
     //when
     $result = Functions::call(Functions::notInArray($array), 'missing');
     //then
     $this->assertTrue($result);
 }