Check whether a tunnel is already open.

@param array $tunnel

@return bool|array
171755
protected function isTunnelOpen(array $tunnel)
    {
        foreach ($this->getTunnelInfo() as $info) {
            if ($this->tunnelsAreEqual($tunnel, $info)) {
                /** @noinspection PhpComposerExtensionStubsInspection */
                if (isset($info['pid']) && function_exists('posix_kill') && !posix_kill($info['pid'], 0)) {
                    $this->debug(sprintf(
                        'The tunnel at port %d is no longer open, removing from list',
                        $info['localPort']
                    ));
                    $this->closeTunnel($info);
                    continue;
                }

                return $info;
            }
        }

        return false;
    }
1271909
public static function isIndexed(array $array)
    {
        $i = 0;
        foreach (array_keys($array) as $k) {
            if ($k !== $i) {
                return false;
            }
            $i++;
        }
        return true;
    }
871891
private function isAssoc($array) {
	$allIntegerKeys = true;
	foreach ($array as $key => $value) {
		if(!is_integer($key)) {
			$allIntegerKeys = false;
			break;
		}
	}

	return $allIntegerKeys === false;
}
1243092
public static function isSequential(array $array)
    {
        $count = count($array);

        for ($i = 0; $i < $count; $i++) {
            if (!isset($array[$i]) && !array_key_exists($i, $array)) {
                return false;
            }
        }

        return true;
    }
518707
protected static function isSomeArr($models) {
        if (!is_array($models)) {
            return false;
        }
        $model = reset($models);
        return is_array($model) || $model instanceof Model;
    }
1246567
public static function isAssociative($array)
	{
		if (\is_array($array))
		{
			foreach (array_keys($array) as $k => $v)
			{
				if ($k !== $v)
				{
					return true;
				}
			}
		}

		return false;
	}
14191
private function isAssociative(array $array)
    {
        if ($array === []) {
            return false;
        }

        $expected = 0;

        foreach ($array as $key => $_) {
            if ($key !== $expected++) {
                return true;
            }
        }

        return false;
    }
1252040
public static function isList(array $array): bool
	{
		$count = count($array);

		$range = $count
			? range(0, $count - 1)
			: [];

		$keys = array_keys($array);

		return $keys === $range;
	}
445624
public static function has($array, $key)
    {
        if (empty($array) || null === $key) {
            return false;
        }

        if (array_key_exists($key, $array)) {
            return true;
        }

        foreach (explode('.', $key) as $segment) {
            if ((\is_array($array) && array_key_exists($segment, $array)) || ($array instanceof \ArrayAccess && $array->offsetExists($segment))) {
                $array = $array[$segment];
            } else {
                return false;
            }
        }

        return true;
    }
70786
public static function isAssoc(array $array): bool
    {
        if (empty($array)) {
            return false;
        }

        foreach (array_keys($array) as $key) {
            if (\is_string($key)) {
                return true;
            }
        }

        return false;
    }
789321
public static function has( $array, $key )
	{
		if ( !$array )
			return false;

		if ( is_null( $key ) )
			return false;

		if ( static::exists( $array, $key ) )
			return true;

		foreach ( explode( '.', $key ) as $segment )
			if ( static::accessible( $array ) && static::exists( $array, $segment ) )
				$array = $array[$segment];
			else
				return false;

		return true;
	}
240089
public static function keysExist(array $arr /*, $key1, $key2, etc...*/){
		
		for($i = 1, $l = \func_num_args() - 1; $i <= $l; ++$i){
			if(!\array_key_exists(\func_get_arg($i), $arr)){
				return false;
			}
		}
		
		return true;
		
	}
727210
public function isSequentialArray($array)
    {
        $counter = 0;
        foreach ($array as $key => $value) {
            if ($counter !== $key) {
                return false;
            }
            $counter++;
        }

        return true;
    }
46775
public static function canBeUsedForRequest(Request $request)
    {
        $hasChunkParams = $request->has(static::KEY_CHUNK_NUMBER)
                          && $request->has(static::KEY_TOTAL_SIZE)
                          && $request->has(static::KEY_CHUNK_SIZE)
                          && $request->has(static::KEY_CHUNK_CURRENT_SIZE);

        return $hasChunkParams && self::checkChunkParams($request);
    }
581041
public function has($crawlUrl): bool
    {
        if (! $crawlUrl instanceof CrawlUrl) {
            $crawlUrl = CrawlUrl::create($crawlUrl);
        }

        if ($this->contains($this->urls, $crawlUrl)) {
            return true;
        }

        return false;
    }
994724
public static function isAssoc(array $arr): bool
    {
        if (array() === $arr)
            return false;
        return array_keys($arr) !== range(0, count($arr) - 1);
    }
927735
public function has($key) {
        if (isset($this->store[$key])) {
            if ($this->ttl == 0) {
                return true;
            } else if ($this->store[$key][1] >= (cache::now() - $this->ttl)) {
                return true;
            }
        }
        return false;
    }