WP_CLI

RequestsLibrary::set_version │ public static │ WP-CLI 1.0

Set the version of the library.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

$result = RequestsLibrary::set_version( $version );
$version(строка) (обязательный)
The version to set.

Код RequestsLibrary::set_version() WP-CLI 2.13.0-alpha

public static function set_version( $version ) {
	if ( ! is_string( $version ) ) {
		throw new RuntimeException( 'RequestsLibrary::$version must be a string.' );
	}

	if ( ! in_array( $version, self::VALID_VERSIONS, true ) ) {
		throw new RuntimeException(
			sprintf(
				'Invalid RequestsLibrary::$version, must be one of: %s.',
				implode( ', ', self::VALID_VERSIONS )
			)
		);
	}

	WP_CLI::debug( 'Setting RequestsLibrary::$version to ' . $version, 'bootstrap' );

	self::$version = $version;
}