We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Return types in API documentation would be valuable

Unless I'm missing it, I'm not really seeing return types as part of the API documentation.

For example, if you go here:

https://docs.phalcon.io/en/latest/api/Phalcon_Application.html

You will see that there is a method called handle(). However, it does not showcase the return type, which does exist. This causes confusion when developers are trying to understand how code like this might work:

    $application = new Application($di);
    $response = $application->handle();
    $response->send();
edited Jan '17

But it doesn't have to return Response object i think. It can be anything which developer returns - string/int/array whatever.

edited Jan '17

Exactly. Handle will check internally if your handler have returned string, and will flush it to the client automatically.

Refer to this topic for more detail: https://forum.phalcon.io/discussion/15019/calling-return-in-controller-method-send-response-immediately

Well maybe in Application it will always return response according to code in this thread?