1

Initially used PHP 7.1.1 and Phalcon 3.4 to support API end. Once upgraded the PHP 7.2.24 and Phalcon 4.0.0 we faced the Phalcon response issue when calling the API. We mainly used Phalcon-rest to support API. Below attached the file structure, source code and issue what I faced. Please share your inputs to resolve the issue.

File structure

Fatal error: Declaration of PhalconRest\Http\Response::setJsonContent($content, $jsonOptions = 0, $depth = 512) must be compatible with Phalcon\Http\Response::setJsonContent($content, int $jsonOptions = NULL, int $depth = NULL): Phalcon\Http\ResponseInterface in C:\dev\servicechum_api\vendor\redound\phalcon-rest\src\PhalconRest\Http\Response.php on line 68

1

1 Answer 1

0

The upstream package you use (redound/phalcon-rest) is incompatible with modern PHP versions. The error message is self explanatory: the implementation of the Response::setJsonContent method must match the parent, while it does not.

Judging by the code, lack of tests, invalid library constraints (vide "php": ">=5.4") in the composer.json either downgrade your PHP or stop using this software, but prefer latter.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.