Skip to content

Commit d61ee2a

Browse files
rappasoftgithub-actions[bot]
authored andcommitted
Fix Styling
1 parent c500994 commit d61ee2a

14 files changed

+78
-45
lines changed

src/Commands/ListCommand.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public function handle(): int
5858
{
5959
if (! $this->patcher->patchesTableExists()) {
6060
$this->error(__('The patches table does not exist, did you forget to migrate?'));
61+
6162
return 1;
6263
}
6364

@@ -93,12 +94,14 @@ public function handle(): int
9394
} else {
9495
$this->info('No patches found matching the criteria.');
9596
}
97+
9698
return 0;
9799
}
98100

99101
// Output as JSON
100102
if ($this->option('json')) {
101103
$this->line(json_encode($patches, JSON_PRETTY_PRINT));
104+
102105
return 0;
103106
}
104107

src/Commands/PatchCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ public function handle(): int
8787
// Handle dry run mode
8888
if ($this->option('dry-run')) {
8989
$this->handleDryRun($patches);
90+
9091
return 0;
9192
}
9293

@@ -104,6 +105,7 @@ protected function handleDryRun(array $patches): void
104105
{
105106
if (! count($patches)) {
106107
$this->info(__('No patches to run.'));
108+
107109
return;
108110
}
109111

src/Commands/StatusCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public function handle(): int
5858
{
5959
if (! $this->patcher->patchesTableExists()) {
6060
$this->error(__('The patches table does not exist, did you forget to migrate?'));
61+
6162
return 1;
6263
}
6364

@@ -110,6 +111,7 @@ public function handle(): int
110111

111112
if (empty($rows)) {
112113
$this->info('No patches found matching the criteria.');
114+
113115
return 0;
114116
}
115117

src/LaravelPatchesServiceProvider.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
namespace Rappasoft\LaravelPatches;
44

5-
use Rappasoft\LaravelPatches\Commands\PatchCommand;
6-
use Rappasoft\LaravelPatches\Commands\PatchMakeCommand;
7-
use Rappasoft\LaravelPatches\Commands\RollbackCommand;
85
use Spatie\LaravelPackageTools\Package;
96
use Spatie\LaravelPackageTools\PackageServiceProvider;
107

tests/Commands/DryRunAndErrorHandlingTest.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
<?php
22

3-
use Rappasoft\LaravelPatches\Models\Patch;
43
use Illuminate\Support\Facades\Event;
54
use Rappasoft\LaravelPatches\Events\PatchExecuted;
6-
5+
use Rappasoft\LaravelPatches\Models\Patch;
76

87
test('dry run mode preview patches without executing', function () {
98
file_put_contents(
@@ -97,7 +96,7 @@ public function up() {
9796
}'
9897
);
9998

100-
expect(fn() => $this->artisan('patch'))->toThrow('Custom error');
99+
expect(fn () => $this->artisan('patch'))->toThrow('Custom error');
101100
});
102101

103102
test('patch command continues on error when configured', function () {
@@ -156,7 +155,7 @@ public function up() {
156155
}'
157156
);
158157

159-
expect(fn() => $this->artisan('patch'))->toThrow('Stop here');
158+
expect(fn () => $this->artisan('patch'))->toThrow('Stop here');
160159

161160
expect(Patch::where('patch', '2024_01_02_000000_should_not_run')->exists())->toBeFalse();
162161
});
@@ -230,7 +229,7 @@ public function up() {
230229
}'
231230
);
232231

233-
expect(fn() => $this->artisan('patch'))->toThrow('Rollback');
232+
expect(fn () => $this->artisan('patch'))->toThrow('Rollback');
234233

235234
expect(\Illuminate\Support\Facades\DB::table('patches')->where('batch', 99)->exists())->toBeFalse();
236235
});

tests/Commands/ListCommandTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
use Rappasoft\LaravelPatches\Models\Patch;
44

5-
65
test('list command shows error when patches table does not exist', function () {
76
\Illuminate\Support\Facades\Schema::drop('patches');
87

tests/Commands/StatusCommandTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
use Rappasoft\LaravelPatches\Models\Patch;
44

5-
65
test('status command shows error when patches table does not exist', function () {
76
// Drop all tables to simulate fresh install
87
\Illuminate\Support\Facades\Schema::drop('patches');

tests/EventsTest.php

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
<?php
22

33
use Illuminate\Support\Facades\Event;
4-
use Rappasoft\LaravelPatches\Events\{PatchExecuting, PatchExecuted, PatchFailed, PatchRollingBack, PatchRolledBack};
4+
use Rappasoft\LaravelPatches\Events\PatchExecuted;
5+
use Rappasoft\LaravelPatches\Events\PatchExecuting;
6+
use Rappasoft\LaravelPatches\Events\PatchFailed;
7+
use Rappasoft\LaravelPatches\Events\PatchRolledBack;
8+
use Rappasoft\LaravelPatches\Events\PatchRollingBack;
59
use Rappasoft\LaravelPatches\Patch;
610

7-
811
beforeEach(function () {
912
Event::fake();
1013
});
1114

1215
test('PatchExecuting event is dispatched with correct data', function () {
1316
$patch = new class extends Patch {
14-
public function up() {}
17+
public function up()
18+
{
19+
}
1520
};
1621

1722
event(new PatchExecuting('test_patch', 1, $patch));
@@ -58,7 +63,9 @@ public function up() {}
5863

5964
test('PatchRollingBack event is dispatched', function () {
6065
$patch = new class extends Patch {
61-
public function down() {}
66+
public function down()
67+
{
68+
}
6269
};
6370

6471
event(new PatchRollingBack('test_patch', $patch));
@@ -94,7 +101,9 @@ public function down() {}
94101

95102
test('multiple events can be dispatched in sequence', function () {
96103
$patch = new class extends Patch {
97-
public function up() {}
104+
public function up()
105+
{
106+
}
98107
};
99108

100109
event(new PatchExecuting('patch1', 1, $patch));

tests/IntegrationTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
use Illuminate\Support\Facades\DB;
44
use Illuminate\Support\Facades\Event;
5-
use Rappasoft\LaravelPatches\Events\{PatchExecuted, PatchExecuting, PatchFailed};
5+
use Rappasoft\LaravelPatches\Events\PatchExecuted;
6+
use Rappasoft\LaravelPatches\Events\PatchExecuting;
7+
use Rappasoft\LaravelPatches\Events\PatchFailed;
68
use Rappasoft\LaravelPatches\Models\Patch;
79

8-
910
test('complete workflow with all features', function () {
1011
Event::fake();
1112
config(['laravel-patches.track_metadata' => true]);
@@ -99,7 +100,7 @@ public function up() {
99100
}'
100101
);
101102

102-
expect(fn() => \Illuminate\Support\Facades\Artisan::call('patch'))->toThrow('Test error message');
103+
expect(fn () => \Illuminate\Support\Facades\Artisan::call('patch'))->toThrow('Test error message');
103104

104105
// Verify error was logged
105106
$patch = Patch::where('patch', '2024_01_01_000000_error_test')->first();
@@ -228,7 +229,7 @@ public function up() {
228229
}'
229230
);
230231

231-
expect(fn() => $this->artisan('patch'))->toThrow('Force rollback');
232+
expect(fn () => $this->artisan('patch'))->toThrow('Force rollback');
232233

233234
// Verify transactional data rolled back
234235
expect(DB::table('patches')->where('batch', 888)->exists())->toBeFalse();

tests/PatchBaseTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,6 @@ public function description(): ?string
104104
$this->assertEquals('', $patch->description());
105105
}
106106

107-
108-
109107
public function test_patch_can_set_useTransaction_to_true(): void
110108
{
111109
$patch = new class extends Patch {

0 commit comments

Comments
 (0)