From 760ab35af56072e21ab0e4882818789d10bb8832 Mon Sep 17 00:00:00 2001 From: horea Date: Fri, 21 Feb 2025 18:37:00 +0200 Subject: [PATCH 1/6] issue-44 Signed-off-by: horea --- .github/workflows/static-analysis.yml | 50 +++++++++++++++++++++ README.md | 1 + composer.json | 10 ++--- phpstan.neon | 8 ++++ psalm.xml | 17 ------- test/Command/GeoIpCommandTest.php | 2 +- test/Data/CityDataTest.php | 6 +-- test/Data/ContinentDataTest.php | 8 ++-- test/Data/CountryDataTest.php | 10 ++--- test/Data/LocationDataTest.php | 16 +++---- test/Data/OrganizationDataTest.php | 8 ++-- test/Factory/GeoIpCommandFactoryTest.php | 2 +- test/Factory/LocationServiceFactoryTest.php | 2 +- test/Service/LocationServiceTest.php | 28 ++++++------ 14 files changed, 105 insertions(+), 63 deletions(-) create mode 100644 .github/workflows/static-analysis.yml create mode 100644 phpstan.neon delete mode 100644 psalm.xml diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml new file mode 100644 index 0000000..5d85d03 --- /dev/null +++ b/.github/workflows/static-analysis.yml @@ -0,0 +1,50 @@ +on: + - push + +name: Run PHPStan checks + +jobs: + mutation: + name: PHPStan ${{ matrix.php }}-${{ matrix.os }} + + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: + - ubuntu-latest + + php: + - "8.1" + - "8.2" + - "8.3" + - "8.4" + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + php-version: "${{ matrix.php }}" + coverage: pcov + ini-values: assert.exception=1, zend.assertions=1, error_reporting=-1, log_errors_max_len=0, display_errors=On + tools: composer:v2, cs2pr + + - name: Determine composer cache directory + run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV + + - name: Cache dependencies installed with composer + uses: actions/cache@v4 + with: + path: ${{ env.COMPOSER_CACHE_DIR }} + key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }} + restore-keys: | + php${{ matrix.php }}-composer- + + - name: Install dependencies with composer + run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi + + - name: Run static analysis with PHPStan + run: vendor/bin/phpstan analyse \ No newline at end of file diff --git a/README.md b/README.md index f9a66b7..8da804d 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ [![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=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) ## Install diff --git a/composer.json b/composer.json index d955c2b..8baf059 100644 --- a/composer.json +++ b/composer.json @@ -27,14 +27,15 @@ "geoip2/geoip2": "^3.0", "guzzlehttp/guzzle": "^7.8", "laminas/laminas-filter": "^2.34", - "psr/container": "^1.1", + "psr/container": "^1.1 || ^2.0.0", "symfony/filesystem": "^7.0" }, "require-dev": { "laminas/laminas-coding-standard": "^3.0", "mikey179/vfsstream": "^1.6.7", - "phpunit/phpunit": "^10.5", - "vimeo/psalm": "^6.0" + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^10.2" }, "autoload": { "psr-4": { @@ -55,7 +56,6 @@ "cs-check": "phpcs", "cs-fix": "phpcbf", "test": "phpunit --colors=always", - "test-coverage": "phpunit --colors=always --coverage-clover clover.xml", - "static-analysis": "psalm --shepherd --stats" + "static-analysis": "phpstan analyse --memory-limit 1G" } } diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..1cf5120 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,8 @@ +includes: + - vendor/phpstan/phpstan-phpunit/extension.neon +parameters: + level: 5 + paths: + - src + - test + treatPhpDocTypesAsCertain: false \ No newline at end of file diff --git a/psalm.xml b/psalm.xml deleted file mode 100644 index 30f61eb..0000000 --- a/psalm.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - diff --git a/test/Command/GeoIpCommandTest.php b/test/Command/GeoIpCommandTest.php index d01cce6..361c908 100644 --- a/test/Command/GeoIpCommandTest.php +++ b/test/Command/GeoIpCommandTest.php @@ -29,7 +29,7 @@ public function testCreateCommand(): void $locationService = $this->createMock(LocationServiceInterface::class); $command = new GeoIpCommand($locationService); - $this->assertInstanceOf(GeoIpCommand::class, $command); + $this->assertContainsOnlyInstancesOf(GeoIpCommand::class, [$command]); } /** diff --git a/test/Data/CityDataTest.php b/test/Data/CityDataTest.php index 14d70cf..e65b8d6 100644 --- a/test/Data/CityDataTest.php +++ b/test/Data/CityDataTest.php @@ -23,17 +23,17 @@ public function testAccessors() { $cityData = new CityData(); $cityData->setName($this->defaults['city']['name']); - $this->assertInstanceOf(CityData::class, $cityData); + $this->assertContainsOnlyInstancesOf(CityData::class, [$cityData]); $this->assertSame($cityData->getName(), $this->defaults['city']['name']); $cityData->setError($this->defaults['city']['error']); - $this->assertInstanceOf(CityData::class, $cityData); + $this->assertContainsOnlyInstancesOf(CityData::class, [$cityData]); $this->assertSame($cityData->getError(), $this->defaults['city']['error']); } public function testExchangeArray() { $cityData = (new CityData())->exchangeArray($this->defaults['city']); - $this->assertInstanceOf(CityData::class, $cityData); + $this->assertContainsOnlyInstancesOf(CityData::class, [$cityData]); $this->assertSame($cityData->getName(), $this->defaults['city']['name']); $this->assertSame($cityData->getError(), $this->defaults['city']['error']); } diff --git a/test/Data/ContinentDataTest.php b/test/Data/ContinentDataTest.php index d5f4abb..e19e308 100644 --- a/test/Data/ContinentDataTest.php +++ b/test/Data/ContinentDataTest.php @@ -24,20 +24,20 @@ public function testAccessors(): void { $continentData = new ContinentData(); $continentData->setCode($this->defaults['continent']['code']); - $this->assertInstanceOf(ContinentData::class, $continentData); + $this->assertContainsOnlyInstancesOf(ContinentData::class, [$continentData]); $this->assertSame($continentData->getCode(), $this->defaults['continent']['code']); $continentData->setName($this->defaults['continent']['name']); - $this->assertInstanceOf(ContinentData::class, $continentData); + $this->assertContainsOnlyInstancesOf(ContinentData::class, [$continentData]); $this->assertSame($continentData->getName(), $this->defaults['continent']['name']); $continentData->setError($this->defaults['continent']['error']); - $this->assertInstanceOf(ContinentData::class, $continentData); + $this->assertContainsOnlyInstancesOf(ContinentData::class, [$continentData]); $this->assertSame($continentData->getError(), $this->defaults['continent']['error']); } public function testExchangeArray(): void { $continentData = (new ContinentData())->exchangeArray($this->defaults['continent']); - $this->assertInstanceOf(ContinentData::class, $continentData); + $this->assertContainsOnlyInstancesOf(ContinentData::class, [$continentData]); $this->assertSame($continentData->getCode(), $this->defaults['continent']['code']); $this->assertSame($continentData->getName(), $this->defaults['continent']['name']); $this->assertSame($continentData->getError(), $this->defaults['continent']['error']); diff --git a/test/Data/CountryDataTest.php b/test/Data/CountryDataTest.php index 2df3b9a..256493f 100644 --- a/test/Data/CountryDataTest.php +++ b/test/Data/CountryDataTest.php @@ -25,23 +25,23 @@ public function testAccessors(): void { $countryData = new CountryData(); $countryData->setIsEuMember($this->defaults['country']['isEuMember']); - $this->assertInstanceOf(CountryData::class, $countryData); + $this->assertContainsOnlyInstancesOf(CountryData::class, [$countryData]); $this->assertSame($countryData->getIsEuMember(), $this->defaults['country']['isEuMember']); $countryData->setIsoCode($this->defaults['country']['isoCode']); - $this->assertInstanceOf(CountryData::class, $countryData); + $this->assertContainsOnlyInstancesOf(CountryData::class, [$countryData]); $this->assertSame($countryData->getIsoCode(), $this->defaults['country']['isoCode']); $countryData->setName($this->defaults['country']['name']); - $this->assertInstanceOf(CountryData::class, $countryData); + $this->assertContainsOnlyInstancesOf(CountryData::class, [$countryData]); $this->assertSame($countryData->getName(), $this->defaults['country']['name']); $countryData->setError($this->defaults['country']['error']); - $this->assertInstanceOf(CountryData::class, $countryData); + $this->assertContainsOnlyInstancesOf(CountryData::class, [$countryData]); $this->assertSame($countryData->getError(), $this->defaults['country']['error']); } public function testExchangeArray(): void { $countryData = (new CountryData())->exchangeArray($this->defaults['country']); - $this->assertInstanceOf(CountryData::class, $countryData); + $this->assertContainsOnlyInstancesOf(CountryData::class, [$countryData]); $this->assertSame($countryData->getIsEuMember(), $this->defaults['country']['isEuMember']); $this->assertSame($countryData->getIsoCode(), $this->defaults['country']['isoCode']); $this->assertSame($countryData->getName(), $this->defaults['country']['name']); diff --git a/test/Data/LocationDataTest.php b/test/Data/LocationDataTest.php index 4d94bc0..cfbcaab 100644 --- a/test/Data/LocationDataTest.php +++ b/test/Data/LocationDataTest.php @@ -32,25 +32,25 @@ public function testAccessors(): void { $locationData = new LocationData(); $locationData->setContinent(new ContinentData()); - $this->assertInstanceOf(LocationData::class, $locationData); + $this->assertContainsOnlyInstancesOf(LocationData::class, [$locationData]); $this->assertInstanceOf(ContinentData::class, $locationData->getContinent()); $locationData->setCountry(new CountryData()); - $this->assertInstanceOf(LocationData::class, $locationData); + $this->assertContainsOnlyInstancesOf(LocationData::class, [$locationData]); $this->assertInstanceOf(CountryData::class, $locationData->getCountry()); $locationData->setCity(new CityData()); - $this->assertInstanceOf(LocationData::class, $locationData); + $this->assertContainsOnlyInstancesOf(LocationData::class, [$locationData]); $this->assertInstanceOf(CityData::class, $locationData->getCity()); $locationData->setOrganization(new OrganizationData()); - $this->assertInstanceOf(LocationData::class, $locationData); + $this->assertContainsOnlyInstancesOf(LocationData::class, [$locationData]); $this->assertInstanceOf(OrganizationData::class, $locationData->getOrganization()); $locationData->setLatitude($this->defaults['latitude']); - $this->assertInstanceOf(LocationData::class, $locationData); + $this->assertContainsOnlyInstancesOf(LocationData::class, [$locationData]); $this->assertSame($locationData->getLatitude(), $this->defaults['latitude']); $locationData->setLongitude($this->defaults['longitude']); - $this->assertInstanceOf(LocationData::class, $locationData); + $this->assertContainsOnlyInstancesOf(LocationData::class, [$locationData]); $this->assertSame($locationData->getLongitude(), $this->defaults['longitude']); $locationData->setTimeZone($this->defaults['timeZone']); - $this->assertInstanceOf(LocationData::class, $locationData); + $this->assertContainsOnlyInstancesOf(LocationData::class, [$locationData]); $this->assertSame($locationData->getTimeZone(), $this->defaults['timeZone']); } @@ -65,7 +65,7 @@ public function testExchangeArray(): void 'longitude' => $this->defaults['longitude'], 'timeZone' => $this->defaults['timeZone'], ]); - $this->assertInstanceOf(LocationData::class, $locationData); + $this->assertContainsOnlyInstancesOf(LocationData::class, [$locationData]); $this->assertInstanceOf(ContinentData::class, $locationData->getContinent()); $this->assertInstanceOf(CountryData::class, $locationData->getCountry()); $this->assertInstanceOf(CityData::class, $locationData->getCity()); diff --git a/test/Data/OrganizationDataTest.php b/test/Data/OrganizationDataTest.php index 710589d..6ef4533 100644 --- a/test/Data/OrganizationDataTest.php +++ b/test/Data/OrganizationDataTest.php @@ -24,20 +24,20 @@ public function testAccessors(): void { $organizationData = new OrganizationData(); $organizationData->setAsn($this->defaults['organization']['asn']); - $this->assertInstanceOf(OrganizationData::class, $organizationData); + $this->assertContainsOnlyInstancesOf(OrganizationData::class, [$organizationData]); $this->assertSame($organizationData->getAsn(), $this->defaults['organization']['asn']); $organizationData->setName($this->defaults['organization']['name']); - $this->assertInstanceOf(OrganizationData::class, $organizationData); + $this->assertContainsOnlyInstancesOf(OrganizationData::class, [$organizationData]); $this->assertSame($organizationData->getName(), $this->defaults['organization']['name']); $organizationData->setError($this->defaults['organization']['error']); - $this->assertInstanceOf(OrganizationData::class, $organizationData); + $this->assertContainsOnlyInstancesOf(OrganizationData::class, [$organizationData]); $this->assertSame($organizationData->getError(), $this->defaults['organization']['error']); } public function testExchangeArray(): void { $organizationData = (new OrganizationData())->exchangeArray($this->defaults['organization']); - $this->assertInstanceOf(OrganizationData::class, $organizationData); + $this->assertContainsOnlyInstancesOf(OrganizationData::class, [$organizationData]); $this->assertSame($organizationData->getAsn(), $this->defaults['organization']['asn']); $this->assertSame($organizationData->getName(), $this->defaults['organization']['name']); $this->assertSame($organizationData->getError(), $this->defaults['organization']['error']); diff --git a/test/Factory/GeoIpCommandFactoryTest.php b/test/Factory/GeoIpCommandFactoryTest.php index abb9e39..3cd3daa 100644 --- a/test/Factory/GeoIpCommandFactoryTest.php +++ b/test/Factory/GeoIpCommandFactoryTest.php @@ -55,6 +55,6 @@ public function testFactoryWillCreateCommand(): void ]); $command = (new GeoIpCommandFactory())($container); - $this->assertInstanceOf(GeoIpCommand::class, $command); + $this->assertContainsOnlyInstancesOf(GeoIpCommand::class, [$command]); } } diff --git a/test/Factory/LocationServiceFactoryTest.php b/test/Factory/LocationServiceFactoryTest.php index cd038c7..04a5285 100644 --- a/test/Factory/LocationServiceFactoryTest.php +++ b/test/Factory/LocationServiceFactoryTest.php @@ -33,6 +33,6 @@ public function testCreateService(): void ]); $service = (new LocationServiceFactory())($container); - $this->assertInstanceOf(LocationService::class, $service); + $this->assertContainsOnlyInstancesOf(LocationService::class, [$service]); } } diff --git a/test/Service/LocationServiceTest.php b/test/Service/LocationServiceTest.php index 7d9cc7b..d250e26 100644 --- a/test/Service/LocationServiceTest.php +++ b/test/Service/LocationServiceTest.php @@ -38,14 +38,14 @@ public function testAccessors(): void $locationService = new LocationService($this->getConfig()); $locationService->setCountryReader($readerService); - $this->assertInstanceOf(LocationService::class, $locationService); - $this->assertInstanceOf(Reader::class, $locationService->getCountryReader()); + $this->assertContainsOnlyInstancesOf(LocationService::class, [$locationService]); + $this->assertContainsOnlyInstancesOf(Reader::class, [$locationService->getCountryReader()]); $locationService->setCityReader($readerService); - $this->assertInstanceOf(LocationService::class, $locationService); - $this->assertInstanceOf(Reader::class, $locationService->getCityReader()); + $this->assertContainsOnlyInstancesOf(LocationService::class, [$locationService]); + $this->assertContainsOnlyInstancesOf(Reader::class, [$locationService->getCityReader()]); $locationService->setAsnReader($readerService); - $this->assertInstanceOf(LocationService::class, $locationService); - $this->assertInstanceOf(Reader::class, $locationService->getAsnReader()); + $this->assertContainsOnlyInstancesOf(LocationService::class, [$locationService]); + $this->assertContainsOnlyInstancesOf(Reader::class, [$locationService->getAsnReader()]); } public function testGetConfigsReturnsValidArray(): void @@ -110,14 +110,14 @@ public function testGetContinentReturnsContinentData(): void $data = (new LocationService($this->getConfig())) ->setCountryReader($countryReader) ->getContinent('1.1.1.1'); - $this->assertInstanceOf(ContinentData::class, $data); + $this->assertContainsOnlyInstancesOf(ContinentData::class, [$data]); } public function testGetContinentReturnsAnError() { $locationService = new LocationService($this->getConfig()); $data = $locationService->getContinent('::1'); - $this->assertInstanceOf(ContinentData::class, $data); + $this->assertContainsOnlyInstancesOf(ContinentData::class, [$data]); $this->assertIsString($data->getError()); } @@ -138,14 +138,14 @@ public function testGetCountryReturnsCountryData(): void $data = (new LocationService($this->getConfig())) ->setCountryReader($countryReader) ->getCountry('1.1.1.1'); - $this->assertInstanceOf(CountryData::class, $data); + $this->assertContainsOnlyInstancesOf(CountryData::class, [$data]); } public function testGetCountryReturnsAnError() { $locationService = new LocationService($this->getConfig()); $data = $locationService->getCountry('::1'); - $this->assertInstanceOf(CountryData::class, $data); + $this->assertContainsOnlyInstancesOf(CountryData::class, [$data]); $this->assertIsString($data->getError()); } @@ -164,14 +164,14 @@ public function testGetCityReturnsCityData() $data = (new LocationService($this->getConfig())) ->setCityReader($cityReader) ->getCity('1.1.1.1'); - $this->assertInstanceOf(CityData::class, $data); + $this->assertContainsOnlyInstancesOf(CityData::class, [$data]); } public function testGetCityReturnsAnError() { $locationService = new LocationService($this->getConfig()); $data = $locationService->getCity('::1'); - $this->assertInstanceOf(CityData::class, $data); + $this->assertContainsOnlyInstancesOf(CityData::class, [$data]); $this->assertIsString($data->getError()); } @@ -223,7 +223,7 @@ public function testGetDatabaseReaderForValidaDatabase(): void { $locationService = new LocationService($this->getConfig()); $reader = $locationService->getDatabaseReader(LocationService::DATABASE_ASN); - $this->assertInstanceOf(Reader::class, $reader); + $this->assertContainsOnlyInstancesOf(Reader::class, [$reader]); } /** @@ -274,7 +274,7 @@ public function testGetLocation(): void ->setAsnReader($asnReader) ->setCityReader($cityReader) ->getLocation($ipAddress); - $this->assertInstanceOf(LocationData::class, $data); + $this->assertContainsOnlyInstancesOf(LocationData::class, [$data]); } /** From 328be46f73791c34a8f6587b7c8146ea9581604e Mon Sep 17 00:00:00 2001 From: horea Date: Mon, 24 Feb 2025 12:33:16 +0200 Subject: [PATCH 2/6] issue-44: implement changes Signed-off-by: horea --- .github/workflows/static-analysis.yml | 97 +++++++++++++-------------- README.md | 10 ++- docs/book/v3/overview.md | 16 ++++- phpstan.neon | 14 ++-- 4 files changed, 79 insertions(+), 58 deletions(-) diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 5d85d03..51ce4be 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -1,50 +1,49 @@ -on: - - push - -name: Run PHPStan checks - -jobs: - mutation: - name: PHPStan ${{ matrix.php }}-${{ matrix.os }} - - runs-on: ${{ matrix.os }} - - strategy: - matrix: - os: - - ubuntu-latest - - php: - - "8.1" - - "8.2" - - "8.3" - - "8.4" - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install PHP - uses: shivammathur/setup-php@v2 - with: - php-version: "${{ matrix.php }}" - coverage: pcov - ini-values: assert.exception=1, zend.assertions=1, error_reporting=-1, log_errors_max_len=0, display_errors=On - tools: composer:v2, cs2pr - - - name: Determine composer cache directory - run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV - - - name: Cache dependencies installed with composer - uses: actions/cache@v4 - with: - path: ${{ env.COMPOSER_CACHE_DIR }} - key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: | - php${{ matrix.php }}-composer- - - - name: Install dependencies with composer - run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi - - - name: Run static analysis with PHPStan +on: + - push + +name: Run PHPStan checks + +jobs: + mutation: + name: PHPStan ${{ matrix.php }}-${{ matrix.os }} + + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: + - ubuntu-latest + + php: + - "8.2" + - "8.3" + - "8.4" + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + php-version: "${{ matrix.php }}" + coverage: pcov + ini-values: assert.exception=1, zend.assertions=1, error_reporting=-1, log_errors_max_len=0, display_errors=On + tools: composer:v2, cs2pr + + - name: Determine composer cache directory + run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV + + - name: Cache dependencies installed with composer + uses: actions/cache@v4 + with: + path: ${{ env.COMPOSER_CACHE_DIR }} + key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }} + restore-keys: | + php${{ matrix.php }}-composer- + + - name: Install dependencies with composer + run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi + + - name: Run static analysis with PHPStan run: vendor/bin/phpstan analyse \ No newline at end of file diff --git a/README.md b/README.md index 8da804d..b409ac2 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,18 @@ # dot-geoip +Dotkernel component to provide geographical details about an IP address + > [!IMPORTANT] > dot-geoip is a wrapper on top of [maxmind/GeoIP2-php](https://github.com/maxmind/GeoIP2-php) +## Documentation + +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.8.1) +![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-geoip/3.9.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) diff --git a/docs/book/v3/overview.md b/docs/book/v3/overview.md index 6352639..8fef483 100644 --- a/docs/book/v3/overview.md +++ b/docs/book/v3/overview.md @@ -1,3 +1,17 @@ # Overview -> dot-geoip is a wrapper on top of [dot-geoip](https://github.com/maxmind/GeoIP2-php) +> dot-geoip is a wrapper on top of [maxmind/GeoIP2-php](https://github.com/maxmind/GeoIP2-php) + +## 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) + +[![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) +[![GitHub stars](https://img.shields.io/github/stars/dotkernel/dot-geoip)](https://github.com/dotkernel/dot-geoip/stargazers) +[![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) +[![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) \ No newline at end of file diff --git a/phpstan.neon b/phpstan.neon index 1cf5120..5ba49f3 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,8 +1,8 @@ -includes: - - vendor/phpstan/phpstan-phpunit/extension.neon -parameters: - level: 5 - paths: - - src - - test +includes: + - vendor/phpstan/phpstan-phpunit/extension.neon +parameters: + level: 5 + paths: + - src + - test treatPhpDocTypesAsCertain: false \ No newline at end of file From e721ef9c7008d308002b0d4f2aa1eff0a9a9fc25 Mon Sep 17 00:00:00 2001 From: horea Date: Mon, 24 Feb 2025 12:35:26 +0200 Subject: [PATCH 3/6] issue-44: implement changes Signed-off-by: horea --- docs/book/v3/overview.md | 2 +- phpstan.neon | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/book/v3/overview.md b/docs/book/v3/overview.md index 8fef483..238721b 100644 --- a/docs/book/v3/overview.md +++ b/docs/book/v3/overview.md @@ -14,4 +14,4 @@ [![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) -[![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) \ No newline at end of file +[![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/phpstan.neon b/phpstan.neon index 5ba49f3..349be25 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -5,4 +5,4 @@ parameters: paths: - src - test - treatPhpDocTypesAsCertain: false \ No newline at end of file + treatPhpDocTypesAsCertain: false From 6e7cd9dc019c0b1e1d4437f04ce3887ed04879e6 Mon Sep 17 00:00:00 2001 From: horea Date: Mon, 24 Feb 2025 12:39:27 +0200 Subject: [PATCH 4/6] issue-44: implement changes Signed-off-by: horea --- .github/workflows/static-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 51ce4be..dc4b6fa 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -46,4 +46,4 @@ jobs: run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi - name: Run static analysis with PHPStan - run: vendor/bin/phpstan analyse \ No newline at end of file + run: vendor/bin/phpstan analyse From 89345bc351f02f194cbf0c113b65fadac9d51ad0 Mon Sep 17 00:00:00 2001 From: horea Date: Mon, 24 Feb 2025 12:56:05 +0200 Subject: [PATCH 5/6] issue-44: implement changes Signed-off-by: horea --- README.md | 1 - docs/book/v3/overview.md | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b409ac2..c081b86 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,6 @@ Dotkernel component to provide geographical details about an IP address -> [!IMPORTANT] > dot-geoip is a wrapper on top of [maxmind/GeoIP2-php](https://github.com/maxmind/GeoIP2-php) ## Documentation diff --git a/docs/book/v3/overview.md b/docs/book/v3/overview.md index 238721b..8142854 100644 --- a/docs/book/v3/overview.md +++ b/docs/book/v3/overview.md @@ -1,5 +1,6 @@ # Overview +Dotkernel component to provide geographical details about an IP address. > dot-geoip is a wrapper on top of [maxmind/GeoIP2-php](https://github.com/maxmind/GeoIP2-php) ## Badges From 0956bc2652a49c6bc2ce1f58e491e56c15a9a8b7 Mon Sep 17 00:00:00 2001 From: horea Date: Mon, 24 Feb 2025 12:58:23 +0200 Subject: [PATCH 6/6] issue-44: implement changes Signed-off-by: horea --- docs/book/v3/overview.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/book/v3/overview.md b/docs/book/v3/overview.md index 8142854..2af92ec 100644 --- a/docs/book/v3/overview.md +++ b/docs/book/v3/overview.md @@ -1,6 +1,7 @@ # Overview Dotkernel component to provide geographical details about an IP address. + > dot-geoip is a wrapper on top of [maxmind/GeoIP2-php](https://github.com/maxmind/GeoIP2-php) ## Badges