public function contains($needle, ?string $key = null) : bool
    {
        $value = $this->get($key);

        if (!is_array($value)) {
            throw new InvalidArgumentException(
                'method contains() should be called on array'
            );
        }

        return in_array($needle, $value);
    }
public function contains($needle, ?string $key = null) : bool
    {
        $value = $this->get($key);

        if (!is_array($value)) {
            throw new InvalidArgumentException(
                'method contains() should be called on array'
            );
        }

        return in_array($needle, $value);
    }
public function contains ( $ needle , ? string $ key = null ) : bool { $ value = $ this -> get ( $ key ) ; if ( ! is_array ( $ value ) ) { throw new InvalidArgumentException ( 'method contains() should be called on array' ) ; } return in_array ( $ needle , $ value ) ; }
Checks if response contains value.

@param mixed       $needle
@param string|null $key

@return bool
Checks if response contains value .