Skip to content

Commit dc3c4fc

Browse files
committed
Linter
1 parent c868cda commit dc3c4fc

File tree

9 files changed

+25
-18
lines changed

9 files changed

+25
-18
lines changed

src/Console/Clear.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class Clear extends Command
2222

2323
/**
2424
* Execute the console command for Laravel 5.5 and newer.
25+
*
2526
* @return void
2627
*/
2728
public function handle()
@@ -31,6 +32,7 @@ public function handle()
3132

3233
/**
3334
* Execute the console command.
35+
*
3436
* @return void
3537
*/
3638
public function fire()
@@ -50,7 +52,7 @@ public function fire()
5052
protected function isSupported()
5153
{
5254
return empty(app('geoip')->config('cache_tags')) === false
53-
&& in_array(config('cache.default'), ['file', 'database']) === false;
55+
&& in_array(config('cache.default'), ['file', 'database']) === false;
5456
}
5557

5658
/**

src/Console/Update.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class Update extends Command
2222

2323
/**
2424
* Execute the console command for Laravel 5.5 and newer.
25+
*
2526
* @return void
2627
*/
2728
public function handle()
@@ -42,6 +43,7 @@ public function fire()
4243
// Ensure the selected service supports updating
4344
if (method_exists($service, 'update') === false) {
4445
$this->info('The current service "' . get_class($service) . '" does not support updating.');
46+
4547
return;
4648
}
4749

@@ -50,7 +52,8 @@ public function fire()
5052
// Perform update
5153
if ($result = $service->update()) {
5254
$this->info($result);
53-
} else {
55+
}
56+
else {
5457
$this->error('Update failed!');
5558
}
5659
}

src/GeoIP.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ private function find($ip = null)
133133
{
134134
// If IP not set, user remote IP
135135
$ip = $ip ?: $this->remote_ip;
136-
136+
137137
// Check cache for location
138138
if ($this->config('cache', 'none') !== 'none' && $location = $this->getCache()->get($ip)) {
139139
$location->cached = true;
@@ -284,7 +284,7 @@ private function shouldCache($ip = null, Location $location)
284284
return false;
285285
}
286286

287-
switch($this->config('cache', 'none')) {
287+
switch ($this->config('cache', 'none')) {
288288
case 'all':
289289
return true;
290290
case 'some' && $ip === null:

src/Location.php

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ public function __set($key, $value)
130130
/**
131131
* Determine if the given attribute exists.
132132
*
133-
* @param mixed $offset
133+
* @param mixed $offset
134+
*
134135
* @return bool
135136
*/
136137
public function offsetExists($offset)
@@ -141,7 +142,8 @@ public function offsetExists($offset)
141142
/**
142143
* Get the value for a given offset.
143144
*
144-
* @param mixed $offset
145+
* @param mixed $offset
146+
*
145147
* @return mixed
146148
*/
147149
public function offsetGet($offset)
@@ -152,8 +154,9 @@ public function offsetGet($offset)
152154
/**
153155
* Set the value for a given offset.
154156
*
155-
* @param mixed $offset
156-
* @param mixed $value
157+
* @param mixed $offset
158+
* @param mixed $value
159+
*
157160
* @return void
158161
*/
159162
public function offsetSet($offset, $value)
@@ -164,7 +167,8 @@ public function offsetSet($offset, $value)
164167
/**
165168
* Unset the value for a given offset.
166169
*
167-
* @param mixed $offset
170+
* @param mixed $offset
171+
*
168172
* @return void
169173
*/
170174
public function offsetUnset($offset)
@@ -187,7 +191,8 @@ public function __isset($key)
187191
/**
188192
* Unset an attribute on the location.
189193
*
190-
* @param string $key
194+
* @param string $key
195+
*
191196
* @return void
192197
*/
193198
public function __unset($key)

src/Services/AbstractService.php

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

33
namespace Torann\GeoIP\Services;
44

5-
use Torann\GeoIP\GeoIP;
65
use Torann\GeoIP\Location;
76
use Illuminate\Support\Arr;
87
use Torann\GeoIP\Contracts\ServiceInterface;

src/Services/IPGeoLocation.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ class IPGeoLocation extends AbstractService
2323
public function boot()
2424
{
2525
$base = [
26-
'base_uri' => 'https://api.ipgeolocation.io/'
26+
'base_uri' => 'https://api.ipgeolocation.io/',
2727
];
2828

2929
if ($this->config('key')) {
30-
$base['base_uri'] = $base['base_uri']."ipgeo?apiKey=". $this->config('key');
30+
$base['base_uri'] = "{$base['base_uri']}ipgeo?apiKey=" . $this->config('key');
3131
}
3232

3333
$this->client = new HttpClient($base);
@@ -48,7 +48,7 @@ public function locate($ip)
4848
}
4949

5050
// Parse body content
51-
$json = json_decode($data[0],true);
51+
$json = json_decode($data[0], true);
5252

5353
return $this->hydrate($json);
5454

src/Services/MaxMindDatabase.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use Exception;
66
use GeoIp2\Database\Reader;
7-
use GeoIp2\Exception\AddressNotFoundException;
87

98
class MaxMindDatabase extends AbstractService
109
{
@@ -75,7 +74,7 @@ public function update()
7574
$headers = get_headers($url);
7675

7776
if (substr($headers[0], 9, 3) != '200') {
78-
throw new Exception('Unable to download database. ('. substr($headers[0], 13) .')');
77+
throw new Exception('Unable to download database. (' . substr($headers[0], 13) . ')');
7978
}
8079

8180
// Download zipped database to a system temp file

src/Services/MaxMindWebService.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Torann\GeoIP\Services;
44

55
use GeoIp2\WebService\Client;
6-
use GeoIp2\Exception\AddressNotFoundException;
76

87
class MaxMindWebService extends AbstractService
98
{

tests/TestFunctions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function env($key, $default = null)
1414
}
1515
}
1616

17-
if (! function_exists('app')) {
17+
if (!function_exists('app')) {
1818
function app($key = null, $default = null)
1919
{
2020
return \Torann\GeoIP\Tests\TestCase::$functions->app($key, $default);

0 commit comments

Comments
 (0)