Skip to content

Commit

Permalink
style: fix psr-12 code style issues
Browse files Browse the repository at this point in the history
  • Loading branch information
getsolaris authored and github-actions[bot] committed Nov 1, 2022
1 parent 38fcf7e commit 18b4a9d
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 28 deletions.
2 changes: 1 addition & 1 deletion config/toss-payments.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
'secret_key' => env('TOSS_PAYMENTS_SECRET_KEY'),
'content_type' => 'application/json',
'accept' => 'application/json',
];
];
16 changes: 8 additions & 8 deletions src/Attributes/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@
class Payment extends TossPayments implements AttributeInterface
{
/**
* @var string $uri
* @var string
*/
protected string $uri;

/**
* @var string $paymentKey
* @var string
*/
protected string $paymentKey;

/**
* @var string $orderId
* @var string
*/
protected string $orderId;

/**
* @var int $amount
* @var int
*/
protected int $amount;

Expand All @@ -51,7 +51,7 @@ public function initializeUri(): static
*/
public function createEndpoint(?string $endpoint): string
{
return $this->url . $this->uri . $this->start($endpoint);
return $this->url.$this->uri.$this->start($endpoint);
}

/**
Expand Down Expand Up @@ -104,14 +104,14 @@ public function confirm(): PromiseInterface|Response
*/
public function get(): PromiseInterface|Response
{
return $this->client->get($this->createEndpoint('/' . $this->paymentKey));
return $this->client->get($this->createEndpoint('/'.$this->paymentKey));
}

/**
* @return PromiseInterface|Response
*/
public function order(): PromiseInterface|Response
{
return $this->client->get($this->createEndpoint('/orders/' . $this->orderId));
return $this->client->get($this->createEndpoint('/orders/'.$this->orderId));
}
}
}
13 changes: 7 additions & 6 deletions src/Attributes/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@
class Transaction extends TossPayments implements AttributeInterface
{
/**
* @var string $uri
* @var string
*/
protected string $uri;

/**
* @var string $startDate
* @var string
*/
protected string $startDate;

/**
* @var string $endDate
* @var string
*/
protected string $endDate;

/**
* @var string $startingAfter
* @var string
*/
protected string $startingAfter;

Expand Down Expand Up @@ -55,7 +55,7 @@ public function initializeUri(): static
*/
public function createEndpoint(?string $endpoint): string
{
return $this->url . $this->uri . $this->start($endpoint);
return $this->url.$this->uri.$this->start($endpoint);
}

/**
Expand Down Expand Up @@ -93,6 +93,7 @@ public function startingAfter(string $startingAfter): static

/**
* @return $this
*
* @throws LargeLimitException
*/
public function limit(int $limit): static
Expand All @@ -115,4 +116,4 @@ public function get()
'limit' => $this->limit,
]);
}
}
}
4 changes: 3 additions & 1 deletion src/Contracts/AttributeInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
interface AttributeInterface
{
public function __construct();

public function initializeUri(): static;

public function createEndpoint(?string $endpoint): string;
}
}
2 changes: 1 addition & 1 deletion src/Exceptions/LargeLimitException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
class LargeLimitException extends \Exception
{
protected $message = 'limit 가 10000을 초과하였습니다.';
}
}
20 changes: 10 additions & 10 deletions src/TossPayments.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,42 @@
class TossPayments
{
/**
* @var string $attribute
* @var string
*/
protected $attribute;

/**
* @var $client
* @var
*/
protected $client;

/**
* @var string $url
* @var string
*/
protected string $endpoint;

/**
* @var string $version
* @var string
*/
protected string $version;

/**
* @var string $url
* @var string
*/
protected string $url;

/**
* @var string $clientKey
* @var string
*/
protected string $clientKey;

/**
* @var string $secretKey
* @var string
*/
protected string $secretKey;

/**
* @var array $headers
* @var array
*/
protected array $headers = [];

Expand Down Expand Up @@ -93,7 +93,7 @@ protected function initializeApiUrl(): static
{
$this->endpoint = config('toss-payments.endpoint');
$this->version = config('toss-payments.version');
$this->url = $this->endpoint . '/' . $this->version;
$this->url = $this->endpoint.'/'.$this->version;

return $this;
}
Expand All @@ -115,7 +115,7 @@ protected function initializeKeys(): static
protected function initializeHeaders(): static
{
$this->headers = [
'Authorization' => 'Basic ' . base64_encode($this->secretKey . ':'),
'Authorization' => 'Basic '.base64_encode($this->secretKey.':'),
'Content-Type' => 'application/json',
];

Expand Down
2 changes: 1 addition & 1 deletion src/TossPaymentsServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ public function boot(): void
__DIR__."/../config/{$this->name}.php" => config_path($this->name.'.php'),
], 'config');
}
}
}

0 comments on commit 18b4a9d

Please sign in to comment.