facebook / facebook-php-business-sdk

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

Add attribute to prevent deprecated notices in PHP 8.1 #559

Closed jacoballred closed 2 years ago

jacoballred commented 2 years ago

Cursor is implementing \Iterator, \Countable, and \arrayaccess. These all define methods that have the #[TentativeType] attribute. Ideally, these methods would be implemented in Cursor with the return types specified. However, this isn't possible while maintaining PHP 5.6 compatibility.

To maintain PHP 5.6 compatibility while getting rid of the deprecated notices when using PHP 8.1, the #[\ReturnTypeWillChange] attribute has been added to all the methods implemented in Cursor that have the #[TentativeType] attribute.

This is a fully backwards compatible change.

natewiebe13 commented 2 years ago

There's other classes that have the same issue. Some of which are apparently coming from a different repo. I've opened a PR for those here: https://github.com/facebook/facebook-business-sdk-codegen/pull/40

For files in this repo, I'd recommend we reopen https://github.com/facebook/facebook-php-business-sdk/pull/554 after the codgen files have been imported into this repo.

jacoballred commented 2 years ago

@natewiebe13 That sounds great! Is there anything I can do to help with this process?

natewiebe13 commented 2 years ago

@jacoballred not that I'm aware of. Whenever the FB team gets around to it.