vlucas / bulletphp

A resource-oriented micro PHP framework
http://bulletphp.com
BSD 3-Clause "New" or "Revised" License
416 stars 50 forks source link

Update App.php #53

Closed entraigas closed 6 years ago

entraigas commented 9 years ago

Good morning,

I wonder if you can take a look at the changes. All changes are limited to App.php file and I pass all phpunit test-cases. This is a description of the changes: Get rid of the _handleResponse() method and rewrite response() method. Additionally, create a responseFactory() method which is used only by response(). Finally, there are some changes in the run() method too.

When I was trying to understand the logic, I get confused, there were several places that create/setup a response. With these changes all response setup is contained inside the responseFactory() method. response() method is keep for compatibility reasons but it's only a a wrapper for responseFactory(). Finally the core functionality of _handleResponse() is moved to the end of run() method.

Hope you approve the changes. Cheers!

netom commented 6 years ago

Thank you @entraigas, PR merged.