salesforce-marketingcloud / FuelSDK-PHP

FuelSDK-PHP
MIT License
134 stars 142 forks source link

[BUG] Trying to access array offset on value of type null in ET_Client.php on line 645 #176

Open Armandulis opened 1 year ago

Armandulis commented 1 year ago

Describe the bug PHP shows warning PHP Warning: Trying to access array offset on value of type null in ../vendor/salesforce-mc/fuel-sdk-php/src/ET_Client.php on line 645 when assigning ET_Client to ET_Subscriber->authStub. This is flooding our logs and making a lot of unnecessary notification about the warnings. Doe not actually stop the functionality, it's just the warning.

To Reproduce

  1. Create new ET_Subscriber
  2. Authenticate create new ET_Client (as well as all of the authentication for ET_Client)
  3. Assign ET_Client to ET_Subscribers::authStub
  4. Warning is displayed

Expected behavior I should not see the warning.

Screenshots image

Code snippet

    $this->Subscriber = $ETSubscriber ?? FrontController::container()->get( ET_Subscriber::class );
    $this->Subscriber->authStub = $Client ?? FrontController::container()->get( ET_Client::class ); // First you need to authenticate the ET Client (just passing credentials to constructor)

Environment

The bug has the severity

Additional context Add any other context about the problem here.