Skip to content

Commit 6ca7027

Browse files
committed
Fix PHPStan error
1 parent 6fc8c01 commit 6ca7027

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/WebPush.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ public function __construct(array $auth = [], array $defaultOptions = [], ?int $
7272
'mbstring' => '[WebPush] mbstring extension is not loaded but is required for sending push notifications with payload or for VAPID authentication. You can fix this in your php.ini.',
7373
'openssl' => '[WebPush] openssl extension is not loaded but is required for sending push notifications with payload or for VAPID authentication. You can fix this in your php.ini.',
7474
];
75-
if (version_compare(phpversion(), '7.3.0', '<')) {
75+
$phpVersion = phpversion();
76+
if ($phpVersion && version_compare($phpVersion, '7.3.0', '<')) {
7677
$extensions['gmp'] = '[WebPush] gmp extension is not loaded but is required for sending push notifications with payload or for VAPID authentication. You can fix this in your php.ini.';
7778
}
7879
foreach ($extensions as $extension => $message) {

0 commit comments

Comments
 (0)