Skip to content

Commit edbeb39

Browse files
authored
refactor: Remove older versions (#53)
* refactor: Remove older versions * 🎨 * rename file * rename file * Fix styling * patch * Fix styling * remove cache * update ignore * exclude 8.0 and laravel 10
1 parent 4ecbb97 commit edbeb39

File tree

11 files changed

+64
-94
lines changed

11 files changed

+64
-94
lines changed

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
3+
updates:
4+
5+
- package-ecosystem: "github-actions"
6+
directory: "/"
7+
schedule:
8+
interval: "weekly"

.github/workflows/php-cs-fixer.yml

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,19 @@ name: Check & fix styling
33
on: [push]
44

55
jobs:
6-
style:
7-
runs-on: ubuntu-latest
6+
php-cs-fixer:
7+
runs-on: ubuntu-latest
88

9-
steps:
10-
- name: Checkout code
11-
uses: actions/checkout@v2
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v3
1212

13-
- name: Fix style
14-
uses: docker://oskarstark/php-cs-fixer-ga
15-
with:
16-
args: --config=.php_cs --allow-risky=yes
13+
- name: Run PHP CS Fixer
14+
uses: docker://oskarstark/php-cs-fixer-ga
15+
with:
16+
args: --config=.php_cs.dist.php --allow-risky=yes
1717

18-
- name: Extract branch name
19-
shell: bash
20-
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
21-
id: extract_branch
22-
23-
- name: Commit changes
24-
uses: stefanzweifel/[email protected]
25-
with:
26-
commit_message: Fix styling
27-
branch: ${{ steps.extract_branch.outputs.branch }}
28-
env:
29-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
- name: Commit changes
19+
uses: stefanzweifel/git-auto-commit-action@v4
20+
with:
21+
commit_message: Fix styling

.github/workflows/run-tests-L7.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/run-tests-L8.yml renamed to .github/workflows/run-tests.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Run Tests - Current"
1+
name: "Run Tests"
22

33
on: [push]
44

@@ -9,18 +9,21 @@ jobs:
99
strategy:
1010
fail-fast: true
1111
matrix:
12-
php: [7.4, 7.3, 8.1]
13-
laravel: [8.*, 10.*]
12+
php: [8.0, 8.1, 8.2]
13+
laravel: [9.*, 10.*]
1414
dependency-version: [prefer-lowest, prefer-stable]
15+
exclude:
16+
- laravel: 10.*
17+
php: 8.0
1518

1619
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}
1720

1821
steps:
1922
- name: Checkout code
20-
uses: actions/checkout@v2
23+
uses: actions/checkout@v3
2124

2225
- name: Cache dependencies
23-
uses: actions/cache@v2
26+
uses: actions/cache@v3
2427
with:
2528
path: ~/.composer/cache/files
2629
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
@@ -40,7 +43,7 @@ jobs:
4043
- name: Execute tests
4144
run: vendor/bin/phpunit tests
4245

43-
- uses: codecov/codecov-action@v1
46+
- uses: codecov/codecov-action@v3
4447
with:
4548
token: ${{ secrets.CODECOV_TOKEN }}
46-
directory: build
49+
directory: build

.gitignore

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
/vendor
1+
build
22
composer.lock
3-
.DS_Store
4-
/build
3+
vendor
4+
.php_cs.cache
5+
coverage
6+
.phpunit.result.cache
57
/.idea
68
/.vscode
7-
.phpunit.result.cache
8-
.php_cs.cache
9+
.php-cs-fixer.cache
10+
.DS_Store

.php_cs renamed to .php_cs.dist.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
->ignoreDotFiles(true)
1414
->ignoreVCS(true);
1515

16-
return PhpCsFixer\Config::create()
16+
return (new PhpCsFixer\Config())
1717
->setRules([
1818
'@PSR2' => true,
1919
'array_syntax' => ['syntax' => 'short'],
20-
'ordered_imports' => ['sortAlgorithm' => 'length'],
20+
'ordered_imports' => ['sort_algorithm' => 'length'],
2121
'no_unused_imports' => true,
2222
'not_operator_with_successor_space' => true,
23-
'trailing_comma_in_multiline_array' => true,
23+
'trailing_comma_in_multiline' => true,
2424
'phpdoc_scalar' => true,
2525
'unary_operator_spaces' => true,
2626
'binary_operator_spaces' => true,
@@ -29,9 +29,15 @@
2929
],
3030
'phpdoc_single_line_var_spacing' => true,
3131
'phpdoc_var_without_name' => true,
32+
'class_attributes_separation' => [
33+
'elements' => [
34+
'method' => 'one',
35+
],
36+
],
3237
'method_argument_space' => [
3338
'on_multiline' => 'ensure_fully_multiline',
3439
'keep_multiple_spaces_after_comma' => true,
35-
]
40+
],
41+
'single_trait_insert_per_statement' => true,
3642
])
3743
->setFinder($finder);

composer.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^7.2.5|^8.0",
20-
"illuminate/support": "^5.8|^6|^7|^8|^9|^10.0",
21-
"illuminate/console": "^5.8|^6|^7|^8|^9|^10.0",
22-
"guzzlehttp/guzzle": "^6.5|^7",
23-
"geoip2/geoip2": "^2.11"
19+
"php": "^8.0",
20+
"illuminate/support": "^9|^10.0",
21+
"illuminate/console": "^9|^10.0",
22+
"guzzlehttp/guzzle": "^7.2",
23+
"geoip2/geoip2": "^2.13"
2424
},
2525
"require-dev": {
26-
"phpunit/phpunit": "^8.0|^9.0",
27-
"mockery/mockery": "^1.2.3"
26+
"phpunit/phpunit": "^9.5.24",
27+
"mockery/mockery": "^1.5"
2828
},
2929
"autoload": {
3030
"psr-4": {

src/Drivers/IpStackDriver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ public function get($ip)
3838
'city' => Arr::get($data, 'city'),
3939
'country' => Arr::get($data, 'country_name'),
4040
'countryCode' => Arr::get($data, 'country_code'),
41-
'latitude' => (float) number_format(Arr::get($data, 'latitude'), 5),
42-
'longitude' => (float) number_format(Arr::get($data, 'longitude'), 5),
41+
'latitude' => (float) number_format(Arr::get($data, 'latitude', 0), 5),
42+
'longitude' => (float) number_format(Arr::get($data, 'longitude', 0), 5),
4343
'region' => Arr::get($data, 'region_name'),
4444
'regionCode' => Arr::get($data, 'region_code'),
4545
'timezone' => Arr::get($data, 'time_zone.id'),

src/Drivers/MaxmindApiDriver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ protected function create()
2020
$userId = Arr::get($this->config, 'user_id', false);
2121
$licenseKey = Arr::get($this->config, 'license_key', false);
2222
$host = Arr::get($this->config, 'host');
23-
$locales = Arr::get($this->config, 'locales');
23+
$locales = Arr::get($this->config, 'locales', ['en']);
2424

2525
// check and make sure they are set
2626
if (! $userId || ! $licenseKey) {
2727
throw new InvalidCredentialsException();
2828
}
2929

30-
return new Client((int) $userId, $licenseKey, $locales, ['host'=>$host]);
30+
return new Client((int) $userId, $licenseKey, $locales, ['host' => $host]);
3131
}
3232
}

src/Drivers/TelizeDriver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ public function get($ip)
3838
'city' => Arr::get($data, 'city'),
3939
'country' => Arr::get($data, 'country'),
4040
'countryCode' => Arr::get($data, 'country_code'),
41-
'latitude' => (float) number_format(Arr::get($data, 'latitude'), 5),
42-
'longitude' => (float) number_format(Arr::get($data, 'longitude'), 5),
41+
'latitude' => (float) number_format(Arr::get($data, 'latitude', 0), 5),
42+
'longitude' => (float) number_format(Arr::get($data, 'longitude', 0), 5),
4343
'region' => Arr::get($data, 'region'),
4444
'regionCode' => Arr::get($data, 'region_code'),
4545
'timezone' => Arr::get($data, 'timezone'),

0 commit comments

Comments
 (0)