Skip to content

Commit f4af6b0

Browse files
committed
Pass Requests, not strings, to client->fetch()
1 parent b3bc700 commit f4af6b0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

components/Blueprints/SiteResolver/NewSiteResolver.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use WordPress\Blueprints\Runtime;
1010
use WordPress\Blueprints\VersionStrings\VersionConstraint;
1111
use WordPress\HttpClient\Client;
12+
use WordPress\HttpClient\Request;
1213
use WordPress\Zip\ZipFilesystem;
1314

1415
use function WordPress\Filesystem\copy_between_filesystems;
@@ -160,7 +161,7 @@ static private function resolveWordPressZipUrl( Client $client, string $version_
160161
return 'https://wordpress.org/nightly-builds/wordpress-latest.zip';
161162
}
162163

163-
$latestVersions = $client->fetch( 'https://api.wordpress.org/core/version-check/1.7/?channel=beta' )->json();
164+
$latestVersions = $client->fetch( new Request( 'https://api.wordpress.org/core/version-check/1.7/?channel=beta' ) )->json();
164165

165166
$latestVersions = array_filter( $latestVersions['offers'], function ( $v ) {
166167
return $v['response'] === 'autoupdate';

components/Blueprints/Steps/SetSiteLanguageStep.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ function(\$theme) {
229229
private function getWordPressTranslationUrl( Runtime $runtime, string $wpVersion, string $language, Client $client ) {
230230
try {
231231
$api_url = "https://api.wordpress.org/translations/core/1.0/?version={$wpVersion}";
232-
$translations_data = $client->fetch( $api_url )->json();
232+
$translations_data = $client->fetch( new Request( $api_url ) )->json();
233233

234234
if ( ! isset( $translations_data['translations'] ) || ! is_array( $translations_data['translations'] ) ) {
235235
throw new Exception( "Invalid response from WordPress.org translations API" );

0 commit comments

Comments
 (0)