From 2150c8a87ade1987b2372093590bd7f93950d344 Mon Sep 17 00:00:00 2001 From: Alberto Bottarini Date: Thu, 28 May 2020 18:09:24 +0200 Subject: [PATCH 01/13] implements batch requests --- composer.json | 2 +- composer.lock | 825 +++++++++++++----- src/Analytics.php | 94 +- .../EnqueueUrlsOverflowException.php | 18 + src/Network/HttpClient.php | 36 + src/Network/PrepareUrl.php | 4 +- .../GoogleAnalytics/AnalyticsTest.php | 50 ++ .../Network/HttpClientTest.php | 6 +- 8 files changed, 787 insertions(+), 248 deletions(-) create mode 100644 src/Exception/EnqueueUrlsOverflowException.php diff --git a/composer.json b/composer.json index d62506d..632a859 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "guzzlehttp/guzzle": "^6.0" }, "require-dev": { - "phpunit/phpunit": "4.7.*", + "phpunit/phpunit": "4.8.*", "satooshi/php-coveralls": "1.0.1" }, "autoload": { diff --git a/composer.lock b/composer.lock index a38159d..478e6db 100644 --- a/composer.lock +++ b/composer.lock @@ -1,49 +1,53 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "hash": "21cf5251a1eab1c731860d4365b6bb31", - "content-hash": "35166a06fdd1ab04bc07023144b50efd", + "content-hash": "c9694c451f90121c714ecbc6cef1bcb4", "packages": [ { "name": "guzzlehttp/guzzle", - "version": "6.2.1", + "version": "6.5.4", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "3f808fba627f2c5b69e2501217bf31af349c1427" + "reference": "a4a1b6930528a8f7ee03518e6442ec7a44155d9d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/3f808fba627f2c5b69e2501217bf31af349c1427", - "reference": "3f808fba627f2c5b69e2501217bf31af349c1427", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/a4a1b6930528a8f7ee03518e6442ec7a44155d9d", + "reference": "a4a1b6930528a8f7ee03518e6442ec7a44155d9d", "shasum": "" }, "require": { + "ext-json": "*", "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.3.1", - "php": ">=5.5" + "guzzlehttp/psr7": "^1.6.1", + "php": ">=5.5", + "symfony/polyfill-intl-idn": "1.17.0" }, "require-dev": { "ext-curl": "*", - "phpunit/phpunit": "^4.0", - "psr/log": "^1.0" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", + "psr/log": "^1.1" + }, + "suggest": { + "psr/log": "Required for using the Log middleware" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "6.2-dev" + "dev-master": "6.5-dev" } }, "autoload": { - "files": [ - "src/functions_include.php" - ], "psr-4": { "GuzzleHttp\\": "src/" - } + }, + "files": [ + "src/functions_include.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -67,32 +71,32 @@ "rest", "web service" ], - "time": "2016-07-15 17:22:37" + "time": "2020-05-25T19:35:05+00:00" }, { "name": "guzzlehttp/promises", - "version": "1.2.0", + "version": "v1.3.1", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "c10d860e2a9595f8883527fa0021c7da9e65f579" + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/c10d860e2a9595f8883527fa0021c7da9e65f579", - "reference": "c10d860e2a9595f8883527fa0021c7da9e65f579", + "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", "shasum": "" }, "require": { "php": ">=5.5.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "phpunit/phpunit": "^4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "1.4-dev" } }, "autoload": { @@ -118,36 +122,41 @@ "keywords": [ "promise" ], - "time": "2016-05-18 16:56:05" + "time": "2016-12-20T10:07:11+00:00" }, { "name": "guzzlehttp/psr7", - "version": "1.3.1", + "version": "1.6.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "5c6447c9df362e8f8093bda8f5d8873fe5c7f65b" + "reference": "239400de7a173fe9901b9ac7c06497751f00727a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/5c6447c9df362e8f8093bda8f5d8873fe5c7f65b", - "reference": "5c6447c9df362e8f8093bda8f5d8873fe5c7f65b", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/239400de7a173fe9901b9ac7c06497751f00727a", + "reference": "239400de7a173fe9901b9ac7c06497751f00727a", "shasum": "" }, "require": { "php": ">=5.4.0", - "psr/http-message": "~1.0" + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" }, "provide": { "psr/http-message-implementation": "1.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "ext-zlib": "*", + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" + }, + "suggest": { + "zendframework/zend-httphandlerrunner": "Emit PSR-7 responses" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "1.6-dev" } }, "autoload": { @@ -167,29 +176,37 @@ "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" } ], - "description": "PSR-7 message implementation", + "description": "PSR-7 message implementation that also provides common utility methods", "keywords": [ "http", "message", + "psr-7", + "request", + "response", "stream", - "uri" + "uri", + "url" ], - "time": "2016-06-24 23:00:38" + "time": "2019-07-01T23:21:34+00:00" }, { "name": "psr/http-message", - "version": "1.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/php-fig/http-message.git", - "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298" + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", - "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", "shasum": "" }, "require": { @@ -217,6 +234,7 @@ } ], "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", "keywords": [ "http", "http-message", @@ -225,38 +243,256 @@ "request", "response" ], - "time": "2015-05-04 20:22:00" + "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "time": "2019-03-08T08:55:37+00:00" + }, + { + "name": "symfony/polyfill-intl-idn", + "version": "v1.17.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-idn.git", + "reference": "3bff59ea7047e925be6b7f2059d60af31bb46d6a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/3bff59ea7047e925be6b7f2059d60af31bb46d6a", + "reference": "3bff59ea7047e925be6b7f2059d60af31bb46d6a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "symfony/polyfill-mbstring": "^1.3", + "symfony/polyfill-php72": "^1.10" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.17-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Idn\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Laurent Bassin", + "email": "laurent@bassin.info" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "idn", + "intl", + "polyfill", + "portable", + "shim" + ], + "time": "2020-05-12T16:47:27+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.17.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "fa79b11539418b02fc5e1897267673ba2c19419c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fa79b11539418b02fc5e1897267673ba2c19419c", + "reference": "fa79b11539418b02fc5e1897267673ba2c19419c", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.17-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2020-05-12T16:47:27+00:00" + }, + { + "name": "symfony/polyfill-php72", + "version": "v1.17.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php72.git", + "reference": "f048e612a3905f34931127360bdd2def19a5e582" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/f048e612a3905f34931127360bdd2def19a5e582", + "reference": "f048e612a3905f34931127360bdd2def19a5e582", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.17-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php72\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2020-05-12T16:47:27+00:00" } ], "packages-dev": [ { "name": "doctrine/instantiator", - "version": "1.0.5", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + "reference": "ae466f726242e637cebdd526a7d991b9433bacf1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/ae466f726242e637cebdd526a7d991b9433bacf1", + "reference": "ae466f726242e637cebdd526a7d991b9433bacf1", "shasum": "" }, "require": { - "php": ">=5.3,<8.0-DEV" + "php": "^7.1" }, "require-dev": { - "athletic/athletic": "~0.1.8", + "doctrine/coding-standard": "^6.0", "ext-pdo": "*", "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" + "phpbench/phpbench": "^0.13", + "phpstan/phpstan-phpunit": "^0.11", + "phpstan/phpstan-shim": "^0.11", + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -276,12 +512,12 @@ } ], "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", "keywords": [ "constructor", "instantiate" ], - "time": "2015-06-14 21:17:01" + "time": "2019-10-21T16:45:58+00:00" }, { "name": "guzzle/guzzle", @@ -377,39 +613,34 @@ "web service" ], "abandoned": "guzzlehttp/guzzle", - "time": "2015-03-18 18:23:50" + "time": "2015-03-18T18:23:50+00:00" }, { "name": "phpdocumentor/reflection-common", - "version": "1.0", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" + "reference": "6568f4687e5b41b054365f9ae03fcb1ed5f2069b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", - "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/6568f4687e5b41b054365f9ae03fcb1ed5f2069b", + "reference": "6568f4687e5b41b054365f9ae03fcb1ed5f2069b", "shasum": "" }, "require": { - "php": ">=5.5" - }, - "require-dev": { - "phpunit/phpunit": "^4.6" + "php": ">=7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.x-dev" } }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src" - ] + "phpDocumentor\\Reflection\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -431,38 +662,42 @@ "reflection", "static analysis" ], - "time": "2015-12-27 11:43:31" + "time": "2020-04-27T09:25:28+00:00" }, { "name": "phpdocumentor/reflection-docblock", - "version": "3.1.0", + "version": "5.1.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "9270140b940ff02e58ec577c237274e92cd40cdd" + "reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9270140b940ff02e58ec577c237274e92cd40cdd", - "reference": "9270140b940ff02e58ec577c237274e92cd40cdd", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e", + "reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e", "shasum": "" }, "require": { - "php": ">=5.5", - "phpdocumentor/reflection-common": "^1.0@dev", - "phpdocumentor/type-resolver": "^0.2.0", - "webmozart/assert": "^1.0" + "ext-filter": "^7.1", + "php": "^7.2", + "phpdocumentor/reflection-common": "^2.0", + "phpdocumentor/type-resolver": "^1.0", + "webmozart/assert": "^1" }, "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^4.4" + "doctrine/instantiator": "^1", + "mockery/mockery": "^1" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + } + }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] + "phpDocumentor\\Reflection\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -473,44 +708,46 @@ { "name": "Mike van Riel", "email": "me@mikevanriel.com" + }, + { + "name": "Jaap van Otterdijk", + "email": "account@ijaap.nl" } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2016-06-10 09:48:41" + "time": "2020-02-22T12:28:44+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "0.2", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443" + "reference": "7462d5f123dfc080dfdf26897032a6513644fc95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/b39c7a5b194f9ed7bd0dd345c751007a41862443", - "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/7462d5f123dfc080dfdf26897032a6513644fc95", + "reference": "7462d5f123dfc080dfdf26897032a6513644fc95", "shasum": "" }, "require": { - "php": ">=5.5", - "phpdocumentor/reflection-common": "^1.0" + "php": "^7.2", + "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^5.2||^4.8.24" + "ext-tokenizer": "^7.2", + "mockery/mockery": "~1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.x-dev" } }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] + "phpDocumentor\\Reflection\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -523,41 +760,43 @@ "email": "me@mikevanriel.com" } ], - "time": "2016-06-10 07:14:17" + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "time": "2020-02-18T18:59:58+00:00" }, { "name": "phpspec/prophecy", - "version": "v1.6.1", + "version": "v1.10.3", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "58a8137754bc24b25740d4281399a4a3596058e0" + "reference": "451c3cd1418cf640de218914901e51b064abb093" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/58a8137754bc24b25740d4281399a4a3596058e0", - "reference": "58a8137754bc24b25740d4281399a4a3596058e0", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093", + "reference": "451c3cd1418cf640de218914901e51b064abb093", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", - "sebastian/comparator": "^1.1", - "sebastian/recursion-context": "^1.0" + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", + "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0" }, "require-dev": { - "phpspec/phpspec": "^2.0" + "phpspec/phpspec": "^2.5 || ^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6.x-dev" + "dev-master": "1.10.x-dev" } }, "autoload": { - "psr-0": { - "Prophecy\\": "src/" + "psr-4": { + "Prophecy\\": "src/Prophecy" } }, "notification-url": "https://packagist.org/downloads/", @@ -585,7 +824,7 @@ "spy", "stub" ], - "time": "2016-06-07 08:13:47" + "time": "2020-03-05T15:02:03+00:00" }, { "name": "phpunit/php-code-coverage", @@ -647,20 +886,20 @@ "testing", "xunit" ], - "time": "2015-10-06 15:47:00" + "time": "2015-10-06T15:47:00+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "1.4.1", + "version": "1.4.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0" + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0", - "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", "shasum": "" }, "require": { @@ -694,7 +933,7 @@ "filesystem", "iterator" ], - "time": "2015-06-21 13:08:43" + "time": "2017-11-27T13:52:08+00:00" }, { "name": "phpunit/php-text-template", @@ -735,29 +974,34 @@ "keywords": [ "template" ], - "time": "2015-06-21 13:50:34" + "time": "2015-06-21T13:50:34+00:00" }, { "name": "phpunit/php-timer", - "version": "1.0.8", + "version": "1.0.9", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260" + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260", - "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4|~5" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, "autoload": { "classmap": [ "src/" @@ -779,20 +1023,20 @@ "keywords": [ "timer" ], - "time": "2016-05-12 18:03:57" + "time": "2017-02-26T11:10:40+00:00" }, { "name": "phpunit/php-token-stream", - "version": "1.4.8", + "version": "1.4.12", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da" + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", - "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16", + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16", "shasum": "" }, "require": { @@ -828,20 +1072,20 @@ "keywords": [ "tokenizer" ], - "time": "2015-09-15 10:49:45" + "time": "2017-12-04T08:55:13+00:00" }, { "name": "phpunit/phpunit", - "version": "4.7.7", + "version": "4.8.36", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "9b97f9d807b862c2de2a36e86690000801c85724" + "reference": "46023de9a91eec7dfb06cc56cb4e260017298517" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9b97f9d807b862c2de2a36e86690000801c85724", - "reference": "9b97f9d807b862c2de2a36e86690000801c85724", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517", + "reference": "46023de9a91eec7dfb06cc56cb4e260017298517", "shasum": "" }, "require": { @@ -851,15 +1095,15 @@ "ext-reflection": "*", "ext-spl": "*", "php": ">=5.3.3", - "phpspec/prophecy": "~1.3,>=1.3.1", + "phpspec/prophecy": "^1.3.1", "phpunit/php-code-coverage": "~2.1", "phpunit/php-file-iterator": "~1.4", "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": ">=1.0.6", + "phpunit/php-timer": "^1.0.6", "phpunit/phpunit-mock-objects": "~2.3", - "sebastian/comparator": "~1.1", + "sebastian/comparator": "~1.2.2", "sebastian/diff": "~1.2", - "sebastian/environment": "~1.2", + "sebastian/environment": "~1.3", "sebastian/exporter": "~1.2", "sebastian/global-state": "~1.0", "sebastian/version": "~1.0", @@ -874,7 +1118,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.7.x-dev" + "dev-master": "4.8.x-dev" } }, "autoload": { @@ -900,7 +1144,7 @@ "testing", "xunit" ], - "time": "2015-07-13 11:28:34" + "time": "2017-06-21T08:07:12+00:00" }, { "name": "phpunit/phpunit-mock-objects", @@ -956,26 +1200,35 @@ "mock", "xunit" ], - "time": "2015-10-02 06:51:40" + "abandoned": true, + "time": "2015-10-02T06:51:40+00:00" }, { "name": "psr/log", - "version": "1.0.0", + "version": "1.1.3", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", - "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", + "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", "shasum": "" }, + "require": { + "php": ">=5.3.0" + }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, "autoload": { - "psr-0": { - "Psr\\Log\\": "" + "psr-4": { + "Psr\\Log\\": "Psr/Log/" } }, "notification-url": "https://packagist.org/downloads/", @@ -989,12 +1242,13 @@ } ], "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", "keywords": [ "log", "psr", "psr-3" ], - "time": "2012-12-21 11:40:51" + "time": "2020-03-23T09:12:05+00:00" }, { "name": "satooshi/php-coveralls", @@ -1052,26 +1306,27 @@ "github", "test" ], - "time": "2016-01-20 17:35:46" + "abandoned": "php-coveralls/php-coveralls", + "time": "2016-01-20T17:35:46+00:00" }, { "name": "sebastian/comparator", - "version": "1.2.0", + "version": "1.2.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "937efb279bd37a375bcadf584dec0726f84dbf22" + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", - "reference": "937efb279bd37a375bcadf584dec0726f84dbf22", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", "shasum": "" }, "require": { "php": ">=5.3.3", "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2" + "sebastian/exporter": "~1.2 || ~2.0" }, "require-dev": { "phpunit/phpunit": "~4.4" @@ -1116,27 +1371,27 @@ "compare", "equality" ], - "time": "2015-07-26 15:48:44" + "time": "2017-01-29T09:50:25+00:00" }, { "name": "sebastian/diff", - "version": "1.4.1", + "version": "1.4.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.8" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" }, "type": "library", "extra": { @@ -1168,27 +1423,27 @@ "keywords": [ "diff" ], - "time": "2015-12-08 07:14:41" + "time": "2017-05-22T07:24:03+00:00" }, { "name": "sebastian/environment", - "version": "1.3.7", + "version": "1.3.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716" + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/4e8f0da10ac5802913afc151413bc8c53b6c2716", - "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^4.8 || ^5.0" }, "type": "library", "extra": { @@ -1218,7 +1473,7 @@ "environment", "hhvm" ], - "time": "2016-05-17 03:18:57" + "time": "2016-08-18T05:49:44+00:00" }, { "name": "sebastian/exporter", @@ -1285,7 +1540,7 @@ "export", "exporter" ], - "time": "2016-06-17 09:04:28" + "time": "2016-06-17T09:04:28+00:00" }, { "name": "sebastian/global-state", @@ -1336,20 +1591,20 @@ "keywords": [ "global state" ], - "time": "2015-10-12 03:26:01" + "time": "2015-10-12T03:26:01+00:00" }, { "name": "sebastian/recursion-context", - "version": "1.0.2", + "version": "1.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "913401df809e99e4f47b27cdd781f4a258d58791" + "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791", - "reference": "913401df809e99e4f47b27cdd781f4a258d58791", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7", "shasum": "" }, "require": { @@ -1389,7 +1644,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2015-11-11 19:50:13" + "time": "2016-10-03T07:41:43+00:00" }, { "name": "sebastian/version", @@ -1424,25 +1679,36 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2015-06-21 13:59:46" + "time": "2015-06-21T13:59:46+00:00" }, { "name": "symfony/config", - "version": "v3.1.3", + "version": "v3.4.40", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "a7630397b91be09cdd2fe57fd13612e258700598" + "reference": "3634991bea549e73c45a964c38f30ceeae6ed877" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/a7630397b91be09cdd2fe57fd13612e258700598", - "reference": "a7630397b91be09cdd2fe57fd13612e258700598", + "url": "https://api.github.com/repos/symfony/config/zipball/3634991bea549e73c45a964c38f30ceeae6ed877", + "reference": "3634991bea549e73c45a964c38f30ceeae6ed877", "shasum": "" }, "require": { - "php": ">=5.5.9", - "symfony/filesystem": "~2.8|~3.0" + "php": "^5.5.9|>=7.0.8", + "symfony/filesystem": "~2.8|~3.0|~4.0", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/dependency-injection": "<3.3", + "symfony/finder": "<3.3" + }, + "require-dev": { + "symfony/dependency-injection": "~3.3|~4.0", + "symfony/event-dispatcher": "~3.3|~4.0", + "symfony/finder": "~3.3|~4.0", + "symfony/yaml": "~3.0|~4.0" }, "suggest": { "symfony/yaml": "To use the yaml reference dumper" @@ -1450,7 +1716,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -1477,40 +1743,52 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2016-07-26 08:04:17" + "time": "2020-04-12T14:33:46+00:00" }, { "name": "symfony/console", - "version": "v3.1.3", + "version": "v3.4.40", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "f9e638e8149e9e41b570ff092f8007c477ef0ce5" + "reference": "bf60d5e606cd595391c5f82bf6b570d9573fa120" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/f9e638e8149e9e41b570ff092f8007c477ef0ce5", - "reference": "f9e638e8149e9e41b570ff092f8007c477ef0ce5", + "url": "https://api.github.com/repos/symfony/console/zipball/bf60d5e606cd595391c5f82bf6b570d9573fa120", + "reference": "bf60d5e606cd595391c5f82bf6b570d9573fa120", "shasum": "" }, "require": { - "php": ">=5.5.9", + "php": "^5.5.9|>=7.0.8", + "symfony/debug": "~2.8|~3.0|~4.0", "symfony/polyfill-mbstring": "~1.0" }, + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/process": "<3.3" + }, + "provide": { + "psr/log-implementation": "1.0" + }, "require-dev": { "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.8|~3.0", - "symfony/process": "~2.8|~3.0" + "symfony/config": "~3.3|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~2.8|~3.0|~4.0", + "symfony/lock": "~3.4|~4.0", + "symfony/process": "~3.3|~4.0" }, "suggest": { "psr/log": "For using the console logger", "symfony/event-dispatcher": "", + "symfony/lock": "", "symfony/process": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -1537,20 +1815,76 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2016-07-26 08:04:17" + "time": "2020-03-27T17:07:22+00:00" + }, + { + "name": "symfony/debug", + "version": "v4.4.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "346636d2cae417992ecfd761979b2ab98b339a45" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/346636d2cae417992ecfd761979b2ab98b339a45", + "reference": "346636d2cae417992ecfd761979b2ab98b339a45", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": "<3.4" + }, + "require-dev": { + "symfony/http-kernel": "^3.4|^4.0|^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Debug Component", + "homepage": "https://symfony.com", + "time": "2020-03-27T16:54:36+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v2.8.9", + "version": "v2.8.52", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "889983a79a043dfda68f38c38b6dba092dd49cd8" + "reference": "a77e974a5fecb4398833b0709210e3d5e334ffb0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/889983a79a043dfda68f38c38b6dba092dd49cd8", - "reference": "889983a79a043dfda68f38c38b6dba092dd49cd8", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a77e974a5fecb4398833b0709210e3d5e334ffb0", + "reference": "a77e974a5fecb4398833b0709210e3d5e334ffb0", "shasum": "" }, "require": { @@ -1558,7 +1892,7 @@ }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~2.0,>=2.0.5|~3.0.0", + "symfony/config": "^2.0.5|~3.0.0", "symfony/dependency-injection": "~2.6|~3.0.0", "symfony/expression-language": "~2.6|~3.0.0", "symfony/stopwatch": "~2.3|~3.0.0" @@ -1597,29 +1931,30 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2016-07-28 16:56:28" + "time": "2018-11-21T14:20:20+00:00" }, { "name": "symfony/filesystem", - "version": "v3.1.3", + "version": "v4.4.8", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "bb29adceb552d202b6416ede373529338136e84f" + "reference": "a3ebf3bfd8a98a147c010a568add5a8aa4edea0f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/bb29adceb552d202b6416ede373529338136e84f", - "reference": "bb29adceb552d202b6416ede373529338136e84f", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/a3ebf3bfd8a98a147c010a568add5a8aa4edea0f", + "reference": "a3ebf3bfd8a98a147c010a568add5a8aa4edea0f", "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": "^7.1.3", + "symfony/polyfill-ctype": "~1.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -1646,37 +1981,37 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2016-07-20 05:44:26" + "time": "2020-04-12T14:39:55+00:00" }, { - "name": "symfony/polyfill-mbstring", - "version": "v1.2.0", + "name": "symfony/polyfill-ctype", + "version": "v1.17.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "dff51f72b0706335131b00a7f49606168c582594" + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "e94c8b1bbe2bc77507a1056cdb06451c75b427f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/dff51f72b0706335131b00a7f49606168c582594", - "reference": "dff51f72b0706335131b00a7f49606168c582594", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e94c8b1bbe2bc77507a1056cdb06451c75b427f9", + "reference": "e94c8b1bbe2bc77507a1056cdb06451c75b427f9", "shasum": "" }, "require": { "php": ">=5.3.3" }, "suggest": { - "ext-mbstring": "For best performance" + "ext-ctype": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.17-dev" } }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" + "Symfony\\Polyfill\\Ctype\\": "" }, "files": [ "bootstrap.php" @@ -1688,46 +2023,45 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for the Mbstring extension", + "description": "Symfony polyfill for ctype functions", "homepage": "https://symfony.com", "keywords": [ "compatibility", - "mbstring", + "ctype", "polyfill", - "portable", - "shim" + "portable" ], - "time": "2016-05-18 14:26:46" + "time": "2020-05-12T16:14:59+00:00" }, { "name": "symfony/stopwatch", - "version": "v3.1.3", + "version": "v3.4.40", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "bb42806b12c5f89db4ebf64af6741afe6d8457e1" + "reference": "a7a98f40dcc382a332c3729a6d04b298ffbb8f1f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/bb42806b12c5f89db4ebf64af6741afe6d8457e1", - "reference": "bb42806b12c5f89db4ebf64af6741afe6d8457e1", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/a7a98f40dcc382a332c3729a6d04b298ffbb8f1f", + "reference": "a7a98f40dcc382a332c3729a6d04b298ffbb8f1f", "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": "^5.5.9|>=7.0.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -1754,29 +2088,39 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2016-06-29 05:41:56" + "time": "2020-03-15T09:38:08+00:00" }, { "name": "symfony/yaml", - "version": "v3.1.3", + "version": "v3.4.40", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "1819adf2066880c7967df7180f4f662b6f0567ac" + "reference": "8fef49ac1357f4e05c997a1f139467ccb186bffa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/1819adf2066880c7967df7180f4f662b6f0567ac", - "reference": "1819adf2066880c7967df7180f4f662b6f0567ac", + "url": "https://api.github.com/repos/symfony/yaml/zipball/8fef49ac1357f4e05c997a1f139467ccb186bffa", + "reference": "8fef49ac1357f4e05c997a1f139467ccb186bffa", "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/console": "<3.4" + }, + "require-dev": { + "symfony/console": "~3.4|~4.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -1803,34 +2147,33 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2016-07-17 14:02:08" + "time": "2020-04-24T10:16:04+00:00" }, { "name": "webmozart/assert", - "version": "1.0.2", + "version": "1.8.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde" + "reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde", - "reference": "30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde", + "url": "https://api.github.com/repos/webmozart/assert/zipball/ab2cb0b3b559010b75981b1bdce728da3ee90ad6", + "reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.3.3 || ^7.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "vimeo/psalm": "<3.9.1" }, "require-dev": { - "phpunit/phpunit": "^4.6" + "phpunit/phpunit": "^4.8.36 || ^7.5.13" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, "autoload": { "psr-4": { "Webmozart\\Assert\\": "src/" @@ -1852,7 +2195,7 @@ "check", "validate" ], - "time": "2015-08-24 13:29:44" + "time": "2020-04-18T12:12:48+00:00" } ], "aliases": [], diff --git a/src/Analytics.php b/src/Analytics.php index b885f2a..6479412 100644 --- a/src/Analytics.php +++ b/src/Analytics.php @@ -7,6 +7,7 @@ use TheIconic\Tracking\GoogleAnalytics\Network\HttpClient; use TheIconic\Tracking\GoogleAnalytics\Network\PrepareUrl; use TheIconic\Tracking\GoogleAnalytics\Exception\InvalidPayloadDataException; +use TheIconic\Tracking\GoogleAnalytics\Exception\EnqueueUrlsOverflowException; /** * Class Analytics @@ -319,6 +320,14 @@ class Analytics */ protected $debugEndpoint = '://www.google-analytics.com/debug/collect'; + /** + * Endpoint to connect to when sending batch data to GA. + * + * @var string + */ + protected $batchEndpoint = '://www.google-analytics.com/batch'; + + /** * Indicates if the request is in debug mode(validating hits). * @@ -354,6 +363,11 @@ class Analytics */ protected $isDisabled = false; + /** + * @var array + */ + protected $enqueuedUrls = []; + /** * @var array */ @@ -553,6 +567,16 @@ protected function getEndpoint() return ($this->isDebug) ? $this->uriScheme . $this->debugEndpoint : $this->uriScheme . $this->endpoint; } + /** + * Gets the full batch endpoint to GA. + * + * @return string + */ + protected function getBatchEndpoint() + { + return $this->uriScheme . $this->batchEndpoint; + } + /** * Sets debug mode to true or false. * @@ -578,6 +602,47 @@ protected function sendHit($methodName) { $hitType = strtoupper(substr($methodName, 4)); + $this->setAndValidateHit($hitType); + + if ($this->isDisabled) { + return new NullAnalyticsResponse(); + } + + return $this->getHttpClient()->post($this->getUrl(), $this->getHttpClientOptions()); + } + + /** + * Enqueue a hit to GA. The hit will contain in the payload all the parameters added before. + * + * @param $methodName + * @return $this + * @throws Exception\InvalidPayloadDataException + */ + protected function enqueueHit($methodName) + { + + if(count($this->enqueuedUrls) == 20) { + throw new EnqueueUrlsOverflowException(); + } + + $hitType = strtoupper(substr($methodName, 7)); + + $this->setAndValidateHit($hitType); + $this->enqueuedUrls[] = $this->getUrl(true); + + return $this; + } + + /** + * Validate and set hitType + * + * @param $methodName + * @return void + * @throws Exception\InvalidPayloadDataException + */ + protected function setAndValidateHit($hitType) + { + $hitConstant = $this->getParameterClassConstant( 'TheIconic\Tracking\GoogleAnalytics\Parameters\Hit\HitType::HIT_TYPE_' . $hitType, 'Hit type ' . $hitType . ' is not defined, check spelling' @@ -588,12 +653,20 @@ protected function sendHit($methodName) if (!$this->hasMinimumRequiredParameters()) { throw new InvalidPayloadDataException(); } + } + /** + * Sends enqueued hits to GA. These hits will contain in the payload all the parameters added before. + * + * @return AnalyticsResponseInterface + */ + public function sendEnqueuedHits() + { if ($this->isDisabled) { return new NullAnalyticsResponse(); } - return $this->getHttpClient()->post($this->getUrl(), $this->getHttpClientOptions()); + return $this->getHttpClient()->batch($this->getBatchEndpoint(), $this->enqueuedUrls, $this->getHttpClientOptions()); } /** @@ -618,14 +691,15 @@ protected function getHttpClientOptions() * @api * @return string */ - public function getUrl() + public function getUrl($onlyQuery = false) { $prepareUrl = new PrepareUrl; return $prepareUrl->build( $this->getEndpoint(), $this->singleParameters, - $this->compoundParametersCollections + $this->compoundParametersCollections, + $onlyQuery ); } @@ -858,6 +932,16 @@ protected function getFullParameterClass($parameterClass, $methodName) } } + /** + * Empty batch queue + * + * @return void + */ + public function emptyQueue() + { + $this->enqueuedUrls = []; + } + /** * Routes the method call to the adequate protected method. * @@ -886,6 +970,10 @@ public function __call($methodName, array $methodArguments) return $this->sendHit($methodName); } + if (preg_match('/^(enqueue)(\w+)/', $methodName, $matches)) { + return $this->enqueueHit($methodName); + } + // Get Parameters if (preg_match('/^(get)(\w+)/', $methodName, $matches)) { return $this->getParameter($methodName, $methodArguments); diff --git a/src/Exception/EnqueueUrlsOverflowException.php b/src/Exception/EnqueueUrlsOverflowException.php new file mode 100644 index 0000000..c27d3f1 --- /dev/null +++ b/src/Exception/EnqueueUrlsOverflowException.php @@ -0,0 +1,18 @@ +getAnalyticsResponse($request, $response); } + /** + * Sends batch request to Google Analytics. + * + * @internal + * @param string $url + * @param array $batchUrls + * @param array $options + * @return AnalyticsResponse + */ + public function batch($url, array $batchUrls, array $options = []) + { + $body = implode($batchUrls, PHP_EOL); + + $request = new Request( + 'POST', + $url, + ['User-Agent' => self::PHP_GA_MEASUREMENT_PROTOCOL_USER_AGENT], + $body + ); + + $opts = $this->parseOptions($options); + $response = $this->getClient()->sendAsync($request, [ + 'synchronous' => !$opts['async'], + 'timeout' => $opts['timeout'], + 'connect_timeout' => $opts['timeout'], + ]); + + if ($opts['async']) { + self::$promises[] = $response; + } else { + $response = $response->wait(); + } + + return $this->getAnalyticsResponse($request, $response); + } + /** * Parse the given options and fill missing fields with default values. * diff --git a/src/Network/PrepareUrl.php b/src/Network/PrepareUrl.php index 9d9b3f4..b347a9c 100644 --- a/src/Network/PrepareUrl.php +++ b/src/Network/PrepareUrl.php @@ -34,7 +34,7 @@ class PrepareUrl * @param CompoundParameterCollection[] $compoundParameters * @return string */ - public function build($url, array $singleParameters, array $compoundParameters) + public function build($url, array $singleParameters, array $compoundParameters, $onlyQuery = false) { $singlesPost = $this->getSingleParametersPayload($singleParameters); @@ -46,7 +46,7 @@ public function build($url, array $singleParameters, array $compoundParameters) $this->payloadParameters['z'] = $this->cacheBuster; } $query = http_build_query($this->payloadParameters, null, ini_get('arg_separator.output'), PHP_QUERY_RFC3986); - return $url . '?' . $query; + return $onlyQuery ? $query : ($url . '?' . $query); } /** diff --git a/tests/TheIconic/Tracking/GoogleAnalytics/AnalyticsTest.php b/tests/TheIconic/Tracking/GoogleAnalytics/AnalyticsTest.php index 9b5f0f2..57b6531 100644 --- a/tests/TheIconic/Tracking/GoogleAnalytics/AnalyticsTest.php +++ b/tests/TheIconic/Tracking/GoogleAnalytics/AnalyticsTest.php @@ -207,6 +207,27 @@ public function testDisablingSend() $this->assertEquals([], $result->getDebugResponse()); } + public function testDisablingBatchSend() + { + $analyticsDisabled = new Analytics(false, true); + $analyticsDisabled + ->setProtocolVersion('1') + ->setTrackingId('555') + ->setClientId('666') + ->setDocumentPath('\thepage') + ->enqueuePageview(); + + $result = $analyticsDisabled->sendEnqueuedHits(); + $this->assertInstanceOf( + 'TheIconic\Tracking\GoogleAnalytics\NullAnalyticsResponse', + $result + ); + + $this->assertNull($result->getHttpStatusCode()); + $this->assertEmpty($result->getRequestUrl()); + $this->assertEquals([], $result->getDebugResponse()); + } + public function testSendSimpleHit() { $httpClient = $this->getMock('TheIconic\Tracking\GoogleAnalytics\Network\HttpClient', ['post']); @@ -275,6 +296,35 @@ public function testSendSimpleDebugHit() $this->analytics->sendPageview(); } + public function testSendBatchHits() + { + $httpClient = $this->getMock('TheIconic\Tracking\GoogleAnalytics\Network\HttpClient', ['batch']); + + $this->analytics + ->setDebug(true) + ->setProtocolVersion('1') + ->setTrackingId('555') + ->setClientId('666') + ->setDocumentPath('\mypage') + ->enqueuePageview() + ->setDocumentPath('\mypage2') + ->enqueuePageview(); + + $httpClient->expects($this->once()) + ->method('batch') + ->with( + 'http://www.google-analytics.com/batch', + [ + 'v=1&tid=555&cid=666&dp=%5Cmypage&t=pageview', + 'v=1&tid=555&cid=666&dp=%5Cmypage2&t=pageview' + ] + ); + + $this->analytics->setHttpClient($httpClient); + + $this->analytics->sendEnqueuedHits(); + } + public function testFixTypos() { $httpClient = $this->getMock('TheIconic\Tracking\GoogleAnalytics\Network\HttpClient', ['post']); diff --git a/tests/TheIconic/Tracking/GoogleAnalytics/Network/HttpClientTest.php b/tests/TheIconic/Tracking/GoogleAnalytics/Network/HttpClientTest.php index aebc46d..5d23f5f 100644 --- a/tests/TheIconic/Tracking/GoogleAnalytics/Network/HttpClientTest.php +++ b/tests/TheIconic/Tracking/GoogleAnalytics/Network/HttpClientTest.php @@ -67,7 +67,7 @@ public function testPost() ->disableOriginalConstructor() ->getMock(); - $mockPromise->expects($this->exactly(3)) + $mockPromise->expects($this->exactly(4)) ->method('wait') ->will($this->returnValue($mockResponse)); @@ -131,6 +131,10 @@ public function testPost() $this->assertInstanceOf('TheIconic\Tracking\GoogleAnalytics\AnalyticsResponse', $response); + $response = $this->httpClient->batch('http://test-collector.com/collect?v=1', [], ['timeout' => 3]); + + $this->assertInstanceOf('TheIconic\Tracking\GoogleAnalytics\AnalyticsResponse', $response); + // Promises should be unwrapped on the object destruction $this->httpClient = null; $this->mockHttpClient = null; From bb7c102b91a455d665dfa877a3c202d3f7bed9cd Mon Sep 17 00:00:00 2001 From: Alberto Date: Tue, 16 Jun 2020 10:37:09 +0200 Subject: [PATCH 02/13] Fix implode parameters order --- src/Network/HttpClient.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Network/HttpClient.php b/src/Network/HttpClient.php index 174db68..40fb888 100644 --- a/src/Network/HttpClient.php +++ b/src/Network/HttpClient.php @@ -121,7 +121,7 @@ public function post($url, array $options = []) */ public function batch($url, array $batchUrls, array $options = []) { - $body = implode($batchUrls, PHP_EOL); + $body = implode(PHP_EOL, $batchUrls); $request = new Request( 'POST', From ca25acda3f2e3a99dcd0a36f7c6ae58e31aa6128 Mon Sep 17 00:00:00 2001 From: George Borges Date: Thu, 24 Sep 2020 17:02:22 +1000 Subject: [PATCH 03/13] Revert PHPUnit to 4.7 --- composer.json | 4 ++-- composer.lock | 23 ++++++++++++----------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/composer.json b/composer.json index 9a4aa81..46ce038 100644 --- a/composer.json +++ b/composer.json @@ -14,8 +14,8 @@ "guzzlehttp/guzzle": "^6.0 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "4.8.*", - "satooshi/php-coveralls": "1.0.1" + "satooshi/php-coveralls": "1.0.1", + "phpunit/phpunit": "4.7.*" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 478e6db..9dd83a3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c9694c451f90121c714ecbc6cef1bcb4", + "content-hash": "f850306a4499ef38f2e729155a517054", "packages": [ { "name": "guzzlehttp/guzzle", @@ -1072,20 +1072,21 @@ "keywords": [ "tokenizer" ], + "abandoned": true, "time": "2017-12-04T08:55:13+00:00" }, { "name": "phpunit/phpunit", - "version": "4.8.36", + "version": "4.7.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "46023de9a91eec7dfb06cc56cb4e260017298517" + "reference": "9b97f9d807b862c2de2a36e86690000801c85724" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517", - "reference": "46023de9a91eec7dfb06cc56cb4e260017298517", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9b97f9d807b862c2de2a36e86690000801c85724", + "reference": "9b97f9d807b862c2de2a36e86690000801c85724", "shasum": "" }, "require": { @@ -1095,15 +1096,15 @@ "ext-reflection": "*", "ext-spl": "*", "php": ">=5.3.3", - "phpspec/prophecy": "^1.3.1", + "phpspec/prophecy": "~1.3,>=1.3.1", "phpunit/php-code-coverage": "~2.1", "phpunit/php-file-iterator": "~1.4", "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "^1.0.6", + "phpunit/php-timer": ">=1.0.6", "phpunit/phpunit-mock-objects": "~2.3", - "sebastian/comparator": "~1.2.2", + "sebastian/comparator": "~1.1", "sebastian/diff": "~1.2", - "sebastian/environment": "~1.3", + "sebastian/environment": "~1.2", "sebastian/exporter": "~1.2", "sebastian/global-state": "~1.0", "sebastian/version": "~1.0", @@ -1118,7 +1119,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.8.x-dev" + "dev-master": "4.7.x-dev" } }, "autoload": { @@ -1144,7 +1145,7 @@ "testing", "xunit" ], - "time": "2017-06-21T08:07:12+00:00" + "time": "2015-07-13T11:28:34+00:00" }, { "name": "phpunit/phpunit-mock-objects", From b85252ba0ce31602cba04fcd6d4e26d36f66c68f Mon Sep 17 00:00:00 2001 From: George Borges Date: Thu, 24 Sep 2020 17:07:33 +1000 Subject: [PATCH 04/13] Force composer.lock to revert completely to master --- composer.lock | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/composer.lock b/composer.lock index 9dd83a3..478e6db 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f850306a4499ef38f2e729155a517054", + "content-hash": "c9694c451f90121c714ecbc6cef1bcb4", "packages": [ { "name": "guzzlehttp/guzzle", @@ -1072,21 +1072,20 @@ "keywords": [ "tokenizer" ], - "abandoned": true, "time": "2017-12-04T08:55:13+00:00" }, { "name": "phpunit/phpunit", - "version": "4.7.7", + "version": "4.8.36", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "9b97f9d807b862c2de2a36e86690000801c85724" + "reference": "46023de9a91eec7dfb06cc56cb4e260017298517" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9b97f9d807b862c2de2a36e86690000801c85724", - "reference": "9b97f9d807b862c2de2a36e86690000801c85724", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517", + "reference": "46023de9a91eec7dfb06cc56cb4e260017298517", "shasum": "" }, "require": { @@ -1096,15 +1095,15 @@ "ext-reflection": "*", "ext-spl": "*", "php": ">=5.3.3", - "phpspec/prophecy": "~1.3,>=1.3.1", + "phpspec/prophecy": "^1.3.1", "phpunit/php-code-coverage": "~2.1", "phpunit/php-file-iterator": "~1.4", "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": ">=1.0.6", + "phpunit/php-timer": "^1.0.6", "phpunit/phpunit-mock-objects": "~2.3", - "sebastian/comparator": "~1.1", + "sebastian/comparator": "~1.2.2", "sebastian/diff": "~1.2", - "sebastian/environment": "~1.2", + "sebastian/environment": "~1.3", "sebastian/exporter": "~1.2", "sebastian/global-state": "~1.0", "sebastian/version": "~1.0", @@ -1119,7 +1118,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.7.x-dev" + "dev-master": "4.8.x-dev" } }, "autoload": { @@ -1145,7 +1144,7 @@ "testing", "xunit" ], - "time": "2015-07-13T11:28:34+00:00" + "time": "2017-06-21T08:07:12+00:00" }, { "name": "phpunit/phpunit-mock-objects", From 220248eaa40d37461d78e6907e73b42e810918be Mon Sep 17 00:00:00 2001 From: George Borges Date: Thu, 24 Sep 2020 17:16:58 +1000 Subject: [PATCH 05/13] Force composer files to master versions --- composer.json | 4 +- composer.lock | 825 +++++++++++++++----------------------------------- 2 files changed, 243 insertions(+), 586 deletions(-) diff --git a/composer.json b/composer.json index 46ce038..ad4c259 100644 --- a/composer.json +++ b/composer.json @@ -14,8 +14,8 @@ "guzzlehttp/guzzle": "^6.0 || ^7.0" }, "require-dev": { - "satooshi/php-coveralls": "1.0.1", - "phpunit/phpunit": "4.7.*" + "phpunit/phpunit": "4.7.*", + "satooshi/php-coveralls": "1.0.1" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 478e6db..a38159d 100644 --- a/composer.lock +++ b/composer.lock @@ -1,53 +1,49 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "c9694c451f90121c714ecbc6cef1bcb4", + "hash": "21cf5251a1eab1c731860d4365b6bb31", + "content-hash": "35166a06fdd1ab04bc07023144b50efd", "packages": [ { "name": "guzzlehttp/guzzle", - "version": "6.5.4", + "version": "6.2.1", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "a4a1b6930528a8f7ee03518e6442ec7a44155d9d" + "reference": "3f808fba627f2c5b69e2501217bf31af349c1427" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/a4a1b6930528a8f7ee03518e6442ec7a44155d9d", - "reference": "a4a1b6930528a8f7ee03518e6442ec7a44155d9d", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/3f808fba627f2c5b69e2501217bf31af349c1427", + "reference": "3f808fba627f2c5b69e2501217bf31af349c1427", "shasum": "" }, "require": { - "ext-json": "*", "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.6.1", - "php": ">=5.5", - "symfony/polyfill-intl-idn": "1.17.0" + "guzzlehttp/psr7": "^1.3.1", + "php": ">=5.5" }, "require-dev": { "ext-curl": "*", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", - "psr/log": "^1.1" - }, - "suggest": { - "psr/log": "Required for using the Log middleware" + "phpunit/phpunit": "^4.0", + "psr/log": "^1.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "6.5-dev" + "dev-master": "6.2-dev" } }, "autoload": { - "psr-4": { - "GuzzleHttp\\": "src/" - }, "files": [ "src/functions_include.php" - ] + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -71,32 +67,32 @@ "rest", "web service" ], - "time": "2020-05-25T19:35:05+00:00" + "time": "2016-07-15 17:22:37" }, { "name": "guzzlehttp/promises", - "version": "v1.3.1", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" + "reference": "c10d860e2a9595f8883527fa0021c7da9e65f579" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", - "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "url": "https://api.github.com/repos/guzzle/promises/zipball/c10d860e2a9595f8883527fa0021c7da9e65f579", + "reference": "c10d860e2a9595f8883527fa0021c7da9e65f579", "shasum": "" }, "require": { "php": ">=5.5.0" }, "require-dev": { - "phpunit/phpunit": "^4.0" + "phpunit/phpunit": "~4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "1.0-dev" } }, "autoload": { @@ -122,41 +118,36 @@ "keywords": [ "promise" ], - "time": "2016-12-20T10:07:11+00:00" + "time": "2016-05-18 16:56:05" }, { "name": "guzzlehttp/psr7", - "version": "1.6.1", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "239400de7a173fe9901b9ac7c06497751f00727a" + "reference": "5c6447c9df362e8f8093bda8f5d8873fe5c7f65b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/239400de7a173fe9901b9ac7c06497751f00727a", - "reference": "239400de7a173fe9901b9ac7c06497751f00727a", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/5c6447c9df362e8f8093bda8f5d8873fe5c7f65b", + "reference": "5c6447c9df362e8f8093bda8f5d8873fe5c7f65b", "shasum": "" }, "require": { "php": ">=5.4.0", - "psr/http-message": "~1.0", - "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" + "psr/http-message": "~1.0" }, "provide": { "psr/http-message-implementation": "1.0" }, "require-dev": { - "ext-zlib": "*", - "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" - }, - "suggest": { - "zendframework/zend-httphandlerrunner": "Emit PSR-7 responses" + "phpunit/phpunit": "~4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6-dev" + "dev-master": "1.4-dev" } }, "autoload": { @@ -176,37 +167,29 @@ "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" - }, - { - "name": "Tobias Schultze", - "homepage": "https://github.com/Tobion" } ], - "description": "PSR-7 message implementation that also provides common utility methods", + "description": "PSR-7 message implementation", "keywords": [ "http", "message", - "psr-7", - "request", - "response", "stream", - "uri", - "url" + "uri" ], - "time": "2019-07-01T23:21:34+00:00" + "time": "2016-06-24 23:00:38" }, { "name": "psr/http-message", - "version": "1.0.1", + "version": "1.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", + "reference": "85d63699f0dbedb190bbd4b0d2b9dc707ea4c298", "shasum": "" }, "require": { @@ -234,7 +217,6 @@ } ], "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", "keywords": [ "http", "http-message", @@ -243,256 +225,38 @@ "request", "response" ], - "time": "2016-08-06T14:39:51+00:00" - }, - { - "name": "ralouphie/getallheaders", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/ralouphie/getallheaders.git", - "reference": "120b605dfeb996808c31b6477290a714d356e822" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", - "reference": "120b605dfeb996808c31b6477290a714d356e822", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "require-dev": { - "php-coveralls/php-coveralls": "^2.1", - "phpunit/phpunit": "^5 || ^6.5" - }, - "type": "library", - "autoload": { - "files": [ - "src/getallheaders.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ralph Khattar", - "email": "ralph.khattar@gmail.com" - } - ], - "description": "A polyfill for getallheaders.", - "time": "2019-03-08T08:55:37+00:00" - }, - { - "name": "symfony/polyfill-intl-idn", - "version": "v1.17.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "3bff59ea7047e925be6b7f2059d60af31bb46d6a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/3bff59ea7047e925be6b7f2059d60af31bb46d6a", - "reference": "3bff59ea7047e925be6b7f2059d60af31bb46d6a", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "symfony/polyfill-mbstring": "^1.3", - "symfony/polyfill-php72": "^1.10" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.17-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Intl\\Idn\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Laurent Bassin", - "email": "laurent@bassin.info" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "idn", - "intl", - "polyfill", - "portable", - "shim" - ], - "time": "2020-05-12T16:47:27+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.17.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "fa79b11539418b02fc5e1897267673ba2c19419c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fa79b11539418b02fc5e1897267673ba2c19419c", - "reference": "fa79b11539418b02fc5e1897267673ba2c19419c", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.17-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "time": "2020-05-12T16:47:27+00:00" - }, - { - "name": "symfony/polyfill-php72", - "version": "v1.17.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "f048e612a3905f34931127360bdd2def19a5e582" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/f048e612a3905f34931127360bdd2def19a5e582", - "reference": "f048e612a3905f34931127360bdd2def19a5e582", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.17-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "time": "2020-05-12T16:47:27+00:00" + "time": "2015-05-04 20:22:00" } ], "packages-dev": [ { "name": "doctrine/instantiator", - "version": "1.3.0", + "version": "1.0.5", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "ae466f726242e637cebdd526a7d991b9433bacf1" + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/ae466f726242e637cebdd526a7d991b9433bacf1", - "reference": "ae466f726242e637cebdd526a7d991b9433bacf1", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", "shasum": "" }, "require": { - "php": "^7.1" + "php": ">=5.3,<8.0-DEV" }, "require-dev": { - "doctrine/coding-standard": "^6.0", + "athletic/athletic": "~0.1.8", "ext-pdo": "*", "ext-phar": "*", - "phpbench/phpbench": "^0.13", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-shim": "^0.11", - "phpunit/phpunit": "^7.0" + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~2.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { @@ -512,12 +276,12 @@ } ], "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "homepage": "https://github.com/doctrine/instantiator", "keywords": [ "constructor", "instantiate" ], - "time": "2019-10-21T16:45:58+00:00" + "time": "2015-06-14 21:17:01" }, { "name": "guzzle/guzzle", @@ -613,34 +377,39 @@ "web service" ], "abandoned": "guzzlehttp/guzzle", - "time": "2015-03-18T18:23:50+00:00" + "time": "2015-03-18 18:23:50" }, { "name": "phpdocumentor/reflection-common", - "version": "2.1.0", + "version": "1.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "6568f4687e5b41b054365f9ae03fcb1ed5f2069b" + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/6568f4687e5b41b054365f9ae03fcb1ed5f2069b", - "reference": "6568f4687e5b41b054365f9ae03fcb1ed5f2069b", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": "src/" + "phpDocumentor\\Reflection\\": [ + "src" + ] } }, "notification-url": "https://packagist.org/downloads/", @@ -662,42 +431,38 @@ "reflection", "static analysis" ], - "time": "2020-04-27T09:25:28+00:00" + "time": "2015-12-27 11:43:31" }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.1.0", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e" + "reference": "9270140b940ff02e58ec577c237274e92cd40cdd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e", - "reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9270140b940ff02e58ec577c237274e92cd40cdd", + "reference": "9270140b940ff02e58ec577c237274e92cd40cdd", "shasum": "" }, "require": { - "ext-filter": "^7.1", - "php": "^7.2", - "phpdocumentor/reflection-common": "^2.0", - "phpdocumentor/type-resolver": "^1.0", - "webmozart/assert": "^1" + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0@dev", + "phpdocumentor/type-resolver": "^0.2.0", + "webmozart/assert": "^1.0" }, "require-dev": { - "doctrine/instantiator": "^1", - "mockery/mockery": "^1" + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^4.4" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.x-dev" - } - }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": "src" + "phpDocumentor\\Reflection\\": [ + "src/" + ] } }, "notification-url": "https://packagist.org/downloads/", @@ -708,46 +473,44 @@ { "name": "Mike van Riel", "email": "me@mikevanriel.com" - }, - { - "name": "Jaap van Otterdijk", - "email": "account@ijaap.nl" } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2020-02-22T12:28:44+00:00" + "time": "2016-06-10 09:48:41" }, { "name": "phpdocumentor/type-resolver", - "version": "1.1.0", + "version": "0.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "7462d5f123dfc080dfdf26897032a6513644fc95" + "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/7462d5f123dfc080dfdf26897032a6513644fc95", - "reference": "7462d5f123dfc080dfdf26897032a6513644fc95", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/b39c7a5b194f9ed7bd0dd345c751007a41862443", + "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443", "shasum": "" }, "require": { - "php": "^7.2", - "phpdocumentor/reflection-common": "^2.0" + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0" }, "require-dev": { - "ext-tokenizer": "^7.2", - "mockery/mockery": "~1" + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": "src" + "phpDocumentor\\Reflection\\": [ + "src/" + ] } }, "notification-url": "https://packagist.org/downloads/", @@ -760,43 +523,41 @@ "email": "me@mikevanriel.com" } ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "time": "2020-02-18T18:59:58+00:00" + "time": "2016-06-10 07:14:17" }, { "name": "phpspec/prophecy", - "version": "v1.10.3", + "version": "v1.6.1", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "451c3cd1418cf640de218914901e51b064abb093" + "reference": "58a8137754bc24b25740d4281399a4a3596058e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093", - "reference": "451c3cd1418cf640de218914901e51b064abb093", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/58a8137754bc24b25740d4281399a4a3596058e0", + "reference": "58a8137754bc24b25740d4281399a4a3596058e0", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", - "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0" + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "sebastian/comparator": "^1.1", + "sebastian/recursion-context": "^1.0" }, "require-dev": { - "phpspec/phpspec": "^2.5 || ^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + "phpspec/phpspec": "^2.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.10.x-dev" + "dev-master": "1.6.x-dev" } }, "autoload": { - "psr-4": { - "Prophecy\\": "src/Prophecy" + "psr-0": { + "Prophecy\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -824,7 +585,7 @@ "spy", "stub" ], - "time": "2020-03-05T15:02:03+00:00" + "time": "2016-06-07 08:13:47" }, { "name": "phpunit/php-code-coverage", @@ -886,20 +647,20 @@ "testing", "xunit" ], - "time": "2015-10-06T15:47:00+00:00" + "time": "2015-10-06 15:47:00" }, { "name": "phpunit/php-file-iterator", - "version": "1.4.5", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0", + "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0", "shasum": "" }, "require": { @@ -933,7 +694,7 @@ "filesystem", "iterator" ], - "time": "2017-11-27T13:52:08+00:00" + "time": "2015-06-21 13:08:43" }, { "name": "phpunit/php-text-template", @@ -974,34 +735,29 @@ "keywords": [ "template" ], - "time": "2015-06-21T13:50:34+00:00" + "time": "2015-06-21 13:50:34" }, { "name": "phpunit/php-timer", - "version": "1.0.9", + "version": "1.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260", + "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "~4|~5" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, "autoload": { "classmap": [ "src/" @@ -1023,20 +779,20 @@ "keywords": [ "timer" ], - "time": "2017-02-26T11:10:40+00:00" + "time": "2016-05-12 18:03:57" }, { "name": "phpunit/php-token-stream", - "version": "1.4.12", + "version": "1.4.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16" + "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16", - "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", + "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", "shasum": "" }, "require": { @@ -1072,20 +828,20 @@ "keywords": [ "tokenizer" ], - "time": "2017-12-04T08:55:13+00:00" + "time": "2015-09-15 10:49:45" }, { "name": "phpunit/phpunit", - "version": "4.8.36", + "version": "4.7.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "46023de9a91eec7dfb06cc56cb4e260017298517" + "reference": "9b97f9d807b862c2de2a36e86690000801c85724" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517", - "reference": "46023de9a91eec7dfb06cc56cb4e260017298517", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9b97f9d807b862c2de2a36e86690000801c85724", + "reference": "9b97f9d807b862c2de2a36e86690000801c85724", "shasum": "" }, "require": { @@ -1095,15 +851,15 @@ "ext-reflection": "*", "ext-spl": "*", "php": ">=5.3.3", - "phpspec/prophecy": "^1.3.1", + "phpspec/prophecy": "~1.3,>=1.3.1", "phpunit/php-code-coverage": "~2.1", "phpunit/php-file-iterator": "~1.4", "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "^1.0.6", + "phpunit/php-timer": ">=1.0.6", "phpunit/phpunit-mock-objects": "~2.3", - "sebastian/comparator": "~1.2.2", + "sebastian/comparator": "~1.1", "sebastian/diff": "~1.2", - "sebastian/environment": "~1.3", + "sebastian/environment": "~1.2", "sebastian/exporter": "~1.2", "sebastian/global-state": "~1.0", "sebastian/version": "~1.0", @@ -1118,7 +874,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.8.x-dev" + "dev-master": "4.7.x-dev" } }, "autoload": { @@ -1144,7 +900,7 @@ "testing", "xunit" ], - "time": "2017-06-21T08:07:12+00:00" + "time": "2015-07-13 11:28:34" }, { "name": "phpunit/phpunit-mock-objects", @@ -1200,35 +956,26 @@ "mock", "xunit" ], - "abandoned": true, - "time": "2015-10-02T06:51:40+00:00" + "time": "2015-10-02 06:51:40" }, { "name": "psr/log", - "version": "1.1.3", + "version": "1.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" + "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", + "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", "shasum": "" }, - "require": { - "php": ">=5.3.0" - }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" + "psr-0": { + "Psr\\Log\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -1242,13 +989,12 @@ } ], "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", "keywords": [ "log", "psr", "psr-3" ], - "time": "2020-03-23T09:12:05+00:00" + "time": "2012-12-21 11:40:51" }, { "name": "satooshi/php-coveralls", @@ -1306,27 +1052,26 @@ "github", "test" ], - "abandoned": "php-coveralls/php-coveralls", - "time": "2016-01-20T17:35:46+00:00" + "time": "2016-01-20 17:35:46" }, { "name": "sebastian/comparator", - "version": "1.2.4", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + "reference": "937efb279bd37a375bcadf584dec0726f84dbf22" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", + "reference": "937efb279bd37a375bcadf584dec0726f84dbf22", "shasum": "" }, "require": { "php": ">=5.3.3", "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2 || ~2.0" + "sebastian/exporter": "~1.2" }, "require-dev": { "phpunit/phpunit": "~4.4" @@ -1371,27 +1116,27 @@ "compare", "equality" ], - "time": "2017-01-29T09:50:25+00:00" + "time": "2015-07-26 15:48:44" }, { "name": "sebastian/diff", - "version": "1.4.3", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", + "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "~4.8" }, "type": "library", "extra": { @@ -1423,27 +1168,27 @@ "keywords": [ "diff" ], - "time": "2017-05-22T07:24:03+00:00" + "time": "2015-12-08 07:14:41" }, { "name": "sebastian/environment", - "version": "1.3.8", + "version": "1.3.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" + "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", - "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/4e8f0da10ac5802913afc151413bc8c53b6c2716", + "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "^4.8 || ^5.0" + "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { @@ -1473,7 +1218,7 @@ "environment", "hhvm" ], - "time": "2016-08-18T05:49:44+00:00" + "time": "2016-05-17 03:18:57" }, { "name": "sebastian/exporter", @@ -1540,7 +1285,7 @@ "export", "exporter" ], - "time": "2016-06-17T09:04:28+00:00" + "time": "2016-06-17 09:04:28" }, { "name": "sebastian/global-state", @@ -1591,20 +1336,20 @@ "keywords": [ "global state" ], - "time": "2015-10-12T03:26:01+00:00" + "time": "2015-10-12 03:26:01" }, { "name": "sebastian/recursion-context", - "version": "1.0.5", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7" + "reference": "913401df809e99e4f47b27cdd781f4a258d58791" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7", - "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791", + "reference": "913401df809e99e4f47b27cdd781f4a258d58791", "shasum": "" }, "require": { @@ -1644,7 +1389,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2016-10-03T07:41:43+00:00" + "time": "2015-11-11 19:50:13" }, { "name": "sebastian/version", @@ -1679,36 +1424,25 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2015-06-21T13:59:46+00:00" + "time": "2015-06-21 13:59:46" }, { "name": "symfony/config", - "version": "v3.4.40", + "version": "v3.1.3", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "3634991bea549e73c45a964c38f30ceeae6ed877" + "reference": "a7630397b91be09cdd2fe57fd13612e258700598" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/3634991bea549e73c45a964c38f30ceeae6ed877", - "reference": "3634991bea549e73c45a964c38f30ceeae6ed877", + "url": "https://api.github.com/repos/symfony/config/zipball/a7630397b91be09cdd2fe57fd13612e258700598", + "reference": "a7630397b91be09cdd2fe57fd13612e258700598", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/filesystem": "~2.8|~3.0|~4.0", - "symfony/polyfill-ctype": "~1.8" - }, - "conflict": { - "symfony/dependency-injection": "<3.3", - "symfony/finder": "<3.3" - }, - "require-dev": { - "symfony/dependency-injection": "~3.3|~4.0", - "symfony/event-dispatcher": "~3.3|~4.0", - "symfony/finder": "~3.3|~4.0", - "symfony/yaml": "~3.0|~4.0" + "php": ">=5.5.9", + "symfony/filesystem": "~2.8|~3.0" }, "suggest": { "symfony/yaml": "To use the yaml reference dumper" @@ -1716,7 +1450,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -1743,52 +1477,40 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2020-04-12T14:33:46+00:00" + "time": "2016-07-26 08:04:17" }, { "name": "symfony/console", - "version": "v3.4.40", + "version": "v3.1.3", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "bf60d5e606cd595391c5f82bf6b570d9573fa120" + "reference": "f9e638e8149e9e41b570ff092f8007c477ef0ce5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/bf60d5e606cd595391c5f82bf6b570d9573fa120", - "reference": "bf60d5e606cd595391c5f82bf6b570d9573fa120", + "url": "https://api.github.com/repos/symfony/console/zipball/f9e638e8149e9e41b570ff092f8007c477ef0ce5", + "reference": "f9e638e8149e9e41b570ff092f8007c477ef0ce5", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/debug": "~2.8|~3.0|~4.0", + "php": ">=5.5.9", "symfony/polyfill-mbstring": "~1.0" }, - "conflict": { - "symfony/dependency-injection": "<3.4", - "symfony/process": "<3.3" - }, - "provide": { - "psr/log-implementation": "1.0" - }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~3.3|~4.0", - "symfony/dependency-injection": "~3.4|~4.0", - "symfony/event-dispatcher": "~2.8|~3.0|~4.0", - "symfony/lock": "~3.4|~4.0", - "symfony/process": "~3.3|~4.0" + "symfony/event-dispatcher": "~2.8|~3.0", + "symfony/process": "~2.8|~3.0" }, "suggest": { "psr/log": "For using the console logger", "symfony/event-dispatcher": "", - "symfony/lock": "", "symfony/process": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -1815,76 +1537,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2020-03-27T17:07:22+00:00" - }, - { - "name": "symfony/debug", - "version": "v4.4.8", - "source": { - "type": "git", - "url": "https://github.com/symfony/debug.git", - "reference": "346636d2cae417992ecfd761979b2ab98b339a45" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/346636d2cae417992ecfd761979b2ab98b339a45", - "reference": "346636d2cae417992ecfd761979b2ab98b339a45", - "shasum": "" - }, - "require": { - "php": "^7.1.3", - "psr/log": "~1.0" - }, - "conflict": { - "symfony/http-kernel": "<3.4" - }, - "require-dev": { - "symfony/http-kernel": "^3.4|^4.0|^5.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Debug\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Debug Component", - "homepage": "https://symfony.com", - "time": "2020-03-27T16:54:36+00:00" + "time": "2016-07-26 08:04:17" }, { "name": "symfony/event-dispatcher", - "version": "v2.8.52", + "version": "v2.8.9", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "a77e974a5fecb4398833b0709210e3d5e334ffb0" + "reference": "889983a79a043dfda68f38c38b6dba092dd49cd8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a77e974a5fecb4398833b0709210e3d5e334ffb0", - "reference": "a77e974a5fecb4398833b0709210e3d5e334ffb0", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/889983a79a043dfda68f38c38b6dba092dd49cd8", + "reference": "889983a79a043dfda68f38c38b6dba092dd49cd8", "shasum": "" }, "require": { @@ -1892,7 +1558,7 @@ }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "^2.0.5|~3.0.0", + "symfony/config": "~2.0,>=2.0.5|~3.0.0", "symfony/dependency-injection": "~2.6|~3.0.0", "symfony/expression-language": "~2.6|~3.0.0", "symfony/stopwatch": "~2.3|~3.0.0" @@ -1931,30 +1597,29 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2018-11-21T14:20:20+00:00" + "time": "2016-07-28 16:56:28" }, { "name": "symfony/filesystem", - "version": "v4.4.8", + "version": "v3.1.3", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "a3ebf3bfd8a98a147c010a568add5a8aa4edea0f" + "reference": "bb29adceb552d202b6416ede373529338136e84f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/a3ebf3bfd8a98a147c010a568add5a8aa4edea0f", - "reference": "a3ebf3bfd8a98a147c010a568add5a8aa4edea0f", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/bb29adceb552d202b6416ede373529338136e84f", + "reference": "bb29adceb552d202b6416ede373529338136e84f", "shasum": "" }, "require": { - "php": "^7.1.3", - "symfony/polyfill-ctype": "~1.8" + "php": ">=5.5.9" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.4-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -1981,37 +1646,37 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2020-04-12T14:39:55+00:00" + "time": "2016-07-20 05:44:26" }, { - "name": "symfony/polyfill-ctype", - "version": "v1.17.0", + "name": "symfony/polyfill-mbstring", + "version": "v1.2.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "e94c8b1bbe2bc77507a1056cdb06451c75b427f9" + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "dff51f72b0706335131b00a7f49606168c582594" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e94c8b1bbe2bc77507a1056cdb06451c75b427f9", - "reference": "e94c8b1bbe2bc77507a1056cdb06451c75b427f9", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/dff51f72b0706335131b00a7f49606168c582594", + "reference": "dff51f72b0706335131b00a7f49606168c582594", "shasum": "" }, "require": { "php": ">=5.3.3" }, "suggest": { - "ext-ctype": "For best performance" + "ext-mbstring": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.17-dev" + "dev-master": "1.2-dev" } }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" + "Symfony\\Polyfill\\Mbstring\\": "" }, "files": [ "bootstrap.php" @@ -2023,45 +1688,46 @@ ], "authors": [ { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for ctype functions", + "description": "Symfony polyfill for the Mbstring extension", "homepage": "https://symfony.com", "keywords": [ "compatibility", - "ctype", + "mbstring", "polyfill", - "portable" + "portable", + "shim" ], - "time": "2020-05-12T16:14:59+00:00" + "time": "2016-05-18 14:26:46" }, { "name": "symfony/stopwatch", - "version": "v3.4.40", + "version": "v3.1.3", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "a7a98f40dcc382a332c3729a6d04b298ffbb8f1f" + "reference": "bb42806b12c5f89db4ebf64af6741afe6d8457e1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/a7a98f40dcc382a332c3729a6d04b298ffbb8f1f", - "reference": "a7a98f40dcc382a332c3729a6d04b298ffbb8f1f", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/bb42806b12c5f89db4ebf64af6741afe6d8457e1", + "reference": "bb42806b12c5f89db4ebf64af6741afe6d8457e1", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": ">=5.5.9" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -2088,39 +1754,29 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2020-03-15T09:38:08+00:00" + "time": "2016-06-29 05:41:56" }, { "name": "symfony/yaml", - "version": "v3.4.40", + "version": "v3.1.3", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "8fef49ac1357f4e05c997a1f139467ccb186bffa" + "reference": "1819adf2066880c7967df7180f4f662b6f0567ac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/8fef49ac1357f4e05c997a1f139467ccb186bffa", - "reference": "8fef49ac1357f4e05c997a1f139467ccb186bffa", + "url": "https://api.github.com/repos/symfony/yaml/zipball/1819adf2066880c7967df7180f4f662b6f0567ac", + "reference": "1819adf2066880c7967df7180f4f662b6f0567ac", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/polyfill-ctype": "~1.8" - }, - "conflict": { - "symfony/console": "<3.4" - }, - "require-dev": { - "symfony/console": "~3.4|~4.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" + "php": ">=5.5.9" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -2147,33 +1803,34 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2020-04-24T10:16:04+00:00" + "time": "2016-07-17 14:02:08" }, { "name": "webmozart/assert", - "version": "1.8.0", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6" + "reference": "30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/ab2cb0b3b559010b75981b1bdce728da3ee90ad6", - "reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6", + "url": "https://api.github.com/repos/webmozart/assert/zipball/30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde", + "reference": "30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0", - "symfony/polyfill-ctype": "^1.8" - }, - "conflict": { - "vimeo/psalm": "<3.9.1" + "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^7.5.13" + "phpunit/phpunit": "^4.6" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, "autoload": { "psr-4": { "Webmozart\\Assert\\": "src/" @@ -2195,7 +1852,7 @@ "check", "validate" ], - "time": "2020-04-18T12:12:48+00:00" + "time": "2015-08-24 13:29:44" } ], "aliases": [], From 272b34c9d65258511d4ba9977368e70828aabfc9 Mon Sep 17 00:00:00 2001 From: George Borges Date: Thu, 24 Sep 2020 18:05:29 +1000 Subject: [PATCH 06/13] refactor: move duplicated code to private method --- src/Network/HttpClient.php | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/Network/HttpClient.php b/src/Network/HttpClient.php index 40fb888..e3f7d82 100644 --- a/src/Network/HttpClient.php +++ b/src/Network/HttpClient.php @@ -94,20 +94,7 @@ public function post($url, array $options = []) ['User-Agent' => self::PHP_GA_MEASUREMENT_PROTOCOL_USER_AGENT] ); - $opts = $this->parseOptions($options); - $response = $this->getClient()->sendAsync($request, [ - 'synchronous' => !$opts['async'], - 'timeout' => $opts['timeout'], - 'connect_timeout' => $opts['timeout'], - ]); - - if ($opts['async']) { - self::$promises[] = $response; - } else { - $response = $response->wait(); - } - - return $this->getAnalyticsResponse($request, $response); + return $this->sendRequest($request, $options); } /** @@ -130,6 +117,11 @@ public function batch($url, array $batchUrls, array $options = []) $body ); + return $this->sendRequest($request, $options); + } + + private function sendRequest(Request $request, array $options = []) + { $opts = $this->parseOptions($options); $response = $this->getClient()->sendAsync($request, [ 'synchronous' => !$opts['async'], From b05b07b803c32eb15200c988b127ecc03415a969 Mon Sep 17 00:00:00 2001 From: George Borges Date: Thu, 24 Sep 2020 18:09:33 +1000 Subject: [PATCH 07/13] refactor: user class at the top of file --- src/Analytics.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/Analytics.php b/src/Analytics.php index 6479412..4ab6e37 100644 --- a/src/Analytics.php +++ b/src/Analytics.php @@ -2,12 +2,13 @@ namespace TheIconic\Tracking\GoogleAnalytics; -use TheIconic\Tracking\GoogleAnalytics\Parameters\SingleParameter; -use TheIconic\Tracking\GoogleAnalytics\Parameters\CompoundParameterCollection; +use BadMethodCallException; +use TheIconic\Tracking\GoogleAnalytics\Exception\EnqueueUrlsOverflowException; +use TheIconic\Tracking\GoogleAnalytics\Exception\InvalidPayloadDataException; use TheIconic\Tracking\GoogleAnalytics\Network\HttpClient; use TheIconic\Tracking\GoogleAnalytics\Network\PrepareUrl; -use TheIconic\Tracking\GoogleAnalytics\Exception\InvalidPayloadDataException; -use TheIconic\Tracking\GoogleAnalytics\Exception\EnqueueUrlsOverflowException; +use TheIconic\Tracking\GoogleAnalytics\Parameters\CompoundParameterCollection; +use TheIconic\Tracking\GoogleAnalytics\Parameters\SingleParameter; /** * Class Analytics @@ -765,14 +766,14 @@ protected function setParameterActionTo($parameter, $action) * @param $constant * @param $exceptionMsg * @return mixed - * @throws \BadMethodCallException + * @throws BadMethodCallException */ protected function getParameterClassConstant($constant, $exceptionMsg) { if (defined($constant)) { return constant($constant); } else { - throw new \BadMethodCallException($exceptionMsg); + throw new BadMethodCallException($exceptionMsg); } } @@ -921,12 +922,12 @@ protected function getIndexFromArguments($methodArguments) * @param $parameterClass * @param $methodName * @return string - * @throws \BadMethodCallException + * @throws BadMethodCallException */ protected function getFullParameterClass($parameterClass, $methodName) { if (empty($this->availableParameters[$parameterClass])) { - throw new \BadMethodCallException('Method ' . $methodName . ' not defined for Analytics class'); + throw new BadMethodCallException('Method ' . $methodName . ' not defined for Analytics class'); } else { return '\\TheIconic\\Tracking\\GoogleAnalytics\\Parameters\\' . $this->availableParameters[$parameterClass]; } @@ -948,7 +949,7 @@ public function emptyQueue() * @param $methodName * @param array $methodArguments * @return mixed - * @throws \BadMethodCallException + * @throws BadMethodCallException */ public function __call($methodName, array $methodArguments) { @@ -979,7 +980,7 @@ public function __call($methodName, array $methodArguments) return $this->getParameter($methodName, $methodArguments); } - throw new \BadMethodCallException('Method ' . $methodName . ' not defined for Analytics class'); + throw new BadMethodCallException('Method ' . $methodName . ' not defined for Analytics class'); } /** From 2e54fda4d3009b4c91a9dbab6024761a25341258 Mon Sep 17 00:00:00 2001 From: George Borges Date: Thu, 24 Sep 2020 18:13:23 +1000 Subject: [PATCH 08/13] refactor: remove redundant else --- src/Analytics.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Analytics.php b/src/Analytics.php index 4ab6e37..ab0af3d 100644 --- a/src/Analytics.php +++ b/src/Analytics.php @@ -928,9 +928,9 @@ protected function getFullParameterClass($parameterClass, $methodName) { if (empty($this->availableParameters[$parameterClass])) { throw new BadMethodCallException('Method ' . $methodName . ' not defined for Analytics class'); - } else { - return '\\TheIconic\\Tracking\\GoogleAnalytics\\Parameters\\' . $this->availableParameters[$parameterClass]; } + + return '\\TheIconic\\Tracking\\GoogleAnalytics\\Parameters\\' . $this->availableParameters[$parameterClass]; } /** From 3ed184b82bf8eff92a1de4ae8d6abc92559c6824 Mon Sep 17 00:00:00 2001 From: George Borges Date: Thu, 24 Sep 2020 18:16:04 +1000 Subject: [PATCH 09/13] refactor: create parameter index first --- src/Analytics.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Analytics.php b/src/Analytics.php index ab0af3d..7719b70 100644 --- a/src/Analytics.php +++ b/src/Analytics.php @@ -835,8 +835,9 @@ protected function addItem($methodName, array $methodArguments) $collectionIndex = $this->getIndexFromArguments($methodArguments); - if (isset($this->compoundParametersCollections[$parameterClass . $collectionIndex])) { - $this->compoundParametersCollections[$parameterClass . $collectionIndex]->add($parameterObject); + $parameterIndex = $parameterClass . $collectionIndex; + if (isset($this->compoundParametersCollections[$parameterIndex])) { + $this->compoundParametersCollections[$parameterIndex]->add($parameterObject); } else { $fullParameterCollectionClass = $fullParameterClass . 'Collection'; @@ -845,7 +846,7 @@ protected function addItem($methodName, array $methodArguments) $parameterObjectCollection->add($parameterObject); - $this->compoundParametersCollections[$parameterClass . $collectionIndex] = $parameterObjectCollection; + $this->compoundParametersCollections[$parameterIndex] = $parameterObjectCollection; } return $this; From 0e5e7e4918b4698ac3d7e0647f158dd438d0ec15 Mon Sep 17 00:00:00 2001 From: George Borges Date: Thu, 24 Sep 2020 18:23:44 +1000 Subject: [PATCH 10/13] test: add unit tests for EnqueueUrlsOverflowException --- .../GoogleAnalytics/AnalyticsTest.php | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/tests/TheIconic/Tracking/GoogleAnalytics/AnalyticsTest.php b/tests/TheIconic/Tracking/GoogleAnalytics/AnalyticsTest.php index 57b6531..4f088e2 100644 --- a/tests/TheIconic/Tracking/GoogleAnalytics/AnalyticsTest.php +++ b/tests/TheIconic/Tracking/GoogleAnalytics/AnalyticsTest.php @@ -325,6 +325,41 @@ public function testSendBatchHits() $this->analytics->sendEnqueuedHits(); } + /** + * @expectedException \TheIconic\Tracking\GoogleAnalytics\Exception\EnqueueUrlsOverflowException + */ + public function testEnqueueOverflowException() + { + $this->analytics + ->setDebug(true) + ->setProtocolVersion('1') + ->setTrackingId('555') + ->setClientId('666') + ->setDocumentPath('\mypage') + ->enqueuePageview() + ->setDocumentPath('\mypage2') + ->enqueuePageview() + ->enqueuePageview() + ->enqueuePageview() + ->enqueuePageview() + ->enqueuePageview() + ->enqueuePageview() + ->enqueuePageview() + ->enqueuePageview() + ->enqueuePageview() + ->enqueuePageview() + ->enqueuePageview() + ->enqueuePageview() + ->enqueuePageview() + ->enqueuePageview() + ->enqueuePageview() + ->enqueuePageview() + ->enqueuePageview() + ->enqueuePageview() + ->enqueuePageview() + ->enqueuePageview(); + } + public function testFixTypos() { $httpClient = $this->getMock('TheIconic\Tracking\GoogleAnalytics\Network\HttpClient', ['post']); From ccdbb95d32f14f199d58a4cbf93dd71fc53135c9 Mon Sep 17 00:00:00 2001 From: George Borges Date: Thu, 24 Sep 2020 18:35:03 +1000 Subject: [PATCH 11/13] test: add unit test for empty queue batch hits --- src/Analytics.php | 4 +- .../GoogleAnalytics/AnalyticsTest.php | 51 +++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/src/Analytics.php b/src/Analytics.php index 7719b70..f52488f 100644 --- a/src/Analytics.php +++ b/src/Analytics.php @@ -937,11 +937,13 @@ protected function getFullParameterClass($parameterClass, $methodName) /** * Empty batch queue * - * @return void + * @return $this */ public function emptyQueue() { $this->enqueuedUrls = []; + + return $this; } /** diff --git a/tests/TheIconic/Tracking/GoogleAnalytics/AnalyticsTest.php b/tests/TheIconic/Tracking/GoogleAnalytics/AnalyticsTest.php index 4f088e2..a6cd68c 100644 --- a/tests/TheIconic/Tracking/GoogleAnalytics/AnalyticsTest.php +++ b/tests/TheIconic/Tracking/GoogleAnalytics/AnalyticsTest.php @@ -360,6 +360,57 @@ public function testEnqueueOverflowException() ->enqueuePageview(); } + public function testEmptyBatchHits() + { + $httpClient = $this->getMock('TheIconic\Tracking\GoogleAnalytics\Network\HttpClient', ['batch']); + + $this->analytics + ->setDebug(true) + ->setProtocolVersion('1') + ->setTrackingId('555') + ->setClientId('666') + ->setDocumentPath('\mypage') + ->enqueuePageview() + ->setDocumentPath('\mypage2') + ->enqueuePageview() + ->enqueuePageview() + ->enqueuePageview() + ->enqueuePageview() + ->enqueuePageview() + ->enqueuePageview() + ->enqueuePageview() + ->enqueuePageview() + ->enqueuePageview() + ->enqueuePageview() + ->enqueuePageview() + ->enqueuePageview() + ->enqueuePageview() + ->enqueuePageview() + ->enqueuePageview() + ->enqueuePageview() + ->enqueuePageview() + ->enqueuePageview() + ->emptyQueue() + ->setDocumentPath('\mypage') + ->enqueuePageview() + ->setDocumentPath('\mypage2') + ->enqueuePageview(); + + $httpClient->expects($this->once()) + ->method('batch') + ->with( + 'http://www.google-analytics.com/batch', + [ + 'v=1&tid=555&cid=666&dp=%5Cmypage&t=pageview', + 'v=1&tid=555&cid=666&dp=%5Cmypage2&t=pageview' + ] + ); + + $this->analytics->setHttpClient($httpClient); + + $this->analytics->sendEnqueuedHits(); + } + public function testFixTypos() { $httpClient = $this->getMock('TheIconic\Tracking\GoogleAnalytics\Network\HttpClient', ['post']); From a6ebe08a1d61ad67da6834b350468c809f8e8603 Mon Sep 17 00:00:00 2001 From: George Borges Date: Thu, 24 Sep 2020 18:51:32 +1000 Subject: [PATCH 12/13] feat: empty queue after sending a batch hit --- src/Analytics.php | 6 ++- .../GoogleAnalytics/AnalyticsTest.php | 50 +++++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) diff --git a/src/Analytics.php b/src/Analytics.php index f52488f..cb55af2 100644 --- a/src/Analytics.php +++ b/src/Analytics.php @@ -667,7 +667,11 @@ public function sendEnqueuedHits() return new NullAnalyticsResponse(); } - return $this->getHttpClient()->batch($this->getBatchEndpoint(), $this->enqueuedUrls, $this->getHttpClientOptions()); + $response = $this->getHttpClient()->batch($this->getBatchEndpoint(), $this->enqueuedUrls, $this->getHttpClientOptions()); + + $this->emptyQueue(); + + return $response; } /** diff --git a/tests/TheIconic/Tracking/GoogleAnalytics/AnalyticsTest.php b/tests/TheIconic/Tracking/GoogleAnalytics/AnalyticsTest.php index a6cd68c..3bcdd8e 100644 --- a/tests/TheIconic/Tracking/GoogleAnalytics/AnalyticsTest.php +++ b/tests/TheIconic/Tracking/GoogleAnalytics/AnalyticsTest.php @@ -325,6 +325,56 @@ public function testSendBatchHits() $this->analytics->sendEnqueuedHits(); } + public function testSendBatchHitsAfterEmpty() + { + $httpClient = $this->getMock('TheIconic\Tracking\GoogleAnalytics\Network\HttpClient', ['batch']); + + $httpClient->expects($this->exactly(2)) + ->method('batch') + ->withConsecutive( + [ + 'http://www.google-analytics.com/batch', + [ + 'v=1&tid=555&cid=666&dp=%5Cmypage&t=pageview', + 'v=1&tid=555&cid=666&dp=%5Cmypage2&t=pageview' + ], + ], + [ + 'http://www.google-analytics.com/batch', + [ + 'v=1&tid=555&cid=666&dp=%5Cmypage&t=pageview', + 'v=1&tid=555&cid=666&dp=%5Cmypage2&t=pageview', + 'v=1&tid=555&cid=666&dp=%5Cmypage2&t=pageview', + ] + ] + ); + + $this->analytics->setHttpClient($httpClient); + + $this->analytics + ->setDebug(true) + ->setProtocolVersion('1') + ->setTrackingId('555') + ->setClientId('666') + ->setDocumentPath('\mypage') + ->enqueuePageview() + ->setDocumentPath('\mypage2') + ->enqueuePageview(); + $this->analytics->sendEnqueuedHits(); + + $this->analytics + ->setDebug(true) + ->setProtocolVersion('1') + ->setTrackingId('555') + ->setClientId('666') + ->setDocumentPath('\mypage') + ->enqueuePageview() + ->setDocumentPath('\mypage2') + ->enqueuePageview() + ->enqueuePageview(); + $this->analytics->sendEnqueuedHits(); + } + /** * @expectedException \TheIconic\Tracking\GoogleAnalytics\Exception\EnqueueUrlsOverflowException */ From af8bdc5631abaefa90de6c8c05b8eb0c520ebfae Mon Sep 17 00:00:00 2001 From: George Borges Date: Thu, 24 Sep 2020 19:26:04 +1000 Subject: [PATCH 13/13] docs: add batch hit documentation to README --- README.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/README.md b/README.md index 2933673..99605fd 100644 --- a/README.md +++ b/README.md @@ -197,6 +197,58 @@ $analytics->setEventCategory('Checkout') ->sendEvent(); ``` +### Batch Hits + +GA has an endpoint that you can hit to register multiple hits at once, with a limit of 20 hits. Hits to be send can be placed in a queue as you build up the Analytics object. + +Here's an example that sends two hits, and then empties the queue. + +```php +$analytics = new Analytics(false, false); + +$analytics + ->setProtocolVersion('1') + ->setTrackingId('UA-xxxxxx-x') + ->setClientId('xxxxxx.xxxxxx'); + +foreach(range(0, 19) as $i) { + $analytics = $analytics + ->setDocumentPath("/mypage$i") + ->enqueuePageview(); //enqueue url without pushing +} + +$analytics->sendEnqueuedHits(); //push 20 pageviews in a single request and empties the queue +``` + +The queue is emptied when the hits are sent, but it can also be empty manually with `emptyQueue` method. + +```php +$analytics = new Analytics(false, false); + +$analytics + ->setProtocolVersion('1') + ->setTrackingId('UA-xxxxxx-x') + ->setClientId('xxxxxx.xxxxxx'); + +foreach(range(0, 5) as $i) { + $analytics = $analytics + ->setDocumentPath("/mypage$i") + ->enqueuePageview(); //enqueue url without pushing +} + +$analytics->emptyQueue(); // empty queue, allows to enqueue 20 hits again + +foreach(range(1, 20) as $i) { + $analytics = $analytics + ->setDocumentPath("/mypage$i") + ->enqueuePageview(); //enqueue url without pushing +} + +$analytics->sendEnqueuedHits(); //push 20 pageviews in a single request and empties the queue +``` + +If more than 20 hits are attempted to be enqueue, the library will throw a `EnqueueUrlsOverflowException`. + ### Validating Hits From Google Developer Guide: