pushok icon indicating copy to clipboard operation
pushok copied to clipboard

php 8.4 compatibility

Open pavimus opened this issue 10 months ago • 1 comments

I'm getting following error with php 8.4:

yii\base\ErrorException: Pushok\Response::__construct(): Implicitly marking parameter $deviceToken as nullable is deprecated, the explicit nullable type must be used instead in /var/www/gallerist_pro/vendor/edamov/pushok/src/Response.php:151 Stack trace: #0 /var/www/gallerist_pro/vendor/composer/ClassLoader.php(576): yii\base\ErrorHandler->handleError() #1 /var/www/gallerist_pro/vendor/composer/ClassLoader.php(576): include() #2 /var/www/gallerist_pro/vendor/composer/ClassLoader.php(427): {closure:Composer\Autoload\ClassLoader::initializeIncludeClosure():575}() #3 /var/www/gallerist_pro/vendor/edamov/pushok/src/Client.php(164): Composer\Autoload\ClassLoader->loadClass() #4 /var/www/gallerist_pro/components/APNSBase.php(57): Pushok\Client->push() #5 /var/www/gallerist_pro/components/APNS.php(245): app\components\APNSBase->flush() #6 /var/www/gallerist_pro/components/AppNotification.php(70): app\components\APNS->sendUpdateBadgeNotification()

Line 151 in Response.php must be changed from

public function __construct(int $statusCode, string $headers, string $body, string $deviceToken = null)

to

public function __construct(int $statusCode, string $headers, string $body, ?string $deviceToken = null)

pavimus avatar Feb 20 '25 14:02 pavimus

This is fixed in the master branch, so it can probably be closed?

ptmkenny avatar Oct 30 '25 13:10 ptmkenny