Shopify PHP API - FileSessionStorage issue

Shopify PHP API - FileSessionStorage issue

rockstar08
Shopify Partner
5 0 0
require_once 'vendor/autoload.php';
include 'config.php';

use Shopify\Auth\OAuthCookie;
use Shopify\Context;
use Shopify\Client;
use Shopify\Auth;
use Shopify\Auth\FileSessionStorage;

Context::initialize(
    apiKey: $apiKey,
    apiSecretKey: $apiSecret,
    scopes: $scope,
    hostName: $shopName ,
    sessionStorage:  new FileSessionStorage(__DIR__.'/tmp/php_sessions'),
    apiVersion: '2023-04',
    isEmbeddedApp: true,
    isPrivateApp: false,
);

getting this error:

Parse error: syntax error, unexpected identifier "string", expecting variable in ....shopify-apps\src\Auth\FileSessionStorage.php on line 12

this s the function in FileSessionStorage.php :
   public function __construct(string $path = '/tmp/shopify_api_sessions')
    {
        if (!is_dir($path)) {
            mkdir($path);
        }

        $this->path = $path;
    }

Can anyone help with fixing this.. tried this too
SessionStorage:  new FileSessionStorage('/tmp/php_sessions'),
Replies 0 (0)