From 54227f9388074edfbea1df272d4811c1ee78ef42 Mon Sep 17 00:00:00 2001 From: Ruslan Date: Wed, 18 Jan 2023 10:59:10 +0300 Subject: [PATCH] Added type hint When using the barryvdh/laravel-ide-helper package, autocomplete will now work. --- src/LaravelHttpClientLoggerServiceProvider.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/LaravelHttpClientLoggerServiceProvider.php b/src/LaravelHttpClientLoggerServiceProvider.php index e44507f..de62aaf 100644 --- a/src/LaravelHttpClientLoggerServiceProvider.php +++ b/src/LaravelHttpClientLoggerServiceProvider.php @@ -35,7 +35,7 @@ public function packageBooted() $config = [], ?HttpLoggerInterface $logger = null, ?HttpLoggingFilterInterface $filter = null - ) { + ): PendingRequest { /** @var \Illuminate\Http\Client\PendingRequest $this */ return $this->withMiddleware((new LoggingMiddleware( $logger ?? app(HttpLoggerInterface::class), @@ -49,7 +49,7 @@ public function packageBooted() $config = [], ?HttpLoggerInterface $logger = null, ?HttpLoggingFilterInterface $filter = null - ) { + ): PendingRequest { if (value($condition)) { /** @var \Illuminate\Http\Client\PendingRequest $this */ return $this->log($context, $config, $logger, $filter); @@ -59,7 +59,7 @@ public function packageBooted() } }); - PendingRequest::macro('logWith', function (HttpLoggerInterface $logger = null) { + PendingRequest::macro('logWith', function (HttpLoggerInterface $logger = null): PendingRequest { /** @var \Illuminate\Http\Client\PendingRequest $this */ return $this->withMiddleware((new LoggingMiddleware($logger, new LogAllFilter()))->__invoke()); });