I have an error message on php 7.3
onlyjf77 opened this issue · 1 comments
declare(strict_types=1);
use OneSignal\Config;
use OneSignal\OneSignal;
use Symfony\Component\HttpClient\Psr18Client;
use Nyholm\Psr7\Factory\Psr17Factory;
require DIR . '/vendor/autoload.php';
$config = new Config('application_id', 'application_auth_key', 'auth_key');
$httpClient = new Psr18Client();
$requestFactory = $streamFactory = new Psr17Factory();
$oneSignal = new OneSignal($config, $httpClient, $requestFactory, $streamFactory);
Got error 'PHP message: PHP Fatal error: Uncaught TypeError: Argument 2 passed to OneSignal\OneSignal::__construct() must be an instance of Http\Client\Common\HttpMethodsClient or null, instance of Symfony\Component\HttpClient\Psr18Client given, called in /home/public_html/api/push.php on line 16 and defined in /home/public_html/vendor/norkunas/onesignal-php-api/src/OneSignal.php:42\nStack trace:\n#0 /home/public_html/api/push.php(16): OneSignal\OneSignal->__construct(Object(OneSignal\Config), Object(Symfony\Component\HttpClient\Psr18Client), Object(Nyholm\Psr7\Factory\Psr17Factory), Object(Nyholm\Psr7\Factory\Psr17Factory))\n#1 {main}\n thrown in /home/public_html/vendor/norkunas/onesignal-php-api/src/OneSignal.php on line 42'