diff --git a/composer.json b/composer.json index e7c0147..2f732b3 100644 --- a/composer.json +++ b/composer.json @@ -23,8 +23,7 @@ "require": { "php": "^7.3|^8.0", "illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0", - "joelbutcher/facebook-graph-sdk": "^6.0.0", - "symfony/http-client": "^5.3|^6.0|^7.0" + "joelbutcher/facebook-graph-sdk": "^6.1.2" }, "require-dev": { "mockery/mockery": "^1.4.2", diff --git a/src/FacebookServiceProvider.php b/src/FacebookServiceProvider.php index 9bf55b0..c5f638e 100644 --- a/src/FacebookServiceProvider.php +++ b/src/FacebookServiceProvider.php @@ -5,9 +5,10 @@ use Facebook\PersistentData\PersistentDataInterface; use Facebook\Url\UrlDetectionHandler; use Facebook\Url\UrlDetectionInterface; -use Http\Client\HttpClient; +use GuzzleHttp\Client; use Illuminate\Contracts\Foundation\Application; use Illuminate\Support\ServiceProvider; +use Psr\Http\Client\ClientInterface; class FacebookServiceProvider extends ServiceProvider { @@ -76,8 +77,8 @@ protected function getConfigPath(): string */ protected function registerDefaultHttpClient(): void { - $this->app->singleton(HttpClient::class, function () { - return null; + $this->app->singleton(ClientInterface::class, function () { + return new Client(); }); } @@ -125,7 +126,7 @@ protected function registerFacebook(): void 'default_graph_version' => $app['config']->get('facebook.graph_version'), 'enable_beta_mode' => $app['config']->get('facebook.beta_mode'), 'persistent_data_handler' => $app[PersistentDataInterface::class], - 'http_client' => $app[HttpClient::class], + 'http_client' => $app[ClientInterface::class], 'url_detection_handler' => $app[UrlDetectionInterface::class], ]); }); diff --git a/tests/TestCase.php b/tests/TestCase.php index bae8484..6ceb730 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -4,6 +4,7 @@ use JoelButcher\Facebook\Facebook; use JoelButcher\Facebook\FacebookServiceProvider; +use Psr\Http\Client\ClientInterface; abstract class TestCase extends \Orchestra\Testbench\TestCase { @@ -23,6 +24,7 @@ protected function setUp(): void 'app_secret' => $this->app['config']->get('facebook.app_secret'), 'redirect_uri' => $this->app['config']->get('facebook.redirect_uri'), 'default_graph_version' => $this->app['config']->get('facebook.graph_version'), + 'http_client' => $this->app[ClientInterface::class] ]; }