src/Checksum_Base_Command.php
protected static function _read( $url ) { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore -- Could be used in classes extending this class.
		$headers  = array( 'Accept' => 'application/json' );
		$response = Utils\http_request(
			'GET',
			$url,
			null,
			$headers,
			array( 'timeout' => 30 )
		);
		if ( 200 === $response->status_code ) {
			return $response->body;
		}
		WP_CLI::error( "Couldn't fetch response from {$url} (HTTP code {$response->status_code})." );
	}
protected static function _read( $url ) { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore -- Could be used in classes extending this class.
		$headers  = array( 'Accept' => 'application/json' );
		$response = Utils\http_request(
			'GET',
			$url,
			null,
			$headers,
			array( 'timeout' => 30 )
		);
		if ( 200 === $response->status_code ) {
			return $response->body;
		}
		WP_CLI::error( "Couldn't fetch response from {$url} (HTTP code {$response->status_code})." );
	}
protected static function _read ( $ url ) { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore -- Could be used in classes extending this class. $ headers = array ( 'Accept' => 'application/json' ) ; $ response = Utils \ http_request ( 'GET' , $ url , null , $ headers , array ( 'timeout' => 30 ) ) ; if ( 200 === $ response -> status_code ) { return $ response -> body ; } WP_CLI :: error ( "Couldn't fetch response from {$url} (HTTP code {$response->status_code})." ) ; }
Read a remote file and return its contents.

@param string $url URL of the remote file to read.

@return mixed
Read a remote file and return its contents .