这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/Core/Tasks/UserTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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");
}

/**
Expand Down
11 changes: 0 additions & 11 deletions src/Exception/UpsunException.php

This file was deleted.

1 change: 0 additions & 1 deletion src/UpsunClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ class UpsunClient

public function __construct(protected UpsunConfig $upsunConfig)
{

$this->apiConfig = Configuration::getDefaultConfiguration()
->setHost($this->upsunConfig->base_url);

Expand Down
7 changes: 3 additions & 4 deletions src/UpsunConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -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",
) { }

) {
}
}
5 changes: 2 additions & 3 deletions tests/Core/UserTaskTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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');
}
Expand Down