Skip to content

Commit b5d77ed

Browse files
authored
Merge pull request #88 from hughsaffar/master
Add handle method in order to delegate to fire method for Laravel 5.5
2 parents 9e7bff7 + 1386eb9 commit b5d77ed

File tree

3 files changed

+26
-7
lines changed

3 files changed

+26
-7
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/vendor
22
composer.phar
33
composer.lock
4-
.DS_Store
4+
.DS_Store
5+
.idea/*

src/Console/Clear.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,18 @@ class Clear extends Command
2020
*/
2121
protected $description = 'Clear GeoIP cached locations.';
2222

23+
/**
24+
* Execute the console command for Laravel 5.5 and newer.
25+
* @return void
26+
*/
27+
public function handle()
28+
{
29+
$this->fire();
30+
}
31+
2332
/**
2433
* Execute the console command.
34+
* @return void
2535
*/
2636
public function fire()
2737
{
@@ -40,7 +50,7 @@ public function fire()
4050
protected function isSupported()
4151
{
4252
return empty(app('geoip')->config('cache_tags')) === false
43-
&& in_array(config('cache.default'), ['file', 'database']) === false;
53+
&& in_array(config('cache.default'), ['file', 'database']) === false;
4454
}
4555

4656
/**
@@ -56,4 +66,4 @@ protected function performFlush()
5666

5767
$this->output->writeln("<info>complete</info>");
5868
}
59-
}
69+
}

src/Console/Update.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ class Update extends Command
2020
*/
2121
protected $description = 'Update GeoIP database files to the latest version';
2222

23+
/**
24+
* Execute the console command for Laravel 5.5 and newer.
25+
* @return void
26+
*/
27+
public function handle()
28+
{
29+
$this->fire();
30+
}
31+
2332
/**
2433
* Execute the console command.
2534
*
@@ -32,7 +41,7 @@ public function fire()
3241

3342
// Ensure the selected service supports updating
3443
if (method_exists($service, 'update') === false) {
35-
$this->info('The current service "' . get_class($service). '" does not support updating.');
44+
$this->info('The current service "' . get_class($service) . '" does not support updating.');
3645
return;
3746
}
3847

@@ -41,9 +50,8 @@ public function fire()
4150
// Perform update
4251
if ($result = $service->update()) {
4352
$this->info($result);
44-
}
45-
else {
53+
} else {
4654
$this->error('Update failed!');
4755
}
4856
}
49-
}
57+
}

0 commit comments

Comments
 (0)