chargebee / chargebee-php

PHP library for the Chargebee API.

Home Page:https://apidocs.chargebee.com/docs/api?lang=php

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deprecation warnings with PHP 8.1

ekvedaras opened this issue · comments

Deprecated: Return type of ChargeBee_ListResult::rewind() should either be compatible with Iterator::rewind(): void,
or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Deprecated: Return type of ChargeBee_ListResult::offsetExists($k) should either be compatible with
ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily
suppress the notice
Deprecated: Return type of ChargeBee_ListResult::offsetGet($k) should either be compatible with
ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily
suppress the notice
Deprecated: Return type of ChargeBee_ListResult::offsetSet($k, $v) should either be compatible with
ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to
temporarily suppress the notice
Deprecated: Return type of ChargeBee_ListResult::offsetUnset($k) should either be compatible with
ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily
suppress the notice
Deprecated: Return type of ChargeBee_ListResult::current() should either be compatible with Iterator::current(): mixed, or
the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Deprecated: Return type of ChargeBee_ListResult::next() should either be compatible with Iterator::next(): void, or the 
[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Deprecated: Return type of ChargeBee_ListResult::key() should either be compatible with Iterator::key(): mixed, or the 
[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Deprecated: Return type of ChargeBee_ListResult::valid() should either be compatible with Iterator::valid(): bool, or the 
[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Deprecated: Return type of ChargeBee_ListResult::rewind() should either be compatible with Iterator::rewind(): void, or the 
[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

PHP version: 8.1
Package version: 2.8.3

If I were to submit a PR to fix this, to which branch should it be targeted? I don't see v2 branch here 🤔

Any update on this please? :)
Could maintainers advise where to target the pull request?

One more deprecated warning:

PHP Deprecated:  Return type of ChargeBee\ChargeBee\ListResult::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /paxflow/vendor/chargebee/chargebee-php/lib/ChargeBee/ListResult.php on line 39

My company is currently attempting to use ChargeBee. Perhaps we can't, if issues like this do not get fixed in a timely manner.

@ekvedaras & @scr4bble - As per README.md Chargebee supports two API versions - V1 and V2, of which V2 is the latest release. master branch is for API version V2 and chargebee-v1 branch is for V1. If you are using 2.x version of this library then we request you to upgrade to 3.x version. Please see this Legacy Support section.

So you can target the master branch for PR. Just curious if you will use #[\ReturnTypeWillChange] in the PR? We will be happy to see your PR if this is not the case :)

@JeroenDeDauw - we are working on it and will release it asap.

This is fixed in the v3.5.1. If you are using older version then we request you to upgrade to the latest version.

We will be publishing migration document for v3 soon so that it will help you to migrate to 3.x from 2.x versions.

Closing this issue. Feel free to reopen it if you think it is not fixed.