-Spent some time cleaning up the check and verify challenge examples and refactored the code a bit. (ocd?)
-Added some rough error handling to src/Requests/VerifyChallengeRequest.php to create a dummy verifyChallengeResponse object and set its sucess value to false when an invalid challenge token is submitted. Previously attempt to unmarshall the null response to getReturnsArray() would result in an uncaught exception and prevented a valid "false" json response from being generated.
-Renamed sendChallengeResponse to verifyChallenge in src/Api/PokemonGoApi.php to better reflect its purpose and follow existing api convention.
-Renamed verifyChallenge function to processRequest in VerifyChallengeExample.php to better reflect its purpose.
-Fixed a small bug in the inline bookmarklet script example: missing div ending.
@DrDelay @NicklasWallgren Can one of you take a look over this and let me know if you can merge? The error checking addition is pretty useful if you want to try and process more than one request in a loop.
Changelog:
-Spent some time cleaning up the check and verify challenge examples and refactored the code a bit. (ocd?)
-Added some rough error handling to src/Requests/VerifyChallengeRequest.php to create a dummy verifyChallengeResponse object and set its sucess value to false when an invalid challenge token is submitted. Previously attempt to unmarshall the null response to getReturnsArray() would result in an uncaught exception and prevented a valid "false" json response from being generated.
-Renamed sendChallengeResponse to verifyChallenge in src/Api/PokemonGoApi.php to better reflect its purpose and follow existing api convention.
-Renamed verifyChallenge function to processRequest in VerifyChallengeExample.php to better reflect its purpose.
-Fixed a small bug in the inline bookmarklet script example: missing div ending.
-A dollop of magic fairy dust