Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
StyleCIBot committed Sep 18, 2023
1 parent 4fa7370 commit 5989d33
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/Facades/Lyra.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
9 changes: 6 additions & 3 deletions src/LyraOfflineService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
);
}
}
}
2 changes: 1 addition & 1 deletion src/Models/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ protected static function booted()
}

/**
* @param Builder $builder
* @param Builder $builder
*
* @return void
*/
Expand Down
34 changes: 21 additions & 13 deletions tests/Feature/LyraOfflineServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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();

Expand All @@ -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();

Expand All @@ -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();

Expand All @@ -105,7 +113,6 @@ public function deny(): void
self::assertEquals(Status::FAILED, $invoice->status);
}


/**
* @test
*
Expand All @@ -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();

Expand All @@ -126,5 +135,4 @@ public function denyAnAcceptedInvoice(): void

Lyra::offline()->deny($invoice);
}

}
}

0 comments on commit 5989d33

Please sign in to comment.