mirror of
https://github.com/crater-invoice/crater.git
synced 2025-12-16 02:12:54 -05:00
Implement PHP CS Fixer and a coding standard to follow (#471)
* Create PHP CS Fixer config and add to CI workflow * Run php cs fixer on project * Add newline at end of file * Update to use PHP CS Fixer v3 * Run v3 config on project * Run seperate config in CI
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
use Crater\Models\User;
|
||||
use Crater\Models\Tax;
|
||||
use Crater\Models\Invoice;
|
||||
use Crater\Models\InvoiceItem;
|
||||
use Crater\Models\Tax;
|
||||
use Crater\Models\User;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
@@ -113,11 +113,11 @@ test('create invoice', function () {
|
||||
$invoice['taxes'] = [];
|
||||
array_push($invoice['taxes'], Tax::factory()->raw());
|
||||
|
||||
$request = new Request;
|
||||
$request = new Request();
|
||||
|
||||
$request->replace($invoice);
|
||||
|
||||
$invoice_number = explode("-",$invoice['invoice_number']);
|
||||
$invoice_number = explode("-", $invoice['invoice_number']);
|
||||
$number_attributes['invoice_number'] = $invoice_number[0].'-'.sprintf('%06d', intval($invoice_number[1]));
|
||||
|
||||
$response = Invoice::createInvoice($request);
|
||||
@@ -150,11 +150,11 @@ test('update invoice', function () {
|
||||
$newInvoice = Invoice::factory()->raw();
|
||||
|
||||
$item = InvoiceItem::factory()->raw([
|
||||
'invoice_id' => $invoice->id
|
||||
'invoice_id' => $invoice->id,
|
||||
]);
|
||||
|
||||
$tax = Tax::factory()->raw([
|
||||
'invoice_id' => $invoice->id
|
||||
'invoice_id' => $invoice->id,
|
||||
]);
|
||||
|
||||
$newInvoice['items'] = [];
|
||||
@@ -163,7 +163,7 @@ test('update invoice', function () {
|
||||
array_push($newInvoice['items'], $item);
|
||||
array_push($newInvoice['taxes'], $tax);
|
||||
|
||||
$request = new Request;
|
||||
$request = new Request();
|
||||
|
||||
$request->replace($newInvoice);
|
||||
|
||||
@@ -201,12 +201,12 @@ test('create items', function () {
|
||||
$items = [];
|
||||
|
||||
$item = InvoiceItem::factory()->raw([
|
||||
'invoice_id' => $invoice->id
|
||||
'invoice_id' => $invoice->id,
|
||||
]);
|
||||
|
||||
array_push($items, $item);
|
||||
|
||||
$request = new Request;
|
||||
$request = new Request();
|
||||
|
||||
$request->replace(['items' => $items ]);
|
||||
|
||||
@@ -218,7 +218,7 @@ test('create items', function () {
|
||||
'price' => $item['price'],
|
||||
'tax' => $item['tax'],
|
||||
'quantity' => $item['quantity'],
|
||||
'total' => $item['total']
|
||||
'total' => $item['total'],
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -228,12 +228,12 @@ test('create taxes', function () {
|
||||
$taxes = [];
|
||||
|
||||
$tax = Tax::factory()->raw([
|
||||
'invoice_id' => $invoice->id
|
||||
'invoice_id' => $invoice->id,
|
||||
]);
|
||||
|
||||
array_push($taxes, $tax);
|
||||
|
||||
$request = new Request;
|
||||
$request = new Request();
|
||||
|
||||
$request->replace(['taxes' => $taxes ]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user