Refactoring the detector code for CakeRequest::is() and adding default detectors for JSON and XML.
Adding a test for the refactored CakeRequest code.
phpcs fixes in Cake/Network/CakeRequest.php
phpcs fix in Cake/Test/Case/Network/CakeRequestTest.php
Restructuring the CakeRequest::is() code and related code a little.
Changes to Cake/Network/CakeRequest.php as discussed on Github for the detector code changes. Fixed the description of a few doc blocks, removed the use of getallheaders(), removed the failsafe (based on extension) for the xml and json detectors.
Adding a test for the new json and xml detectors that were added to the CakeRequest class.
Adding a few more ways to detect HTTP headers, extensions and the accept header.
Changing the direct access of super globals in Cake/Network/CakeRequest.php to use env() and fixed a typo.
Merge pull request #5222 from burzum/feature/json-request

Feature/json request