Skip to content

Commit 61b79df

Browse files
committed
fixes
1 parent a682296 commit 61b79df

File tree

12 files changed

+41
-35
lines changed

12 files changed

+41
-35
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22
composer.lock
33
.DS_Store
44
/build
5-
.idea
5+
/.idea
6+
/.vscode
7+
.phpunit.result.cache

.php_cs

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@ return PhpCsFixer\Config::create()
88
'method_separation' => true,
99
'no_multiline_whitespace_before_semicolons' => true,
1010
'single_quote' => true,
11+
'ordered_imports' => [
12+
'sort_algorithm' => 'length',
13+
],
1114

1215
'binary_operator_spaces' => [
1316
'align_double_arrow' => false,
1417
'align_equals' => false,
1518
],
1619
'blank_line_after_opening_tag' => true,
17-
'blank_line_before_return' => true, // DEPRECATED: use blank_line_before_statement instead.
20+
'blank_line_before_return' => true,
1821
'blank_line_before_statement' => [
1922
'statements' => [
2023
'break',
@@ -28,21 +31,22 @@ return PhpCsFixer\Config::create()
2831
'braces' => [
2932
'allow_single_line_closure' => true,
3033
],
31-
// 'cast_spaces' => true,
32-
// 'class_definition' => ['singleLine' => true],
34+
'cast_spaces' => [
35+
'space' => 'single',
36+
],
3337
'concat_space' => ['spacing' => 'none'],
3438
'declare_equal_normalize' => true,
3539
'function_typehint_space' => true,
3640
'hash_to_slash_comment' => true,
3741
'include' => true,
3842
'lowercase_cast' => true,
39-
// 'native_function_casing' => true,
43+
'native_function_casing' => true,
4044
// 'new_with_braces' => true,
41-
// 'no_blank_lines_after_class_opening' => true,
42-
// 'no_blank_lines_after_phpdoc' => true,
43-
// 'no_empty_comment' => true,
44-
// 'no_empty_phpdoc' => true,
45-
// 'no_empty_statement' => true,
45+
'no_blank_lines_after_class_opening' => true,
46+
'no_blank_lines_after_phpdoc' => true,
47+
'no_empty_comment' => true,
48+
'no_empty_phpdoc' => true,
49+
'no_empty_statement' => true,
4650
'no_extra_consecutive_blank_lines' => [
4751
'curly_brace_block',
4852
'extra',
@@ -69,18 +73,20 @@ return PhpCsFixer\Config::create()
6973
// 'normalize_index_brace' => true,
7074
'object_operator_without_whitespace' => true,
7175
// 'php_unit_fqcn_annotation' => true,
72-
// 'phpdoc_align' => true,
76+
'phpdoc_align' => [
77+
'align' => 'vertical',
78+
],
7379
// 'phpdoc_annotation_without_dot' => true,
74-
// 'phpdoc_indent' => true,
80+
'phpdoc_indent' => true,
7581
// 'phpdoc_inline_tag' => true,
7682
// 'phpdoc_no_access' => true,
7783
// 'phpdoc_no_alias_tag' => true,
7884
// 'phpdoc_no_empty_return' => true,
79-
// 'phpdoc_no_package' => true,
85+
'phpdoc_no_package' => true,
8086
// 'phpdoc_no_useless_inheritdoc' => true,
8187
// 'phpdoc_return_self_reference' => true,
82-
// 'phpdoc_scalar' => true,
83-
// 'phpdoc_separation' => true,
88+
'phpdoc_scalar' => true,
89+
'phpdoc_separation' => true,
8490
// 'phpdoc_single_line_var_spacing' => true,
8591
// 'phpdoc_summary' => true,
8692
// 'phpdoc_to_comment' => true,
@@ -90,11 +96,11 @@ return PhpCsFixer\Config::create()
9096
// 'pre_increment' => true,
9197
// 'return_type_declaration' => true,
9298
// 'self_accessor' => true,
93-
// 'short_scalar_cast' => true,
99+
'short_scalar_cast' => true,
94100
'single_blank_line_before_namespace' => true,
95101
// 'single_class_element_per_statement' => true,
96-
// 'space_after_semicolon' => true,
97-
// 'standardize_not_equals' => true,
102+
'space_after_semicolon' => true,
103+
'standardize_not_equals' => true,
98104
'ternary_operator_spaces' => true,
99105
'trailing_comma_in_multiline_array' => true,
100106
'trim_array_spaces' => true,

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
language: php
22

33
php:
4-
- 7.0
5-
- 7.1
64
- 7.2
75
- 7.3
86

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ GeoIP
1919

2020
## Requirements
2121

22-
* PHP >= 7.0
22+
* PHP >= 7.2
2323

2424
## Installation
2525

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
"geoip2/geoip2": "^2.0"
1818
},
1919
"require-dev": {
20-
"phpunit/phpunit": "^6.0",
21-
"mockery/mockery": "^1.0"
20+
"phpunit/phpunit": "^8.3",
21+
"mockery/mockery": "^1.2.3"
2222
},
2323
"autoload": {
2424
"psr-4": {

src/Drivers/IpStackDriver.php

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

33
namespace PulkitJalan\GeoIP\Drivers;
44

5-
use GuzzleHttp\Exception\RequestException;
65
use Illuminate\Support\Arr;
6+
use GuzzleHttp\Exception\RequestException;
77
use PulkitJalan\GeoIP\Exceptions\InvalidCredentialsException;
88

99
class IpStackDriver extends AbstractGeoIPDriver
@@ -15,7 +15,7 @@ public function __construct(array $config)
1515
{
1616
parent::__construct($config);
1717

18-
if (! array_get($this->config, 'key')) {
18+
if (! Arr::get($this->config, 'key')) {
1919
throw new InvalidCredentialsException();
2020
}
2121
}

src/Drivers/MaxmindDriver.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
namespace PulkitJalan\GeoIP\Drivers;
44

55
use GeoIp2\Database\Reader;
6-
use GeoIp2\Exception\AddressNotFoundException;
7-
use GeoIp2\WebService\Client;
86
use Illuminate\Support\Arr;
9-
use PulkitJalan\GeoIP\Exceptions\InvalidCredentialsException;
7+
use GeoIp2\WebService\Client;
8+
use GeoIp2\Exception\AddressNotFoundException;
109
use PulkitJalan\GeoIP\Exceptions\InvalidDatabaseException;
10+
use PulkitJalan\GeoIP\Exceptions\InvalidCredentialsException;
1111

1212
class MaxmindDriver extends AbstractGeoIPDriver
1313
{

src/Drivers/TelizeDriver.php

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

33
namespace PulkitJalan\GeoIP\Drivers;
44

5-
use GuzzleHttp\Exception\RequestException;
65
use Illuminate\Support\Arr;
6+
use GuzzleHttp\Exception\RequestException;
77
use PulkitJalan\GeoIP\Exceptions\InvalidCredentialsException;
88

99
class TelizeDriver extends AbstractGeoIPDriver
@@ -15,7 +15,7 @@ public function __construct(array $config)
1515
{
1616
parent::__construct($config);
1717

18-
if (! array_get($this->config, 'key')) {
18+
if (! Arr::get($this->config, 'key')) {
1919
throw new InvalidCredentialsException();
2020
}
2121
}

src/GeoIPManager.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
use Illuminate\Support\Arr;
66
use Illuminate\Support\Str;
7-
use PulkitJalan\GeoIP\Drivers\IpStackDriver;
87
use PulkitJalan\GeoIP\Drivers\IPApiDriver;
9-
use PulkitJalan\GeoIP\Drivers\MaxmindDriver;
108
use PulkitJalan\GeoIP\Drivers\TelizeDriver;
9+
use PulkitJalan\GeoIP\Drivers\IpStackDriver;
10+
use PulkitJalan\GeoIP\Drivers\MaxmindDriver;
1111
use PulkitJalan\GeoIP\Exceptions\InvalidDriverException;
1212

1313
class GeoIPManager

src/GeoIPUpdater.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
namespace PulkitJalan\GeoIP;
44

55
use Exception;
6-
use GuzzleHttp\Client as GuzzleClient;
76
use Illuminate\Support\Arr;
7+
use GuzzleHttp\Client as GuzzleClient;
88

99
class GeoIPUpdater
1010
{

0 commit comments

Comments
 (0)