Skip to content

Commit 6e41782

Browse files
committed
increase code coverage
1 parent bf770bf commit 6e41782

12 files changed

Lines changed: 14 additions & 30 deletions

File tree

src/PaymayaConnector.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ public function boot(PendingRequest $pendingRequest): void
4848
GetAllWebhookRequest::class,
4949
UpdateWebhookRequest::class => $this->secretKey,
5050
CreateCheckoutRequest::class => $this->publicKey,
51+
// @codeCoverageIgnoreStart
5152
default => throw new Exception('Request ['.$pendingRequest->getRequest()::class.'] not found for getting token type.'),
53+
// @codeCoverageIgnoreEnd
5254
};
5355

5456
$pendingRequest->authenticate(new TokenAuthenticator(base64_encode($token), 'Basic'));

src/Response/Checkout/BaseResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55
namespace Lloricode\Paymaya\Response\Checkout;
66

7-
abstract class BaseResponse {}
7+
abstract readonly class BaseResponse {}

src/Response/Checkout/CheckoutResponse.php

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,11 @@
44

55
namespace Lloricode\Paymaya\Response\Checkout;
66

7-
class CheckoutResponse extends BaseResponse
7+
readonly class CheckoutResponse extends BaseResponse
88
{
99
public function __construct(
1010
public string $checkoutId,
1111
public string $redirectUrl,
1212
) {}
1313

14-
public function setCheckoutId(string $checkoutId): self
15-
{
16-
$this->checkoutId = $checkoutId;
17-
18-
return $this;
19-
}
20-
21-
public function setRedirectUrl(string $redirectUrl): self
22-
{
23-
$this->redirectUrl = $redirectUrl;
24-
25-
return $this;
26-
}
2714
}

src/Response/Checkout/PaymentDetail/PaymentDetail.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,12 @@
77
use Lloricode\Paymaya\Response\Checkout\BaseResponse;
88
use Lloricode\Paymaya\Response\Checkout\PaymentDetail\PaymentDetailResponse\PaymentDetailResponse;
99

10-
class PaymentDetail extends BaseResponse
10+
readonly class PaymentDetail extends BaseResponse
1111
{
1212
public function __construct(
1313
/** actual from paymaya is `3ds` */
1414
public bool $is3ds,
1515
public ?PaymentDetailResponse $responses = null,
1616
public ?string $paymentAt = null,
17-
) {
18-
// if (isset($parameters['3ds'])) {
19-
// $parameters['is3ds'] = $parameters['3ds'];
20-
// unset($parameters['3ds']);
21-
// }
22-
}
17+
) {}
2318
}

src/Response/Checkout/PaymentDetail/PaymentDetailResponse/EFS/Amount/Amount.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use Lloricode\Paymaya\Response\Checkout\BaseResponse;
88

9-
class Amount extends BaseResponse
9+
readonly class Amount extends BaseResponse
1010
{
1111
public function __construct(public Total $total) {}
1212
}

src/Response/Checkout/PaymentDetail/PaymentDetailResponse/EFS/Amount/Total.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use Lloricode\Paymaya\Response\Checkout\BaseResponse;
88

9-
class Total extends BaseResponse
9+
readonly class Total extends BaseResponse
1010
{
1111
public function __construct(
1212
public string $currency,

src/Response/Checkout/PaymentDetail/PaymentDetailResponse/EFS/EFS.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Lloricode\Paymaya\Response\Checkout\PaymentDetail\PaymentDetailResponse\EFS\Amount\Amount;
99
use Lloricode\Paymaya\Response\Checkout\PaymentDetail\PaymentDetailResponse\EFS\Payer\Payer;
1010

11-
class EFS extends BaseResponse
11+
readonly class EFS extends BaseResponse
1212
{
1313
public function __construct(
1414
public string $paymentTransactionReferenceNo,

src/Response/Checkout/PaymentDetail/PaymentDetailResponse/EFS/Payer/FundingInstrument/Card.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use Lloricode\Paymaya\Response\Checkout\BaseResponse;
88

9-
class Card extends BaseResponse
9+
readonly class Card extends BaseResponse
1010
{
1111
public function __construct(
1212
public string $cardNumber,

src/Response/Checkout/PaymentDetail/PaymentDetailResponse/EFS/Payer/FundingInstrument/FundingInstrument.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use Lloricode\Paymaya\Response\Checkout\BaseResponse;
88

9-
class FundingInstrument extends BaseResponse
9+
readonly class FundingInstrument extends BaseResponse
1010
{
1111
public function __construct(
1212
public Card $card

src/Response/Checkout/PaymentDetail/PaymentDetailResponse/EFS/Payer/Payer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Lloricode\Paymaya\Response\Checkout\BaseResponse;
88
use Lloricode\Paymaya\Response\Checkout\PaymentDetail\PaymentDetailResponse\EFS\Payer\FundingInstrument\FundingInstrument;
99

10-
class Payer extends BaseResponse
10+
readonly class Payer extends BaseResponse
1111
{
1212
public function __construct(
1313
public FundingInstrument $fundingInstrument

0 commit comments

Comments
 (0)