From f18987a4e7171e5a1d331c78e6fd44e0abeca3fe Mon Sep 17 00:00:00 2001 From: sawirricardo Date: Sun, 20 Feb 2022 04:40:45 +0000 Subject: [PATCH] Fix styling --- src/Midtrans.php | 1 - src/Notification.php | 8 ++++++++ src/Snap.php | 1 - src/helpers.php | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Midtrans.php b/src/Midtrans.php index a877ccf..336ddcc 100755 --- a/src/Midtrans.php +++ b/src/Midtrans.php @@ -3,7 +3,6 @@ namespace Sawirricardo\Midtrans\Laravel; use Illuminate\Support\Facades\Http; -use Sawirricardo\Midtrans\Laravel\Snap; class Midtrans { diff --git a/src/Notification.php b/src/Notification.php index 6cdb9b5..9a1a6f4 100644 --- a/src/Notification.php +++ b/src/Notification.php @@ -25,6 +25,7 @@ public static function make(TransactionStatus|array $transactionStatus) if (is_array($transactionStatus)) { return new static(new TransactionStatus($transactionStatus)); } + return new static($transactionStatus); } @@ -35,6 +36,7 @@ public static function make(TransactionStatus|array $transactionStatus) public function whenCreditCardChallenged(callable $callback): static { $this->callbackCreditCardChallenged = $callback; + return $this; } @@ -45,6 +47,7 @@ public function whenCreditCardChallenged(callable $callback): static public function whenCreditCardSuccess(callable $callback): static { $this->callbackCreditCardSuccess = $callback; + return $this; } @@ -55,6 +58,7 @@ public function whenCreditCardSuccess(callable $callback): static public function whenSettlement(callable $callback): static { $this->callbackSettlement = $callback; + return $this; } @@ -65,6 +69,7 @@ public function whenSettlement(callable $callback): static public function whenPending(callable $callback): static { $this->callbackPending = $callback; + return $this; } @@ -75,6 +80,7 @@ public function whenPending(callable $callback): static public function whenDenied(callable $callback): static { $this->callbackDenied = $callback; + return $this; } @@ -85,6 +91,7 @@ public function whenDenied(callable $callback): static public function whenExpired(callable $callback): static { $this->callbackExpired = $callback; + return $this; } @@ -95,6 +102,7 @@ public function whenExpired(callable $callback): static public function whenCancelled(callable $callback): static { $this->callbackCancelled = $callback; + return $this; } diff --git a/src/Snap.php b/src/Snap.php index 758eaca..786d23d 100644 --- a/src/Snap.php +++ b/src/Snap.php @@ -3,7 +3,6 @@ namespace Sawirricardo\Midtrans\Laravel; use Illuminate\Http\Client\PendingRequest; -use Illuminate\Support\Facades\Http; use Sawirricardo\Midtrans\Dto\SnapTokenDto; use Sawirricardo\Midtrans\Dto\TransactionDto; diff --git a/src/helpers.php b/src/helpers.php index 45b5c9c..cf41171 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -3,7 +3,7 @@ use Sawirricardo\Midtrans\Laravel\Facades\Midtrans as LaravelMidtrans; use Sawirricardo\Midtrans\Laravel\Midtrans; -if (!function_exists('midtrans')) { +if (! function_exists('midtrans')) { function midtrans(): Midtrans { return app(LaravelMidtrans::class)::new();