wp/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php
changeset 18 be944660c56a
parent 7 cf61fcea0001
equal deleted inserted replaced
17:34716fd837a4 18:be944660c56a
    44 
    44 
    45 	/**
    45 	/**
    46 	 * Get the value for the item
    46 	 * Get the value for the item
    47 	 *
    47 	 *
    48 	 * @param string $key Item key
    48 	 * @param string $key Item key
    49 	 * @return string Item value
    49 	 * @return string|null Item value (null if offsetExists is false)
    50 	 */
    50 	 */
    51 	public function offsetGet($key) {
    51 	public function offsetGet($key) {
    52 		$key = strtolower($key);
    52 		$key = strtolower($key);
    53 		if (!isset($this->data[$key])) {
    53 		if (!isset($this->data[$key])) {
    54 			return null;
    54 			return null;
    68 	public function offsetSet($key, $value) {
    68 	public function offsetSet($key, $value) {
    69 		if ($key === null) {
    69 		if ($key === null) {
    70 			throw new Requests_Exception('Object is a dictionary, not a list', 'invalidset');
    70 			throw new Requests_Exception('Object is a dictionary, not a list', 'invalidset');
    71 		}
    71 		}
    72 
    72 
    73 		$key = strtolower($key);
    73 		$key              = strtolower($key);
    74 		$this->data[$key] = $value;
    74 		$this->data[$key] = $value;
    75 	}
    75 	}
    76 
    76 
    77 	/**
    77 	/**
    78 	 * Unset the given header
    78 	 * Unset the given header