From 5989d332d76df63c70753928cc6598b05fb85d5a Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Mon, 18 Sep 2023 13:44:28 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/Facades/Lyra.php | 2 +- src/LyraOfflineService.php | 9 ++++--- src/Models/Invoice.php | 2 +- tests/Feature/LyraOfflineServiceTest.php | 34 +++++++++++++++--------- 4 files changed, 29 insertions(+), 18 deletions(-) diff --git a/src/Facades/Lyra.php b/src/Facades/Lyra.php index c5c28ff..7fc6f5b 100644 --- a/src/Facades/Lyra.php +++ b/src/Facades/Lyra.php @@ -26,9 +26,9 @@ class Lyra extends Facade /** * Get the registered name of the component. * - * @return string * @throws RuntimeException * + * @return string */ protected static function getFacadeAccessor() { diff --git a/src/LyraOfflineService.php b/src/LyraOfflineService.php index 19bb1f0..ff524ee 100644 --- a/src/LyraOfflineService.php +++ b/src/LyraOfflineService.php @@ -77,8 +77,11 @@ protected function findOrCreateInvoice(int $id = null): Invoice } return Invoice::offline()->findOr( - $id, callback: fn () => throw LyraException::make("Invoice is not found or not a offline invoice!", - LyraErrorCode::INVOICE_NOT_FOUND_OR_NOT_OFFLINE) + $id, + callback: fn () => throw LyraException::make( + 'Invoice is not found or not a offline invoice!', + LyraErrorCode::INVOICE_NOT_FOUND_OR_NOT_OFFLINE + ) ); } -} \ No newline at end of file +} diff --git a/src/Models/Invoice.php b/src/Models/Invoice.php index 13ced36..568b592 100644 --- a/src/Models/Invoice.php +++ b/src/Models/Invoice.php @@ -62,7 +62,7 @@ protected static function booted() } /** - * @param Builder $builder + * @param Builder $builder * * @return void */ diff --git a/tests/Feature/LyraOfflineServiceTest.php b/tests/Feature/LyraOfflineServiceTest.php index 90b0151..dc2eadc 100644 --- a/tests/Feature/LyraOfflineServiceTest.php +++ b/tests/Feature/LyraOfflineServiceTest.php @@ -19,8 +19,10 @@ class LyraOfflineServiceTest extends TestCase public function pay(): void { $file = UploadedFile::fake() - ->createWithContent('fake-receipt.jpg', - file_get_contents(__DIR__.'/../resources/receipt.jpg')); + ->createWithContent( + 'fake-receipt.jpg', + file_get_contents(__DIR__.'/../resources/receipt.jpg') + ); $invoice = Lyra::offline()->pay($file, $amount = 10000)->getInvoice(); @@ -38,8 +40,10 @@ public function pay(): void public function accept(): void { $file = UploadedFile::fake() - ->createWithContent('fake-receipt.jpg', - file_get_contents(__DIR__.'/../resources/receipt.jpg')); + ->createWithContent( + 'fake-receipt.jpg', + file_get_contents(__DIR__.'/../resources/receipt.jpg') + ); $invoice = Lyra::offline()->pay($file, 10000)->getInvoice(); @@ -65,8 +69,10 @@ public function accept(): void public function acceptAnAcceptedInvoice(): void { $file = UploadedFile::fake() - ->createWithContent('fake-receipt.jpg', - file_get_contents(__DIR__.'/../resources/receipt.jpg')); + ->createWithContent( + 'fake-receipt.jpg', + file_get_contents(__DIR__.'/../resources/receipt.jpg') + ); $invoice = Lyra::offline()->pay($file, 10000)->getInvoice(); @@ -86,8 +92,10 @@ public function acceptAnAcceptedInvoice(): void public function deny(): void { $file = UploadedFile::fake() - ->createWithContent('fake-receipt.jpg', - file_get_contents(__DIR__.'/../resources/receipt.jpg')); + ->createWithContent( + 'fake-receipt.jpg', + file_get_contents(__DIR__.'/../resources/receipt.jpg') + ); $invoice = Lyra::offline()->pay($file, 10000)->getInvoice(); @@ -105,7 +113,6 @@ public function deny(): void self::assertEquals(Status::FAILED, $invoice->status); } - /** * @test * @@ -114,8 +121,10 @@ public function deny(): void public function denyAnAcceptedInvoice(): void { $file = UploadedFile::fake() - ->createWithContent('fake-receipt.jpg', - file_get_contents(__DIR__.'/../resources/receipt.jpg')); + ->createWithContent( + 'fake-receipt.jpg', + file_get_contents(__DIR__.'/../resources/receipt.jpg') + ); $invoice = Lyra::offline()->pay($file, 10000)->getInvoice(); @@ -126,5 +135,4 @@ public function denyAnAcceptedInvoice(): void Lyra::offline()->deny($invoice); } - -} \ No newline at end of file +}