Skip to content

Commit efcb97c

Browse files
committed
formatting
1 parent 61ae1ee commit efcb97c

File tree

1 file changed

+21
-17
lines changed

1 file changed

+21
-17
lines changed

src/Illuminate/Cache/Console/ClearCommand.php

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,35 @@ public function __construct(CacheManager $cache, Filesystem $files)
6060
*/
6161
public function handle()
6262
{
63-
$this->laravel['events']->fire('cache:clearing', [$this->argument('store'), $this->tags()]);
63+
$this->laravel['events']->fire(
64+
'cache:clearing', [$this->argument('store'), $this->tags()]
65+
);
6466

6567
$this->cache()->flush();
6668

67-
$this->clearRealTimeFacades();
69+
$this->flushFacades();
6870

69-
$this->laravel['events']->fire('cache:cleared', [$this->argument('store'), $this->tags()]);
71+
$this->laravel['events']->fire(
72+
'cache:cleared', [$this->argument('store'), $this->tags()]
73+
);
7074

7175
$this->info('Cache cleared successfully.');
7276
}
7377

78+
/**
79+
* Flush the real-time facades stored in the cache directory.
80+
*
81+
* @return void
82+
*/
83+
public function flushFacades()
84+
{
85+
foreach ($this->files->files(storage_path('framework/cache')) as $file) {
86+
if (preg_match('/facade-.*\.php$/', $file)) {
87+
$this->files->delete($file);
88+
}
89+
}
90+
}
91+
7492
/**
7593
* Get the cache instance for the command.
7694
*
@@ -116,18 +134,4 @@ protected function getOptions()
116134
['tags', null, InputOption::VALUE_OPTIONAL, 'The cache tags you would like to clear.', null],
117135
];
118136
}
119-
120-
/**
121-
* Clear real-time facades stored in the framework's cache directory.
122-
*
123-
* @return void
124-
*/
125-
public function clearRealTimeFacades()
126-
{
127-
foreach ($this->files->files(storage_path('framework/cache')) as $file) {
128-
if (preg_match('/facade-.*\.php$/', $file)) {
129-
$this->files->delete($file);
130-
}
131-
}
132-
}
133137
}

0 commit comments

Comments
 (0)