theiconic / php-ga-measurement-protocol

Send data to Google Analytics from the server using PHP. Implements GA measurement protocol.
MIT License
655 stars 136 forks source link

Add ability to get reason phrase #104

Open DarronEngelbrechtEdge opened 2 years ago

DarronEngelbrechtEdge commented 2 years ago

This adds the ability to get the HTTP reason phrase from the original response so that the developer may handle errors with the same status codes on an individual basis.

https://developers.google.com/analytics/devguides/reporting/core/v4/errors

I was not able to execute the tests using PHP 8.1 on my system (Manjaro) getting the following error seemingly related to the older PHPUnit version but I was unable to update and unsuccessful with yoast/phpunit-polyfills installed so just hoping the PR works. Feel free to edit. :-)

PHP Fatal error:  Uncaught Error: Call to undefined function each() in /home/darron/webdev/php-ga-measurement-protocol/vendor/phpunit/phpunit/src/Util/Getopt.php:38