Skip to content

Commit fad563e

Browse files
Copilotnielsdrost7
andcommitted
Apply code review fixes from PR #282
Co-authored-by: nielsdrost7 <47660417+nielsdrost7@users.noreply.github.com>
1 parent 6bb49fd commit fad563e

5 files changed

Lines changed: 17 additions & 7 deletions

File tree

Modules/Core/Support/NumberFormatter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public static function formatTrimmed(float $number, int $decimalPlaces = 4): str
1616
{
1717
$formatted = number_format($number, $decimalPlaces, '.', '');
1818

19-
return mb_rtrim(mb_rtrim($formatted, '0'), '.');
19+
return rtrim(rtrim($formatted, '0'), '.');
2020
}
2121

2222
public static function unformat($number, $currency = null): float | string

Modules/Core/Tests/AbstractAdminPanelTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ abstract class AbstractAdminPanelTestCase extends BaseTestCase
1111
{
1212
use RefreshDatabase;
1313

14-
protected $superAdmin;
14+
protected ?User $superAdmin;
1515

1616
protected function setUp(): void
1717
{

Modules/Core/Tests/Feature/UsersTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ public function it_lists_users(): void
4545
# endregion
4646

4747
# region crud
48+
#[Test]
49+
#[Group('crud')]
4850
public function it_deletes_a_user(): void
4951
{
5052
/* arrange */

Modules/Expenses/Database/Factories/ExpenseItemFactory.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ public function definition(): array
4343
->first();
4444

4545
if ( ! $item) {
46-
dd('die early');
46+
$item = Product::factory()
47+
->state(['company_id' => $company->id])
48+
->create();
4749
}
4850

4951
// Get a unit that belongs to this company
@@ -53,7 +55,9 @@ public function definition(): array
5355
->first();
5456

5557
if ( ! $unit) {
56-
dd('die early');
58+
$unit = ProductUnit::factory()
59+
->state(['company_id' => $company->id])
60+
->create();
5761
}
5862

5963
// Get a tax rate that belongs to this company
@@ -63,7 +67,9 @@ public function definition(): array
6367
->first();
6468

6569
if ( ! $taxRate) {
66-
dd('die early');
70+
$taxRate = TaxRate::factory()
71+
->state(['company_id' => $company->id])
72+
->create();
6773
}
6874

6975
// Get a second tax rate 75% of the time that belongs to this company
@@ -76,7 +82,9 @@ public function definition(): array
7682
->first();
7783

7884
if ( ! $taxRate2) {
79-
dd('die early');
85+
$taxRate2 = TaxRate::factory()
86+
->state(['company_id' => $company->id])
87+
->create();
8088
}
8189
}
8290

Modules/Invoices/Database/Factories/InvoiceFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function configure(): static
7676
->first();
7777

7878
if ( ! $taxRate) {
79-
$taxRate = Product::factory()
79+
$taxRate = TaxRate::factory()
8080
->state(['company_id' => $invoice->company_id])
8181
->create();
8282
}

0 commit comments

Comments
 (0)