WordPress at a glance
function is not described

WC_REST_Shipping_Methods_V2_Controller::get_item() public WC 1.0

Get a single Shipping Method.

{} It's a method of the class: WC_REST_Shipping_Methods_V2_Controller{}

No Hooks.

Return

WP_REST_Response|WP_Error.

Usage

$WC_REST_Shipping_Methods_V2_Controller = new WC_REST_Shipping_Methods_V2_Controller();
$WC_REST_Shipping_Methods_V2_Controller->get_item( $request );
$request(WP_REST_Request) (required)
Request data.

Code of WC_REST_Shipping_Methods_V2_Controller::get_item() WC 5.0.0

<?php
public function get_item( $request ) {
	$wc_shipping = WC_Shipping::instance();
	$methods     = $wc_shipping->get_shipping_methods();
	if ( empty( $methods[ $request['id'] ] ) ) {
		return new WP_Error( 'woocommerce_rest_shipping_method_invalid', __( 'Resource does not exist.', 'woocommerce' ), array( 'status' => 404 ) );
	}

	$method   = $methods[ $request['id'] ];
	$response = $this->prepare_item_for_response( $method, $request );

	return rest_ensure_response( $response );
}