webpush icon indicating copy to clipboard operation
webpush copied to clipboard

strlen(): Passing null to parameter #1 ($string) of type string is deprecated

Open dloused opened this issue 2 years ago • 1 comments

Vapid keys generation fails (Laravel 8 / PHP 8.1)

Noone faces this? Did not find a relevant issue...

strlen(): Passing null to parameter #1 ($string) of type string is deprecated

at vendor/laravel-notification-channels/webpush/src/VapidKeysGenerateCommand.php:59
     55▕     protected function setKeysInEnvironmentFile($keys)
     56▕     {
     57▕         $currentKeys = $this->laravel['config']['webpush.vapid'];
     58▕ 
  ➜  59▕         if (strlen($currentKeys['public_key']) !== 0 && (! $this->confirmToProceed())) {
     60▕             return false;
     61▕         }
     62▕ 
     63▕         $this->writeNewEnvironmentFileWith($keys);

dloused avatar Oct 28 '23 11:10 dloused

modifying above to this, does it:

if (strlen($currentKeys['public_key'] ?? '') !== 0 && (! $this->confirmToProceed())) {
     return false;
 }

dloused avatar Oct 28 '23 11:10 dloused