Code Duplication    Length = 9-9 lines in 2 locations

src/wp-includes/rest-api/class-wp-rest-request.php 2 locations

@@ 216-224 (lines=9) @@
213
	 * @param string $key Header name, will be canonicalized to lowercase.
214
	 * @return string|null String value if set, null otherwise.
215
	 */
216
	public function get_header( $key ) {
217
		$key = $this->canonicalize_header_name( $key );
218
219
		if ( ! isset( $this->headers[ $key ] ) ) {
220
			return null;
221
		}
222
223
		return implode( ',', $this->headers[ $key ] );
224
	}
225
226
	/**
227
	 * Retrieves header values from the request.
@@ 235-243 (lines=9) @@
232
	 * @param string $key Header name, will be canonicalized to lowercase.
233
	 * @return array|null List of string values if set, null otherwise.
234
	 */
235
	public function get_header_as_array( $key ) {
236
		$key = $this->canonicalize_header_name( $key );
237
238
		if ( ! isset( $this->headers[ $key ] ) ) {
239
			return null;
240
		}
241
242
		return $this->headers[ $key ];
243
	}
244
245
	/**
246
	 * Sets the header on request.