facebook / facebook-php-business-sdk

PHP SDK for Meta Marketing API
https://developers.facebook.com/docs/business-sdk
Other
837 stars 519 forks source link

Syntax error in FB version v16.0.0 #587

Closed nitin-aika09 closed 1 year ago

nitin-aika09 commented 1 year ago

Facebook PHP Business SDK Issue

This issue seems to be with SDK specific. Issue seems to be at AbstractObject|bool at this line: https://github.com/facebook/facebook-php-business-sdk/blob/main/src/FacebookAds/Cursor.php#L438

    return isset($this->objects[$this->position])
      ? $this->objects[$this->position]
      : false;
  }

Error Response

{
    "message": "Parse error: syntax error, unexpected '|', expecting ';' or '{'",
    "code": 0,
    "file": "/application/vendor/facebook/php-ads-sdk/src/FacebookAds/Cursor.php",
    "line": 441
}

Could you please check and make a fix for that.

hakimio commented 1 year ago

You have to upgrade your PHP to v8. unexpected '|' is on the following line:

 public function current() : AbstractObject|bool {