From 213953a9b57c9ace04a506d2f7c3c04655c61711 Mon Sep 17 00:00:00 2001 From: alexmerlin Date: Fri, 31 Oct 2025 07:02:24 +0200 Subject: [PATCH] Issue #46: Remove PHP 8.1 and add PHP 8.4 & 8.5 support Signed-off-by: alexmerlin --- .github/workflows/codecov.yml | 1 + .github/workflows/static-analysis.yml | 1 + README.md | 16 ++++++++-------- SECURITY.md | 10 ++++------ composer.json | 2 +- docs/book/v3/manage-geolite2-database.md | 4 ++-- docs/book/v3/overview.md | 4 ++-- docs/book/v3/usage.md | 8 ++++---- 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 32a1a00..c0fbc53 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -18,6 +18,7 @@ jobs: - "8.2" - "8.3" - "8.4" + - "8.5" steps: - name: Checkout diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index dc4b6fa..9976515 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -18,6 +18,7 @@ jobs: - "8.2" - "8.3" - "8.4" + - "8.5" steps: - name: Checkout diff --git a/README.md b/README.md index c081b86..c471b67 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Documentation is available at: https://docs.dotkernel.org/dot-geoip/. ## Badges ![OSS Lifecycle](https://img.shields.io/osslifecycle/dotkernel/dot-geoip) -![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-geoip/3.9.0) +![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-geoip/3.10.0) [![GitHub issues](https://img.shields.io/github/issues/dotkernel/dot-geoip)](https://github.com/dotkernel/dot-geoip/issues) [![GitHub forks](https://img.shields.io/github/forks/dotkernel/dot-geoip)](https://github.com/dotkernel/dot-geoip/network) @@ -31,7 +31,7 @@ composer require dotkernel/dot-geoip ``` If your application didn't already use it, the above command also installed [dotkernel/dot-cli](https://github.com/dotkernel/dot-cli). -In this case, see it's [README](https://github.com/dotkernel/dot-cli/blob/3.0/README.md) file on how to use it. +In this case, see its [README](https://github.com/dotkernel/dot-cli/blob/3.0/README.md) file on how to use it. Copy config file `vendor/dotkernel/dot-geoip/config/autoload/geoip.global.php` into your application's `config/autoload` directory. @@ -49,7 +49,7 @@ Dot\GeoIP\Command\GeoIpCommand::getDefaultName() => Dot\GeoIP\Command\GeoIpComma ## Manage GeoLite2 database -You can download/update a specific GeoLite2 database, by running the following command: +You can download/update a specific GeoLite2 database by running the following command: ```shell php ./bin/cli.php geoip:synchronize -d {DATABASE} @@ -57,7 +57,7 @@ php ./bin/cli.php geoip:synchronize -d {DATABASE} Where _{DATABASE}_ takes one of the following values: `asn`, `city`, `country`. -You can download/update all GeoLite2 databases at once, by running the following command: +You can download/update all GeoLite2 databases at once by running the following command: ```shell php ./bin/cli.php geoip:synchronize @@ -115,16 +115,16 @@ class ExampleService try { // You can use any of the below methods: - // Get CountryData which includes isEuMember, isoCode and name + // Get CountryData, which includes isEuMember, isoCode and name return $this->locationService->getCountry($ipAddress); - // Get ContinentData which includes code and name + // Get ContinentData, which includes code and name return $this->locationService->getContinent($ipAddress); - // Get OrganizationData which includes asn and name + // Get OrganizationData, which includes asn and name return $this->locationService->getOrganization($ipAddress); - // Get LocationData which includes all of the above + estimated coordinates + timezone + // Get LocationData, which includes all the above + estimated coordinates and timezone return $this->locationService->getLocation($ipAddress); } catch (Throwable $exception) { // handle errors diff --git a/SECURITY.md b/SECURITY.md index ebfcf22..3251d56 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,12 +2,10 @@ ## Supported Versions - -| Version | Supported | PHP Version | -|---------|--------------------|------------------------------------------------------------------------------------------------------------------------| -| 3.x | :white_check_mark: | ![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-geoip/3.6.0) | -| <= 2.x | :x: | | - +| Version | Supported | PHP Version | +|---------|--------------------|------------------------------------------------------------------------------------------------------------| +| 3.x | :white_check_mark: | ![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-geoip/3.10.0) | +| <= 2.x | :x: | | ## Reporting Potential Security Issues diff --git a/composer.json b/composer.json index 8baf059..6458f4a 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ } }, "require": { - "php": "~8.2.0 || ~8.3.0 || ~8.4.0", + "php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0", "dotkernel/dot-cli": "^3.5", "geoip2/geoip2": "^3.0", "guzzlehttp/guzzle": "^7.8", diff --git a/docs/book/v3/manage-geolite2-database.md b/docs/book/v3/manage-geolite2-database.md index 60f6a11..baa857b 100644 --- a/docs/book/v3/manage-geolite2-database.md +++ b/docs/book/v3/manage-geolite2-database.md @@ -1,6 +1,6 @@ # Manage GeoLite2 database -You can download/update a specific GeoLite2 database, by running the following command: +You can download/update a specific GeoLite2 database by running the following command: ```shell php ./bin/cli.php geoip:synchronize -d {DATABASE} @@ -8,7 +8,7 @@ php ./bin/cli.php geoip:synchronize -d {DATABASE} Where _{DATABASE}_ takes one of the following values: `asn`, `city`, `country`. -You can download/update all GeoLite2 databases at once, by running the following command: +You can download/update all GeoLite2 databases at once by running the following command: ```shell php ./bin/cli.php geoip:synchronize diff --git a/docs/book/v3/overview.md b/docs/book/v3/overview.md index 2af92ec..ecffac8 100644 --- a/docs/book/v3/overview.md +++ b/docs/book/v3/overview.md @@ -7,7 +7,7 @@ Dotkernel component to provide geographical details about an IP address. ## Badges ![OSS Lifecycle](https://img.shields.io/osslifecycle/dotkernel/dot-geoip) -![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-geoip/3.9.0) +![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-geoip/3.10.0) [![GitHub issues](https://img.shields.io/github/issues/dotkernel/dot-geoip)](https://github.com/dotkernel/dot-geoip/issues) [![GitHub forks](https://img.shields.io/github/forks/dotkernel/dot-geoip)](https://github.com/dotkernel/dot-geoip/network) @@ -15,5 +15,5 @@ Dotkernel component to provide geographical details about an IP address. [![GitHub license](https://img.shields.io/github/license/dotkernel/dot-geoip)](https://github.com/dotkernel/dot-geoip/blob/3.0/LICENSE) [![Build Static](https://github.com/dotkernel/dot-geoip/actions/workflows/continuous-integration.yml/badge.svg?branch=3.0)](https://github.com/dotkernel/dot-geoip/actions/workflows/continuous-integration.yml) -[![codecov](https://codecov.io/gh/dotkernel/dot-geoip/graph/badge.svg?token=HZKFRQWDSV)](https://codecov.io/gh/dotkernel/dot-geoip) +[![codecov](https://codecov.io/gh/dotkernel/dot-geoip/graph/badge.svg?token=K473P7MDZ4)](https://codecov.io/gh/dotkernel/dot-geoip) [![PHPStan](https://github.com/dotkernel/dot-geoip/actions/workflows/static-analysis.yml/badge.svg?branch=3.0)](https://github.com/dotkernel/dot-geoip/actions/workflows/static-analysis.yml) diff --git a/docs/book/v3/usage.md b/docs/book/v3/usage.md index f1d6b53..c0d7a80 100644 --- a/docs/book/v3/usage.md +++ b/docs/book/v3/usage.md @@ -35,15 +35,15 @@ class ExampleService */ public function myMethod(string $ipAddress): object { - return $this->locationService->getCountry($ipAddress); // Returns instance of Dot\GeoIP\Data\CountryData + return $this->locationService->getCountry($ipAddress); // Returns an instance of Dot\GeoIP\Data\CountryData return $this->locationService->getCity($ipAddress); // Return instance of Dot\GeoIP\Data\CityData - return $this->locationService->getContinent($ipAddress) // Returns instance of Dot\GeoIP\Data\ContinentData + return $this->locationService->getContinent($ipAddress) // Returns an instance of Dot\GeoIP\Data\ContinentData - return $this->locationService->getOrganization($ipAddress) // Returns instance of Dot\GeoIP\Data\OrganizationData + return $this->locationService->getOrganization($ipAddress) // Returns an instance of Dot\GeoIP\Data\OrganizationData - return $this->locationService->getLocation($ipAddress) // Returns instance of Dot\GeoIP\Data\LocationData + return $this->locationService->getLocation($ipAddress) // Returns an instance of Dot\GeoIP\Data\LocationData } } ```