From bead7ba3418af24db91131b31532f0b786be402a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Beli=C3=ABn?= Date: Fri, 21 Jul 2023 11:32:47 +0200 Subject: [PATCH] Add PHP Coding Standards Fixer in CI (#1196) * Update composer.json * Update .gitignore * Update php.yml * Apply PHPCSFixer fixes * Switch to php-cs-fixer/shim * Create .php-cs-fixer.dist.php --- MaxMindBinary.php | 16 ++-------------- Tests/MaxMindBinaryTest.php | 2 +- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/MaxMindBinary.php b/MaxMindBinary.php index 5cc9d41..4a1df26 100644 --- a/MaxMindBinary.php +++ b/MaxMindBinary.php @@ -18,10 +18,10 @@ use Geocoder\Exception\UnsupportedOperation; use Geocoder\Model\Address; use Geocoder\Model\AddressCollection; -use Geocoder\Query\GeocodeQuery; -use Geocoder\Query\ReverseQuery; use Geocoder\Provider\AbstractProvider; use Geocoder\Provider\Provider; +use Geocoder\Query\GeocodeQuery; +use Geocoder\Query\ReverseQuery; final class MaxMindBinary extends AbstractProvider implements Provider { @@ -36,9 +36,6 @@ final class MaxMindBinary extends AbstractProvider implements Provider private $openFlag; /** - * @param string $datFile - * @param int|null $openFlag - * * @throws FunctionNotFound if maxmind's lib not installed * @throws InvalidArgument if dat file is not correct (optional) */ @@ -64,9 +61,6 @@ public function __construct(string $datFile, int $openFlag = null) $this->openFlag = null === $openFlag ? GEOIP_STANDARD : $openFlag; } - /** - * {@inheritdoc} - */ public function geocodeQuery(GeocodeQuery $query): Collection { $address = $query->getText(); @@ -108,17 +102,11 @@ public function geocodeQuery(GeocodeQuery $query): Collection ]); } - /** - * {@inheritdoc} - */ public function reverseQuery(ReverseQuery $query): Collection { throw new UnsupportedOperation('The MaxMindBinary is not able to do reverse geocoding.'); } - /** - * {@inheritdoc} - */ public function getName(): string { return 'maxmind_binary'; diff --git a/Tests/MaxMindBinaryTest.php b/Tests/MaxMindBinaryTest.php index 57c360b..e5d0c54 100644 --- a/Tests/MaxMindBinaryTest.php +++ b/Tests/MaxMindBinaryTest.php @@ -15,9 +15,9 @@ use Geocoder\Collection; use Geocoder\IntegrationTest\BaseTestCase; use Geocoder\Location; +use Geocoder\Provider\MaxMindBinary\MaxMindBinary; use Geocoder\Query\GeocodeQuery; use Geocoder\Query\ReverseQuery; -use Geocoder\Provider\MaxMindBinary\MaxMindBinary; class MaxMindBinaryTest extends BaseTestCase {