From 890083dd9af8c00b99840ee12a6e1d7f70319192 Mon Sep 17 00:00:00 2001 From: Kyryl Bogach Date: Wed, 1 Dec 2021 14:44:16 +0100 Subject: [PATCH 1/2] Fix str_replace error when third parameter ($subject) is null in PHP 8.1.0 str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/html/vendor/laravel/passport/src/PassportServiceProvider.php line 268 --- src/PassportServiceProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PassportServiceProvider.php b/src/PassportServiceProvider.php index daeb04422..a8a99005a 100644 --- a/src/PassportServiceProvider.php +++ b/src/PassportServiceProvider.php @@ -265,7 +265,7 @@ protected function registerResourceServer() */ protected function makeCryptKey($type) { - $key = str_replace('\\n', "\n", $this->app->make(Config::class)->get('passport.'.$type.'_key')); + $key = str_replace('\\n', "\n", $this->app->make(Config::class)->get('passport.'.$type.'_key') ?? ""); if (! $key) { $key = 'file://'.Passport::keyPath('oauth-'.$type.'.key'); From 34296baa24e8ff97b31200a5c578d56beabfde24 Mon Sep 17 00:00:00 2001 From: Kyryl Bogach Date: Wed, 1 Dec 2021 14:46:25 +0100 Subject: [PATCH 2/2] Use single quotes to fix style error --- src/PassportServiceProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PassportServiceProvider.php b/src/PassportServiceProvider.php index a8a99005a..0418d43ca 100644 --- a/src/PassportServiceProvider.php +++ b/src/PassportServiceProvider.php @@ -265,7 +265,7 @@ protected function registerResourceServer() */ protected function makeCryptKey($type) { - $key = str_replace('\\n', "\n", $this->app->make(Config::class)->get('passport.'.$type.'_key') ?? ""); + $key = str_replace('\\n', "\n", $this->app->make(Config::class)->get('passport.'.$type.'_key') ?? ''); if (! $key) { $key = 'file://'.Passport::keyPath('oauth-'.$type.'.key');