From f56082865e9fd76bb833a49f2e40f15122ee2151 Mon Sep 17 00:00:00 2001
From: Javier Eguiluz <javier.eguiluz@gmail.com>
Date: Thu, 2 Nov 2023 16:38:34 +0100
Subject: [PATCH 1/3] Allow using Symfony 7 and fix some deprecations

---
 composer.json                             | 16 ++++++++--------
 src/Command/GeocodeCommand.php            |  5 +----
 src/DependencyInjection/Configuration.php |  4 +---
 3 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/composer.json b/composer.json
index c775a39..2cba9b9 100644
--- a/composer.json
+++ b/composer.json
@@ -15,9 +15,9 @@
     "geocoder-php/plugin": "^1.5",
     "php-http/curl-client": "^2.3",
     "php-http/discovery": "^1.14",
-    "symfony/console": "^4.4 || ^5.0 || ^6.0",
-    "symfony/framework-bundle": "^4.4 || ^5.0 || ^6.0",
-    "symfony/options-resolver": "^4.4 || ^5.0 || ^6.0",
+    "symfony/console": "^4.4 || ^5.0 || ^6.0 || ^7.0",
+    "symfony/framework-bundle": "^4.4 || ^5.0 || ^6.0 || ^7.0",
+    "symfony/options-resolver": "^4.4 || ^5.0 || ^6.0 || ^7.0",
     "willdurand/geocoder": "^4.6"
   },
   "require-dev": {
@@ -63,11 +63,11 @@
     "php-http/message": "^1.13",
     "phpstan/phpstan": "^1.9.2",
     "psr/http-client": "^1.0",
-    "symfony/cache": "^4.4 || ^5.0 || ^6.0",
-    "symfony/config": "^4.4 || ^5.0 || ^6.0",
-    "symfony/phpunit-bridge": "^5.2 || ^6.0",
-    "symfony/validator": "^4.4 || ^5.0 || ^6.0",
-    "symfony/yaml": "^4.4 || ^5.0 || ^6.0"
+    "symfony/cache": "^4.4 || ^5.0 || ^6.0 || ^7.0",
+    "symfony/config": "^4.4 || ^5.0 || ^6.0 || ^7.0",
+    "symfony/phpunit-bridge": "^5.2 || ^6.0 || ^7.0",
+    "symfony/validator": "^4.4 || ^5.0 || ^6.0 || ^7.0",
+    "symfony/yaml": "^4.4 || ^5.0 || ^6.0 || ^7.0"
   },
   "conflict": {
     "geocoder-php/nominatim-provider": "<5.0"
diff --git a/src/Command/GeocodeCommand.php b/src/Command/GeocodeCommand.php
index 73f4edd..12b0c50 100644
--- a/src/Command/GeocodeCommand.php
+++ b/src/Command/GeocodeCommand.php
@@ -55,10 +55,7 @@ protected function configure()
             );
     }
 
-    /**
-     * @return int
-     */
-    protected function execute(InputInterface $input, OutputInterface $output)
+    protected function execute(InputInterface $input, OutputInterface $output): int
     {
         if ($input->getOption('provider')) {
             $this->geocoder->using($input->getOption('provider'));
diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php
index 817ec08..ca4d3da 100644
--- a/src/DependencyInjection/Configuration.php
+++ b/src/DependencyInjection/Configuration.php
@@ -30,10 +30,8 @@ public function __construct(bool $debug)
 
     /**
      * Generates the configuration tree builder.
-     *
-     * @return TreeBuilder The tree builder
      */
-    public function getConfigTreeBuilder()
+    public function getConfigTreeBuilder(): TreeBuilder
     {
         $treeBuilder = new TreeBuilder('bazinga_geocoder');
         $rootNode = $treeBuilder->getRootNode();

From 18d6b759bb9fc044f6e67260e6a2f6d3156c672c Mon Sep 17 00:00:00 2001
From: Javier Eguiluz <javier.eguiluz@gmail.com>
Date: Fri, 3 Nov 2023 10:45:24 +0100
Subject: [PATCH 2/3] Regenerate the PHPStan baseline file

---
 phpstan-baseline.neon | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon
index e1c47c6..ac33fcc 100644
--- a/phpstan-baseline.neon
+++ b/phpstan-baseline.neon
@@ -140,6 +140,11 @@ parameters:
 			count: 1
 			path: src/Doctrine/ORM/GeocoderListener.php
 
+		-
+			message: "#^Method Bazinga\\\\GeocoderBundle\\\\Plugin\\\\FakeIpPlugin\\:\\:handleQuery\\(\\) return type with generic interface Http\\\\Promise\\\\Promise does not specify its types\\: T$#"
+			count: 1
+			path: src/Plugin/FakeIpPlugin.php
+
 		-
 			message: "#^Parameter \\#1 \\$text of method Geocoder\\\\Query\\\\GeocodeQuery\\:\\:withText\\(\\) expects string, string\\|null given\\.$#"
 			count: 1
@@ -150,6 +155,11 @@ parameters:
 			count: 1
 			path: src/Plugin/FakeIpPlugin.php
 
+		-
+			message: "#^Method Bazinga\\\\GeocoderBundle\\\\Plugin\\\\ProfilingPlugin\\:\\:handleQuery\\(\\) return type with generic interface Http\\\\Promise\\\\Promise does not specify its types\\: T$#"
+			count: 1
+			path: src/Plugin/ProfilingPlugin.php
+
 		-
 			message: "#^Parameter \\#1 \\$accountId of class GeoIp2\\\\WebService\\\\Client constructor expects int, int\\|null given\\.$#"
 			count: 1

From ba0babf71d7863494338231908d762a1a727fa66 Mon Sep 17 00:00:00 2001
From: Javier Eguiluz <javier.eguiluz@gmail.com>
Date: Fri, 3 Nov 2023 11:20:46 +0100
Subject: [PATCH 3/3] Add Symfony 6.4 and 7.0 to the test matrix

---
 .github/workflows/ci.yml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 23b255a..f6e5d39 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -82,6 +82,10 @@ jobs:
                       sf_version: '6.0.*'
                     - php: '8.2'
                       sf_version: '6.2.*'
+                    - php: '8.2'
+                      sf_version: '6.4.*'
+                    - php: '8.2'
+                      sf_version: '7.0.*'
         steps:
             - name: "Setup PHP"
               uses: shivammathur/setup-php@v2