Skip to content

Commit e313d23

Browse files
committed
Fix coding style issues
1 parent e612f0d commit e313d23

File tree

7 files changed

+19
-18
lines changed

7 files changed

+19
-18
lines changed

src/Console/Update.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ public function handle(): int
2929
try {
3030
$service = app('geoip')->getService();
3131
} catch (MissingConfigurationException $e) {
32-
$this->components->error($e->getMessage()) ;
33-
32+
$this->components->error($e->getMessage());
33+
3434
return static::FAILURE;
3535
}
3636

src/Exceptions/MissingConfigurationException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66

77
use RuntimeException;
88

9-
class MissingConfigurationException extends RuntimeException {
10-
9+
class MissingConfigurationException extends RuntimeException
10+
{
1111
}

src/Services/AbstractService.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,22 +62,23 @@ public function config($key, $default = null)
6262
* This method ensures that the given key was filled
6363
* by the user, so that the service can be called without
6464
* errors raised linked to missing configuration.
65-
*
65+
*
6666
* @param string|string[] $key
6767
* @return void
6868
*/
69-
public function ensureConfigurationParameterDefined($keys) {
69+
public function ensureConfigurationParameterDefined($keys)
70+
{
7071
// Be able to accept a string and an array of strings.
71-
$keys = is_string($keys) ? [$keys] : $keys ;
72+
$keys = is_string($keys) ? [$keys] : $keys;
7273

73-
foreach($keys as $key) {
74-
$config = $this->config($key) ;
74+
foreach ($keys as $key) {
75+
$config = $this->config($key);
7576

7677
// If the config is not defined / is empty.
77-
if(empty($config)) {
78-
$service = (new \ReflectionClass($this))->getShortName() ;
79-
80-
throw new MissingConfigurationException("Missing '$key' parameter (service: $service)") ;
78+
if (empty($config)) {
79+
$service = (new \ReflectionClass($this))->getShortName();
80+
81+
throw new MissingConfigurationException("Missing '{$key}' parameter (service: {$service})");
8182
}
8283
}
8384
}

src/Services/IPData.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class IPData extends AbstractService
2424
*/
2525
public function boot()
2626
{
27-
$this->ensureConfigurationParameterDefined('key') ;
27+
$this->ensureConfigurationParameterDefined('key');
2828

2929
$this->client = new HttpClient([
3030
'base_uri' => 'https://api.ipdata.co/',

src/Services/IPFinder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ class IPFinder extends AbstractService
2222
*/
2323
public function boot()
2424
{
25-
$this->ensureConfigurationParameterDefined('key') ;
26-
25+
$this->ensureConfigurationParameterDefined('key');
26+
2727
$this->client = new HttpClient([
2828
'base_uri' => 'https://api.ipfinder.io/v1/',
2929
'headers' => [

src/Services/MaxMindDatabase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class MaxMindDatabase extends AbstractService
2424
*/
2525
public function boot()
2626
{
27-
$this->ensureConfigurationParameterDefined('database_path') ;
27+
$this->ensureConfigurationParameterDefined('database_path');
2828

2929
$path = $this->config('database_path');
3030
assert(is_string($path), 'Invalid "database_path" config value');

src/Services/MaxMindWebService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class MaxMindWebService extends AbstractService
2424
*/
2525
public function boot()
2626
{
27-
$this->ensureConfigurationParameterDefined(['user_id', 'license_key']) ;
27+
$this->ensureConfigurationParameterDefined(['user_id', 'license_key']);
2828

2929
$this->client = new Client(
3030
(int) $this->config('user_id'),

0 commit comments

Comments
 (0)