Skip to content

Commit 5c37762

Browse files
committed
Change tabs to spaces
1 parent 6422a18 commit 5c37762

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

src/Commands/Cleanup.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,24 @@
77

88
class Cleanup extends Command
99
{
10-
protected $signature = 'snapshot:cleanup {--keep=}';
10+
protected $signature = 'snapshot:cleanup {--keep=}';
1111

12-
protected $description = 'Specify how many snapshots to keep and delete the rest';
12+
protected $description = 'Specify how many snapshots to keep and delete the rest';
1313

14-
public function handle()
15-
{
16-
$snapshots = app(SnapshotRepository::class)->getAll();
14+
public function handle()
15+
{
16+
$snapshots = app(SnapshotRepository::class)->getAll();
1717

18-
$keep = $this->option('keep');
18+
$keep = $this->option('keep');
1919

20-
if (!$this->option('keep')) {
21-
$this->warn('No value for option --keep.');
20+
if (!$this->option('keep')) {
21+
$this->warn('No value for option --keep.');
2222

23-
return;
24-
}
23+
return;
24+
}
2525

26-
$snapshots->splice($keep)->each(function ($snapshot) {
27-
$snapshot->delete();
28-
});
29-
}
26+
$snapshots->splice($keep)->each(function ($snapshot) {
27+
$snapshot->delete();
28+
});
29+
}
3030
}

tests/Commands/CleanupTest.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@
77

88
class CleanupTest extends TestCase
99
{
10-
/** @test */
11-
public function it_can_delete_old_snapshots_keeping_the_desired_number_of_snapshots()
12-
{
13-
// Add sleep to make sure files do not have the same modified time.
14-
// They may not sort properly if all have the same timestamp.
15-
$this->clearDisk();
10+
/** @test */
11+
public function it_can_delete_old_snapshots_keeping_the_desired_number_of_snapshots()
12+
{
13+
// Add sleep to make sure files do not have the same modified time.
14+
// They may not sort properly if all have the same timestamp.
15+
$this->clearDisk();
1616

17-
$this->disk->put('snapshot1.sql', 'new content');
17+
$this->disk->put('snapshot1.sql', 'new content');
1818

19-
sleep(1);
19+
sleep(1);
2020

21-
$this->disk->put('snapshot2.sql', 'new content');
21+
$this->disk->put('snapshot2.sql', 'new content');
2222

23-
Artisan::call('snapshot:cleanup', ['--keep' => 1]);
23+
Artisan::call('snapshot:cleanup', ['--keep' => 1]);
2424

25-
$this->disk->assertMissing('snapshot1.sql');
26-
$this->disk->assertExists('snapshot2.sql');
27-
}
25+
$this->disk->assertMissing('snapshot1.sql');
26+
$this->disk->assertExists('snapshot2.sql');
27+
}
2828
}

0 commit comments

Comments
 (0)