diff --git a/src/Core/Tasks/UserTask.php b/src/Core/Tasks/UserTask.php index d2529b411..600a4480e 100644 --- a/src/Core/Tasks/UserTask.php +++ b/src/Core/Tasks/UserTask.php @@ -36,7 +36,6 @@ use OpenAPI\Client\Model\UserProjectAccess; use OpenAPI\Client\Model\VerifyPhoneNumber200Response; use OpenAPI\Client\Model\VerifyPhoneNumberRequest; -use Upsun\Exception\UpsunException; use Upsun\UpsunClient; class UserTask extends TaskBase @@ -305,11 +304,11 @@ public function updateUserProjectAccess( /** * Creates a user profile picture * - * @throws UpsunException on non-2xx response or if the response body is not in the expected format + * @throws \BadMethodCallException Not implemented yet */ public function createProfilePicture(string $uuid) { - throw new UpsunException("Not implemented (yet)"); + throw new \BadMethodCallException("Not implemented yet"); } /** diff --git a/src/Exception/UpsunException.php b/src/Exception/UpsunException.php deleted file mode 100644 index 098c3cba1..000000000 --- a/src/Exception/UpsunException.php +++ /dev/null @@ -1,11 +0,0 @@ -apiConfig = Configuration::getDefaultConfiguration() ->setHost($this->upsunConfig->base_url); diff --git a/src/UpsunConfig.php b/src/UpsunConfig.php index 76d43ceb6..73038dfaf 100644 --- a/src/UpsunConfig.php +++ b/src/UpsunConfig.php @@ -4,14 +4,13 @@ class UpsunConfig { - // constructor public function __construct( public readonly string $base_url = "https://api.upsun.com", public readonly string $auth_url = "https://auth.upsun.com", - public readonly string $apiKey = "UPSUN_CLI_TOKEN is not define !", + public readonly string $apiKey = "UPSUN_CLI_TOKEN is not defined!", public readonly string $token_endpoint = "oauth2/token", public readonly string $refresh_endpoint = "oauth2/token", public readonly string $clientId = "sdk-php-client-id", - ) { } - + ) { + } } diff --git a/tests/Core/UserTaskTest.php b/tests/Core/UserTaskTest.php index 90bba615d..d152f5e0e 100644 --- a/tests/Core/UserTaskTest.php +++ b/tests/Core/UserTaskTest.php @@ -40,7 +40,6 @@ use PHPUnit\Framework\TestCase; use Symfony\Component\HttpClient\HttplugClient; use Upsun\Core\Tasks\UserTask; -use Upsun\Exception\UpsunException; use Upsun\UpsunClient; use Upsun\UpsunConfig; @@ -587,8 +586,8 @@ public function testVerifyPhoneNumberSuccess() public function testCreateProfilePictureNotImplemented() { - $this->expectException(UpsunException::class); - $this->expectExceptionMessage('Not implemented (yet)'); + $this->expectException(\BadMethodCallException::class); + $this->expectExceptionMessage('Not implemented yet'); $this->userTask->createProfilePicture('123'); }