Yoast\WP\SEO\AI\Authentication\Application

OAuth_Auth_Strategy::get_header_value │ private │ Yoast 1.0

Returns the value of the given header, or null if missing/empty.

Keys are already lower-cased by MyYoast HTTP_Client / Response_Parser, so callers pass the lower-cased name they expect.

Метод класса: OAuth_Auth_Strategy{}

Хуков нет.

Возвращает

string|null. The header value, or null.

Использование

// private - только в коде основоного (родительского) класса
$result = $this->get_header_value( $headers, $name ): ?string;
$headers(массив) (обязательный)
.
$name(строка) (обязательный)
The header name (lower-case).

Код OAuth_Auth_Strategy::get_header_value() Yoast 28.9

private function get_header_value( array $headers, string $name ): ?string {
	$value = ( $headers[ $name ] ?? null );
	if ( \is_array( $value ) ) {
		$value = \reset( $value );
	}
	return ( \is_string( $value ) && $value !== '' ) ? $value : null;
}