Checks if a key exists in an array.

Supports dot notation for keys. E.g., first.second.parts.

@param array $data
The array of data that may contain key.
@param string $key
The array key, optionally in dot notation format.

@return bool
972765
protected function checkKeyExists($data, $key)
    {
        if (!$data->has($key)) {
            $this->output->writeln("<error>The key $key does not exist.");

            return false;
        }

        return true;
    }
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;
	}
233023
public function has( $key = null )
	{
		$keys = is_array( $key ) ? $key : func_get_args();

		foreach ( $keys as $key )
		{
			if ( $this->first( $key ) === '' )
			{
				return false;
			}
		}

		return true;
	}
981360
public static function has($array, $keys): bool
    {
        if (null === $keys) {
            return false;
        }

        $keys = (array)$keys;

        if (!$array) {
            return false;
        }

        if ($keys === []) {
            return false;
        }

        foreach ($keys as $key) {
            $subKeyArray = $array;

            if (static::exists($array, $key)) {
                continue;
            }

            foreach (explode('.', $key) as $segment) {
                if (static::accessible($subKeyArray) && static::exists($subKeyArray, $segment)) {
                    $subKeyArray = $subKeyArray[$segment];
                } else {

                    return false;
                }
            }
        }

        return true;
    }
684459
public function exists($key) {
		return isset($this->_data[$key]) || isset($this->registered[$key]);
	}
294470
public function hmSet($key, array $data) {
        $array = ['hmset', $key];

        foreach ($data as $dataKey => $value) {
            $array[] = $dataKey;
            $array[] = $value;
        }

        return $this->send($array);
    }
648857
public function getIsAllKeysValid(array $data)
    {
        $keys = array_keys($data);
        foreach($keys as $key)
        {
            if(!$this->getIsValidKey($key))
            {
                return false;
            }
        }
        return true;
    }
805780
protected function hmac($key = '', $data = '')
    {
        if ($data == '') {
            $this->errorMessage[] = 'DATA FOR HMAC: MISSING!';
            return false;
        }
        if ($key == '') {
            $this->errorMessage[] = 'KEY FOR HMAC: MISSING!';
            return false;
        }
        return hash_hmac('md5', $data, trim($key));
    }
440018
public static function array_delete(array &$data, $key){
		if(array_key_exists($key, $data)){
			$value = $data[$key];
			unset($data[$key]);
			return $value;
		}
	}
1259685
public function has($key): bool
    {
        return ArrayUtility::dotRead($this->data, $this->getNormalizedKey($key)) !== null;
    }
986166
public function hasProperty( $key )
    {
        return \array_key_exists( $key, $this->data ) or in_array( $key, $this->additionalProperties );
    }
1272101
public function exists( $key ) {
		return ( is_array( $this->data ) && array_key_exists( $key, $this->data ) ) ||
			( is_object( $this->data ) && property_exists( $this->data, $key ) );
	}
364032
public function offsetExists($key)
    {
        return isset($this->data[$key]) || array_key_exists($key, $this->data);
    }
1155770
public function has($key)
    {
      if (isset($this->data[$key])
         || isset($this->data[0][$key])) {
        return true;
      }

      return  FALSE;
    }
1179362
public function has($key)
    {
        $keys = explode('.', $key);
        $cKeys = count($keys);
        $config = $this->_arr;

        for ($i = 0; $i < $cKeys; ++$i) {
            if (is_array($config)) {
                if (array_key_exists($keys[$i], $config)) {
                    $config = $config[$keys[$i]];
                } else {
                    return false;
                }
            } else {
                return false;
            }
        }

        return true;
    }
309218
protected function exists(array $array, $key)
    {
        if (isset($array[$key])) {
            return true;
        }

        foreach (explode(".", $key) as $part) {
            if (!is_array($array) or !isset($array[$part])) {
                return false;
            }

            $array = $array[$part];
        }

        return true;
    }
336819
public function hasData($key = ''){

        $key = $this->normalizeKeyName($key);

        if( empty($key) || !is_string($key) ){
            return !empty($this->_data);
        }

        return array_key_exists($key, $this->_data);
    }