Skip to content

Commit 4e76c63

Browse files
committed
Rename flush command to clear
Fixes #103
1 parent c7ad020 commit 4e76c63

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/Console/Commands/Flush.php renamed to src/Console/Commands/Clear.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
use Illuminate\Console\Command;
44
use Illuminate\Support\Collection;
55

6-
class Flush extends Command
6+
class Clear extends Command
77
{
8-
protected $signature = 'modelCache:flush {--model=}';
8+
protected $signature = 'modelCache:clear {--model=}';
99
protected $description = 'Flush cache for a given model. If no model is given, entire model-cache is flushed.';
1010

1111
public function handle()

src/Providers/Service.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php namespace GeneaLabs\LaravelModelCaching\Providers;
22

3-
use GeneaLabs\LaravelModelCaching\Console\Commands\Flush;
3+
use GeneaLabs\LaravelModelCaching\Console\Commands\Clear;
44
use Illuminate\Support\ServiceProvider;
55

66
class Service extends ServiceProvider
@@ -11,6 +11,6 @@ public function boot()
1111
{
1212
$configPath = __DIR__ . '/../../config/laravel-model-caching.php';
1313
$this->mergeConfigFrom($configPath, 'laravel-model-caching');
14-
$this->commands(Flush::class);
14+
$this->commands(Clear::class);
1515
}
1616
}

tests/Integration/Console/Commands/FlushTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function testGivenModelIsFlushed()
2323
$cachedResults = $this->cache
2424
->tags($tags)
2525
->get($key)['value'];
26-
$result = $this->artisan('modelCache:flush', ['--model' => Author::class]);
26+
$result = $this->artisan('modelCache:clear', ['--model' => Author::class]);
2727
$flushedResults = $this->cache
2828
->tags($tags)
2929
->get($key)['value'];
@@ -45,7 +45,7 @@ public function testExtendedModelIsFlushed()
4545
->cache
4646
->tags($tags)
4747
->get($key)['value'];
48-
$result = $this->artisan('modelCache:flush', ['--model' => PrefixedAuthor::class]);
48+
$result = $this->artisan('modelCache:clear', ['--model' => PrefixedAuthor::class]);
4949
$flushedResults = $this
5050
->cache
5151
->tags($tags)
@@ -69,7 +69,7 @@ public function testGivenModelWithRelationshipIsFlushed()
6969
->tags($tags)
7070
->get($key)['value'];
7171
$result = $this->artisan(
72-
'modelCache:flush',
72+
'modelCache:clear',
7373
['--model' => Author::class]
7474
);
7575
$flushedResults = $this->cache
@@ -84,7 +84,7 @@ public function testGivenModelWithRelationshipIsFlushed()
8484
public function testNonCachedModelsCannotBeFlushed()
8585
{
8686
$result = $this->artisan(
87-
'modelCache:flush',
87+
'modelCache:clear',
8888
['--model' => UncachedAuthor::class]
8989
);
9090

@@ -117,7 +117,7 @@ public function testAllModelsAreFlushed()
117117
$this->assertNotEmpty($cachedBooks);
118118
$this->assertNotEmpty($cachedStores);
119119

120-
$this->artisan('modelCache:flush');
120+
$this->artisan('modelCache:clear');
121121

122122
$key = sha1('genealabs:laravel-model-caching:testing:genealabslaravelmodelcachingtestsfixturesauthor');
123123
$tags = ['genealabs:laravel-model-caching:testing:genealabslaravelmodelcachingtestsfixturesauthor'];

0 commit comments

Comments
 (0)