You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the class implements \Countable interface and method "count" has no return type we have a deprecation notice even with [#\ReturnTypeWillChange] attribute
Method "Countable::count()" might add "int" as a native return type declaration in the future. Do the same in implementation "Aws\HandlerList" now to avoid errors or add an explicit @return annotation to suppress this message.
How to reproduce
Use symfony 5.4.2
Install aws/aws-sdk-php 3.208.9
Run any unittest that will include aws files
You will get
Method "Countable::count()" might add "int" as a native return type declaration in the future. Do the same in implementation "Aws\HandlerList" now to avoid errors or add an explicit @return annotation to suppress this message.
jokaorgua
changed the title
Deprecation message is produce even with [#\ReturnTypeWillChange]
Deprecation message is produced even with [#\ReturnTypeWillChange]
Jan 6, 2022
Adding the attribute is not enough, you should also tell what is the tentative return type going to be. On that method, that means adding @return int as annotation.
Same logic for all methods that have the attribute of course.
Symfony version(s) affected
5.4.2
Description
If the class implements \Countable interface and method "count" has no return type we have a deprecation notice even with [#\ReturnTypeWillChange] attribute
Implementation example which causes the deprecation message is here https://github.com/aws/aws-sdk-php/blob/master/src/HandlerList.php#L308 (official AWS SDK for PHP)
the deprecation message
How to reproduce
You will get
The code can be found here https://github.com/aws/aws-sdk-php/blob/master/src/HandlerList.php#L308
Possible Solution
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: