From 74ba68dec00558e55df3a136a970db3e3af789e9 Mon Sep 17 00:00:00 2001 From: Lyrisbee Date: Tue, 12 Dec 2023 14:31:32 +0800 Subject: [PATCH] chore: apply changes --- src/Requests/Category.php | 2 +- src/Requests/GeneralRequest.php | 8 ++++---- src/Requests/Request.php | 12 ++++++------ src/Requests/Tag.php | 2 +- src/Requests/User.php | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Requests/Category.php b/src/Requests/Category.php index 834b48b..cc8af73 100644 --- a/src/Requests/Category.php +++ b/src/Requests/Category.php @@ -28,7 +28,7 @@ public function list(): array return array_map( fn ($data) => CategoryObject::from($data), - $data + $data, ); } diff --git a/src/Requests/GeneralRequest.php b/src/Requests/GeneralRequest.php index 8849e01..94c5b97 100644 --- a/src/Requests/GeneralRequest.php +++ b/src/Requests/GeneralRequest.php @@ -59,21 +59,21 @@ public function delete(string $path, array $arguments): bool return $this->request('delete', $path, $arguments); } - public function getUrl(string $path, string $basePath, bool $pretty): string + public function getUrl(string $path, string $prefix, bool $pretty): string { if ($pretty) { return sprintf( '%s/%s/%s', rtrim($this->app->site(), '/'), - $basePath, - ltrim($path, '/') + $prefix, + ltrim($path, '/'), ); } return sprintf( '%s?rest_route=/%s', rtrim($this->app->site(), '/'), - ltrim($path, '/') + ltrim($path, '/'), ); } } diff --git a/src/Requests/Request.php b/src/Requests/Request.php index 571009b..b123034 100644 --- a/src/Requests/Request.php +++ b/src/Requests/Request.php @@ -48,9 +48,9 @@ protected function request( $this->getUrl( $path, $this->app->prefix(), - $this->app->isPrettyUrl() + $this->app->isPrettyUrl(), ), - $options + $options, ); if (!$response->successful()) { @@ -74,15 +74,15 @@ protected function request( return $data; } - public function getUrl(string $path, string $basePath, bool $pretty): string + public function getUrl(string $path, string $prefix, bool $pretty): string { if ($pretty) { return sprintf( '%s/%s/wp/%s/%s', rtrim($this->app->site(), '/'), - $basePath, + $prefix, self::VERSION, - ltrim($path, '/') + ltrim($path, '/'), ); } @@ -90,7 +90,7 @@ public function getUrl(string $path, string $basePath, bool $pretty): string '%s?rest_route=/wp/%s/%s', rtrim($this->app->site(), '/'), self::VERSION, - ltrim($path, '/') + ltrim($path, '/'), ); } diff --git a/src/Requests/Tag.php b/src/Requests/Tag.php index c6e9870..6b86c2a 100644 --- a/src/Requests/Tag.php +++ b/src/Requests/Tag.php @@ -28,7 +28,7 @@ public function list(): array return array_map( fn ($data) => TagObject::from($data), - $data + $data, ); } diff --git a/src/Requests/User.php b/src/Requests/User.php index df27873..263b8c8 100644 --- a/src/Requests/User.php +++ b/src/Requests/User.php @@ -28,7 +28,7 @@ public function list(): array return array_map( fn ($data) => UserObject::from($data), - $data + $data, ); }