Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Depreciation warning "CoreInterfaces\Core\Response\ResponseInterface::getBody() might add mixed" #50

Closed
stanislav-oop opened this issue Feb 20, 2024 · 4 comments
Assignees

Comments

@stanislav-oop
Copy link

stanislav-oop commented Feb 20, 2024

Please add : mixed to apimatic\unirest-php\src\Response.php

" public function getBody(): mixed"

Otherwise I am getting depreciation warnings:

1x: Method "CoreInterfaces\Core\Response\ResponseInterface::getBody()" might add "mixed" as a native return type declaration in the future. Do the same in implementation "Unirest\Response" now to avoid errors or add an explicit @return annotation to suppress this message.

Thank you

@asadali214 asadali214 self-assigned this Feb 21, 2024
@asadali214
Copy link
Collaborator

Thank you @stanislav-oop for submitting this issue, the mixed type was only introduced in PHP 8.0 and above.

We also intend to support PHP 7.2 as the minimum version for unirest-php which is why we can not add the mixed return type here.

Please ignore this Depreciation warning "CoreInterfaces\Core\Response\ResponseInterface::getBody() might add mixed"

@stanislav-oop
Copy link
Author

Thank you for your reply! There can be another solution to that: remove on a parent or add in Response class this:
/**
* @return mixed
*/

@asadali214
Copy link
Collaborator

@stanislav-oop That's a good suggestion. We have noted it down, will be making this change a part of our upcoming release!

@asadali214
Copy link
Collaborator

Hey @stanislav-oop we have released this fix via the release of core-interfaces-php: https://github.com/apimatic/core-interfaces-php/releases/tag/0.1.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants