diff --git a/.circleci/config.yml b/.circleci/config.yml index 159bc0e79..af78ad3e9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -14,6 +14,9 @@ workflows: php-docker-template: &php-docker-template steps: - checkout + - run: + name: validate composer.json + command: composer validate - run: name: install current dependencies command: composer install --no-progress @@ -67,8 +70,14 @@ jobs: sudo php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer - checkout - run: - name: update dependencies # the dependencies in composer.lock don't work with 5.5 - command: composer update --no-progress + name: validate composer.json + command: composer validate + - run: + name: install current dependencies + command: composer install --no-progress + - run: + name: run php-cs-fixer + command: vendor/bin/php-cs-fixer fix --diff --dry-run --verbose - run: name: run tests command: vendor/bin/phpunit --log-junit ~/phpunit/junit.xml --coverage-text tests diff --git a/.gitignore b/.gitignore index f69e4693c..9d330805f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ /doc/ *.iml composer.phar +.php_cs.cache .vagrant integration-tests/vendor composer.lock diff --git a/.php_cs b/.php_cs new file mode 100644 index 000000000..b726c0d80 --- /dev/null +++ b/.php_cs @@ -0,0 +1,10 @@ +in(__DIR__); + +return PhpCsFixer\Config::create() + ->setFinder($finder) + ->setUsingCache(true) + ->setRules([ + '@PSR2' => true, + ]); diff --git a/composer.json b/composer.json index 78d0c36ae..ea8ef4cbf 100644 --- a/composer.json +++ b/composer.json @@ -19,6 +19,7 @@ "psr/log": "^1.0" }, "require-dev": { + "friendsofphp/php-cs-fixer": "~2.2.19", "guzzlehttp/guzzle": "^6.2.1", "kevinrob/guzzle-cache-middleware": "^1.4.1", "phpdocumentor/phpdocumentor": "^2.0", @@ -43,5 +44,8 @@ }, "config": { "sort-packages": true + }, + "scripts": { + "cs": "vendor/bin/php-cs-fixer fix --diff --verbose" } } diff --git a/composer.lock b/composer.lock index 89835076d..d7eb9bb67 100644 --- a/composer.lock +++ b/composer.lock @@ -1,10 +1,10 @@ { "_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" ], - "content-hash": "ad2c6c29c2c748655900711de6dba807", + "content-hash": "b7b9d1818e9117bf34ae546c08c5593e", "packages": [ { "name": "monolog/monolog", @@ -251,6 +251,68 @@ ], "time": "2012-12-19T10:50:58+00:00" }, + { + "name": "composer/semver", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/c7cb9a2095a074d131b65a8a0cd294479d785573", + "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.5 || ^5.0.5", + "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "time": "2016-08-30T16:08:34+00:00" + }, { "name": "container-interop/container-interop", "version": "1.2.0", @@ -284,35 +346,35 @@ }, { "name": "doctrine/annotations", - "version": "v1.4.0", + "version": "v1.2.7", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "54cacc9b81758b14e3ce750f205a393d52339e97" + "reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/54cacc9b81758b14e3ce750f205a393d52339e97", - "reference": "54cacc9b81758b14e3ce750f205a393d52339e97", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/f25c8aab83e0c3e976fd7d19875f198ccf2f7535", + "reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535", "shasum": "" }, "require": { "doctrine/lexer": "1.*", - "php": "^5.6 || ^7.0" + "php": ">=5.3.2" }, "require-dev": { "doctrine/cache": "1.*", - "phpunit/phpunit": "^5.7" + "phpunit/phpunit": "4.*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { - "psr-4": { - "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" + "psr-0": { + "Doctrine\\Common\\Annotations\\": "lib/" } }, "notification-url": "https://packagist.org/downloads/", @@ -348,7 +410,7 @@ "docblock", "parser" ], - "time": "2017-02-24T16:22:25+00:00" + "time": "2015-08-31T12:32:49+00:00" }, { "name": "doctrine/instantiator", @@ -460,19 +522,20 @@ }, { "name": "erusev/parsedown", - "version": "1.6.4", + "version": "1.7.1", "source": { "type": "git", "url": "https://github.com/erusev/parsedown.git", - "reference": "fbe3fe878f4fe69048bb8a52783a09802004f548" + "reference": "92e9c27ba0e74b8b028b111d1b6f956a15c01fc1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/erusev/parsedown/zipball/fbe3fe878f4fe69048bb8a52783a09802004f548", - "reference": "fbe3fe878f4fe69048bb8a52783a09802004f548", + "url": "https://api.github.com/repos/erusev/parsedown/zipball/92e9c27ba0e74b8b028b111d1b6f956a15c01fc1", + "reference": "92e9c27ba0e74b8b028b111d1b6f956a15c01fc1", "shasum": "" }, "require": { + "ext-mbstring": "*", "php": ">=5.3.0" }, "require-dev": { @@ -501,20 +564,106 @@ "markdown", "parser" ], - "time": "2017-11-14T20:44:03+00:00" + "time": "2018-03-08T01:11:30+00:00" + }, + { + "name": "friendsofphp/php-cs-fixer", + "version": "v2.2.19", + "source": { + "type": "git", + "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", + "reference": "2de0ac9c1d0d48a9b969814f43698223c6e03d6d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/2de0ac9c1d0d48a9b969814f43698223c6e03d6d", + "reference": "2de0ac9c1d0d48a9b969814f43698223c6e03d6d", + "shasum": "" + }, + "require": { + "composer/semver": "^1.4", + "doctrine/annotations": "^1.2", + "ext-json": "*", + "ext-tokenizer": "*", + "php": "^5.3.6 || >=7.0 <7.3", + "sebastian/diff": "^1.4", + "symfony/console": "^2.4 || ^3.0 || ^4.0", + "symfony/event-dispatcher": "^2.1 || ^3.0 || ^4.0", + "symfony/filesystem": "^2.4 || ^3.0 || ^4.0", + "symfony/finder": "^2.2 || ^3.0 || ^4.0", + "symfony/options-resolver": "^2.6 || ^3.0 || ^4.0", + "symfony/polyfill-php54": "^1.0", + "symfony/polyfill-php55": "^1.3", + "symfony/polyfill-php70": "^1.0", + "symfony/polyfill-php72": "^1.4", + "symfony/process": "^2.3 || ^3.0 || ^4.0", + "symfony/stopwatch": "^2.5 || ^3.0 || ^4.0" + }, + "conflict": { + "hhvm": "<3.18" + }, + "require-dev": { + "johnkary/phpunit-speedtrap": "^1.0.1 || ^2.0 || ^3.0", + "justinrainbow/json-schema": "^5.0", + "keradus/cli-executor": "^1.0", + "mikey179/vfsstream": "^1.6", + "php-coveralls/php-coveralls": "^1.0.2", + "phpunit/phpunit": "^4.8.35 || ^5.4.3", + "symfony/phpunit-bridge": "^3.2.2 || ^4.0" + }, + "suggest": { + "ext-mbstring": "For handling non-UTF8 characters in cache signature.", + "symfony/polyfill-mbstring": "When enabling `ext-mbstring` is not possible." + }, + "bin": [ + "php-cs-fixer" + ], + "type": "application", + "autoload": { + "psr-4": { + "PhpCsFixer\\": "src/" + }, + "classmap": [ + "tests/Test/AbstractFixerTestCase.php", + "tests/Test/AbstractIntegrationCaseFactory.php", + "tests/Test/AbstractIntegrationTestCase.php", + "tests/Test/Constraint/SameStringsConstraint.php", + "tests/Test/IntegrationCase.php", + "tests/Test/IntegrationCaseFactory.php", + "tests/Test/IntegrationCaseFactoryInterface.php", + "tests/Test/InternalIntegrationCaseFactory.php", + "tests/TestCase.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Dariusz RumiƄski", + "email": "dariusz.ruminski@gmail.com" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "A tool to automatically fix PHP code style", + "time": "2018-03-20T18:04:00+00:00" }, { "name": "guzzlehttp/guzzle", - "version": "6.3.0", + "version": "6.3.3", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699" + "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f4db5a78a5ea468d4831de7f0bf9d9415e348699", - "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba", + "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba", "shasum": "" }, "require": { @@ -524,7 +673,7 @@ }, "require-dev": { "ext-curl": "*", - "phpunit/phpunit": "^4.0 || ^5.0", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", "psr/log": "^1.0" }, "suggest": { @@ -533,7 +682,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "6.2-dev" + "dev-master": "6.3-dev" } }, "autoload": { @@ -566,7 +715,7 @@ "rest", "web service" ], - "time": "2017-06-22T18:50:49+00:00" + "time": "2018-04-22T15:46:56+00:00" }, { "name": "guzzlehttp/promises", @@ -803,6 +952,48 @@ "abandoned": true, "time": "2013-10-30T17:23:01+00:00" }, + { + "name": "ircmaxell/password-compat", + "version": "v1.0.4", + "source": { + "type": "git", + "url": "https://github.com/ircmaxell/password_compat.git", + "reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ircmaxell/password_compat/zipball/5c5cde8822a69545767f7c7f3058cb15ff84614c", + "reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c", + "shasum": "" + }, + "require-dev": { + "phpunit/phpunit": "4.*" + }, + "type": "library", + "autoload": { + "files": [ + "lib/password.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Anthony Ferrara", + "email": "ircmaxell@php.net", + "homepage": "http://blog.ircmaxell.com" + } + ], + "description": "A compatibility library for the proposed simplified password hashing algorithm: https://wiki.php.net/rfc/password_hash", + "homepage": "https://github.com/ircmaxell/password_compat", + "keywords": [ + "hashing", + "password" + ], + "time": "2014-11-20T16:49:30+00:00" + }, { "name": "jms/metadata", "version": "1.6.0", @@ -891,16 +1082,16 @@ }, { "name": "jms/serializer", - "version": "1.10.0", + "version": "1.11.0", "source": { "type": "git", "url": "https://github.com/schmittjoh/serializer.git", - "reference": "62c7ff6d61f8692eac8be024c542b3d9d0ab8c8a" + "reference": "e7c53477ff55c21d1b1db7d062edc050a24f465f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/serializer/zipball/62c7ff6d61f8692eac8be024c542b3d9d0ab8c8a", - "reference": "62c7ff6d61f8692eac8be024c542b3d9d0ab8c8a", + "url": "https://api.github.com/repos/schmittjoh/serializer/zipball/e7c53477ff55c21d1b1db7d062edc050a24f465f", + "reference": "e7c53477ff55c21d1b1db7d062edc050a24f465f", "shasum": "" }, "require": { @@ -908,12 +1099,11 @@ "doctrine/instantiator": "^1.0.3", "jms/metadata": "~1.1", "jms/parser-lib": "1.*", - "php": ">=5.5.0", + "php": "^5.5|^7.0", "phpcollection/phpcollection": "~0.1", "phpoption/phpoption": "^1.1" }, "conflict": { - "jms/serializer-bundle": "<1.2.1", "twig/twig": "<1.12" }, "require-dev": { @@ -941,7 +1131,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.10-dev" + "dev-master": "1.11-dev" } }, "autoload": { @@ -972,7 +1162,7 @@ "serialization", "xml" ], - "time": "2017-11-30T18:23:40+00:00" + "time": "2018-02-04T17:48:54+00:00" }, { "name": "justinrainbow/json-schema", @@ -1162,94 +1352,97 @@ "time": "2012-08-16T17:13:03+00:00" }, { - "name": "myclabs/deep-copy", - "version": "1.7.0", + "name": "nikic/php-parser", + "version": "v1.4.1", "source": { "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "f78af2c9c86107aa1a34cd1dbb5bbe9eeb0d9f51" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/f78af2c9c86107aa1a34cd1dbb5bbe9eeb0d9f51", + "reference": "f78af2c9c86107aa1a34cd1dbb5bbe9eeb0d9f51", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^4.1" + "ext-tokenizer": "*", + "php": ">=5.3" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, "autoload": { - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - }, "files": [ - "src/DeepCopy/deep_copy.php" + "lib/bootstrap.php" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } ], - "description": "Create deep copies (clones) of your objects", + "description": "A PHP parser written in PHP", "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" + "parser", + "php" ], - "time": "2017-10-19T19:58:43+00:00" + "time": "2015-09-19T14:15:08+00:00" }, { - "name": "nikic/php-parser", - "version": "v1.4.1", + "name": "paragonie/random_compat", + "version": "v2.0.12", "source": { "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "f78af2c9c86107aa1a34cd1dbb5bbe9eeb0d9f51" + "url": "https://github.com/paragonie/random_compat.git", + "reference": "258c89a6b97de7dfaf5b8c7607d0478e236b04fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/f78af2c9c86107aa1a34cd1dbb5bbe9eeb0d9f51", - "reference": "f78af2c9c86107aa1a34cd1dbb5bbe9eeb0d9f51", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/258c89a6b97de7dfaf5b8c7607d0478e236b04fb", + "reference": "258c89a6b97de7dfaf5b8c7607d0478e236b04fb", "shasum": "" }, "require": { - "ext-tokenizer": "*", - "php": ">=5.3" + "php": ">=5.2.0" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } + "require-dev": { + "phpunit/phpunit": "4.*|5.*" }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "type": "library", "autoload": { "files": [ - "lib/bootstrap.php" + "lib/random.php" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Nikita Popov" + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" } ], - "description": "A PHP parser written in PHP", + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", "keywords": [ - "parser", - "php" + "csprng", + "pseudorandom", + "random" ], - "time": "2015-09-19T14:15:08+00:00" + "time": "2018-04-04T21:24:14+00:00" }, { "name": "phpcollection/phpcollection", @@ -1627,28 +1820,28 @@ }, { "name": "phpspec/prophecy", - "version": "1.7.3", + "version": "1.7.6", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf" + "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf", - "reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/33a7e3c4fda54e912ff6338c48823bd5c0f0b712", + "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", - "sebastian/comparator": "^1.1|^2.0", + "sebastian/comparator": "^1.1|^2.0|^3.0", "sebastian/recursion-context": "^1.0|^2.0|^3.0" }, "require-dev": { "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" }, "type": "library", "extra": { @@ -1686,44 +1879,43 @@ "spy", "stub" ], - "time": "2017-11-24T13:59:53+00:00" + "time": "2018-04-18T13:57:24+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "3.3.3", + "version": "2.2.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "44cd8e3930e431658d1a5de7d282d5cb37837fd5" + "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/44cd8e3930e431658d1a5de7d282d5cb37837fd5", - "reference": "44cd8e3930e431658d1a5de7d282d5cb37837fd5", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0", + "php": ">=5.3.3", "phpunit/php-file-iterator": "~1.3", "phpunit/php-text-template": "~1.2", - "phpunit/php-token-stream": "^1.4.2", - "sebastian/code-unit-reverse-lookup": "~1.0", + "phpunit/php-token-stream": "~1.3", "sebastian/environment": "^1.3.2", - "sebastian/version": "~1.0|~2.0" + "sebastian/version": "~1.0" }, "require-dev": { "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "~5" + "phpunit/phpunit": "~4" }, "suggest": { "ext-dom": "*", - "ext-xdebug": ">=2.4.0", + "ext-xdebug": ">=2.2.1", "ext-xmlwriter": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3.x-dev" + "dev-master": "2.2.x-dev" } }, "autoload": { @@ -1749,7 +1941,7 @@ "testing", "xunit" ], - "time": "2016-05-27T16:24:29+00:00" + "time": "2015-10-06T15:47:00+00:00" }, { "name": "phpunit/php-file-iterator", @@ -1939,16 +2131,16 @@ }, { "name": "phpunit/phpunit", - "version": "5.3.5", + "version": "4.8.36", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "08c513bfcab57f3dd72f5214c1c3940439fae7fe" + "reference": "46023de9a91eec7dfb06cc56cb4e260017298517" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/08c513bfcab57f3dd72f5214c1c3940439fae7fe", - "reference": "08c513bfcab57f3dd72f5214c1c3940439fae7fe", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517", + "reference": "46023de9a91eec7dfb06cc56cb4e260017298517", "shasum": "" }, "require": { @@ -1957,22 +2149,19 @@ "ext-pcre": "*", "ext-reflection": "*", "ext-spl": "*", - "myclabs/deep-copy": "~1.3", - "php": "^5.6 || ^7.0", + "php": ">=5.3.3", "phpspec/prophecy": "^1.3.1", - "phpunit/php-code-coverage": ">=3.3.0,<4.0.0", + "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/phpunit-mock-objects": ">=3.1.0,<3.2.0", - "sebastian/comparator": "~1.1", + "phpunit/phpunit-mock-objects": "~2.3", + "sebastian/comparator": "~1.2.2", "sebastian/diff": "~1.2", "sebastian/environment": "~1.3", "sebastian/exporter": "~1.2", "sebastian/global-state": "~1.0", - "sebastian/object-enumerator": "~1.0", - "sebastian/resource-operations": "~1.0", - "sebastian/version": "~1.0|~2.0", + "sebastian/version": "~1.0", "symfony/yaml": "~2.1|~3.0" }, "suggest": { @@ -1984,7 +2173,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.3.x-dev" + "dev-master": "4.8.x-dev" } }, "autoload": { @@ -2010,30 +2199,30 @@ "testing", "xunit" ], - "time": "2016-06-03T09:42:56+00:00" + "time": "2017-06-21T08:07:12+00:00" }, { "name": "phpunit/phpunit-mock-objects", - "version": "3.1.3", + "version": "2.3.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "151c96874bff6fe61a25039df60e776613a61489" + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/151c96874bff6fe61a25039df60e776613a61489", - "reference": "151c96874bff6fe61a25039df60e776613a61489", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", - "php": ">=5.6", + "php": ">=5.3.3", "phpunit/php-text-template": "~1.2", "sebastian/exporter": "~1.2" }, "require-dev": { - "phpunit/phpunit": "~5" + "phpunit/phpunit": "~4.4" }, "suggest": { "ext-soap": "*" @@ -2041,7 +2230,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1.x-dev" + "dev-master": "2.3.x-dev" } }, "autoload": { @@ -2066,7 +2255,7 @@ "mock", "xunit" ], - "time": "2016-04-20T14:39:26+00:00" + "time": "2015-10-02T06:51:40+00:00" }, { "name": "pimple/pimple", @@ -2263,51 +2452,6 @@ ], "time": "2016-08-06T14:39:51+00:00" }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2017-03-04T06:30:41+00:00" - }, { "name": "sebastian/comparator", "version": "1.2.4", @@ -2592,52 +2736,6 @@ ], "time": "2015-10-12T03:26:01+00:00" }, - { - "name": "sebastian/object-enumerator", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "d4ca2fb70344987502567bc50081c03e6192fb26" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/d4ca2fb70344987502567bc50081c03e6192fb26", - "reference": "d4ca2fb70344987502567bc50081c03e6192fb26", - "shasum": "" - }, - "require": { - "php": ">=5.6", - "sebastian/recursion-context": "~1.0" - }, - "require-dev": { - "phpunit/phpunit": "~5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2016-01-28T13:25:10+00:00" - }, { "name": "sebastian/recursion-context", "version": "1.0.5", @@ -2692,28 +2790,20 @@ "time": "2016-10-03T07:41:43+00:00" }, { - "name": "sebastian/resource-operations", - "version": "1.0.0", + "name": "sebastian/version", + "version": "1.0.6", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", "shasum": "" }, - "require": { - "php": ">=5.6.0" - }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, "autoload": { "classmap": [ "src/" @@ -2726,55 +2816,13 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28T20:34:47+00:00" - }, - { - "name": "sebastian/version", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "email": "sebastian@phpunit.de", + "role": "lead" } ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-10-03T07:35:21+00:00" + "time": "2015-06-21T13:59:46+00:00" }, { "name": "seld/jsonlint", @@ -2827,21 +2875,22 @@ }, { "name": "symfony/config", - "version": "v2.8.34", + "version": "v2.8.40", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "17605ff58313d9fe94e507620a399721fc347b6d" + "reference": "93bdf96d0e3c9b29740bf9050e7a996b443c8436" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/17605ff58313d9fe94e507620a399721fc347b6d", - "reference": "17605ff58313d9fe94e507620a399721fc347b6d", + "url": "https://api.github.com/repos/symfony/config/zipball/93bdf96d0e3c9b29740bf9050e7a996b443c8436", + "reference": "93bdf96d0e3c9b29740bf9050e7a996b443c8436", "shasum": "" }, "require": { "php": ">=5.3.9", - "symfony/filesystem": "~2.3|~3.0.0" + "symfony/filesystem": "~2.3|~3.0.0", + "symfony/polyfill-ctype": "~1.8" }, "require-dev": { "symfony/yaml": "~2.7|~3.0.0" @@ -2879,20 +2928,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2018-01-21T19:03:25+00:00" + "time": "2018-05-01T22:52:40+00:00" }, { "name": "symfony/console", - "version": "v2.8.34", + "version": "v2.8.40", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "162ca7d0ea597599967aa63b23418e747da0896b" + "reference": "e8e59b74ad1274714dad2748349b55e3e6e630c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/162ca7d0ea597599967aa63b23418e747da0896b", - "reference": "162ca7d0ea597599967aa63b23418e747da0896b", + "url": "https://api.github.com/repos/symfony/console/zipball/e8e59b74ad1274714dad2748349b55e3e6e630c7", + "reference": "e8e59b74ad1274714dad2748349b55e3e6e630c7", "shasum": "" }, "require": { @@ -2906,7 +2955,7 @@ "symfony/process": "~2.1|~3.0.0" }, "suggest": { - "psr/log": "For using the console logger", + "psr/log-implementation": "For using the console logger", "symfony/event-dispatcher": "", "symfony/process": "" }, @@ -2940,7 +2989,7 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-01-29T08:54:45+00:00" + "time": "2018-05-15T21:17:45+00:00" }, { "name": "symfony/debug", @@ -3001,16 +3050,16 @@ }, { "name": "symfony/event-dispatcher", - "version": "v2.8.34", + "version": "v2.8.40", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "d64be24fc1eba62f9daace8a8918f797fc8e87cc" + "reference": "9b69aad7d4c086dc94ebade2d5eb9145da5dac8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/d64be24fc1eba62f9daace8a8918f797fc8e87cc", - "reference": "d64be24fc1eba62f9daace8a8918f797fc8e87cc", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/9b69aad7d4c086dc94ebade2d5eb9145da5dac8c", + "reference": "9b69aad7d4c086dc94ebade2d5eb9145da5dac8c", "shasum": "" }, "require": { @@ -3057,7 +3106,7 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2018-01-03T07:36:31+00:00" + "time": "2018-04-06T07:35:03+00:00" }, { "name": "symfony/filesystem", @@ -3110,16 +3159,16 @@ }, { "name": "symfony/finder", - "version": "v2.8.34", + "version": "v2.8.40", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "9786ccb6a1f94a89ae18fc6a1b68de1f070823ed" + "reference": "79764d21163db295f0daf8bd9d9b91f97e65db6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/9786ccb6a1f94a89ae18fc6a1b68de1f070823ed", - "reference": "9786ccb6a1f94a89ae18fc6a1b68de1f070823ed", + "url": "https://api.github.com/repos/symfony/finder/zipball/79764d21163db295f0daf8bd9d9b91f97e65db6a", + "reference": "79764d21163db295f0daf8bd9d9b91f97e65db6a", "shasum": "" }, "require": { @@ -3155,20 +3204,129 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-01-29T08:54:45+00:00" + "time": "2018-05-15T21:17:45+00:00" + }, + { + "name": "symfony/options-resolver", + "version": "v3.4.10", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "f3109a6aedd20e35c3a33190e932c2b063b7b50e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/f3109a6aedd20e35c3a33190e932c2b063b7b50e", + "reference": "f3109a6aedd20e35c3a33190e932c2b063b7b50e", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "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 OptionsResolver Component", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "time": "2018-01-11T07:56:07+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.8.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/7cc359f1b7b80fc25ed7796be7d96adc9b354bae", + "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2018-04-30T19:57:29+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.7.0", + "version": "v1.8.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b" + "reference": "3296adf6a6454a050679cde90f95350ad604b171" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/78be803ce01e55d3491c1397cf1c64beb9c1b63b", - "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/3296adf6a6454a050679cde90f95350ad604b171", + "reference": "3296adf6a6454a050679cde90f95350ad604b171", "shasum": "" }, "require": { @@ -3180,7 +3338,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7-dev" + "dev-master": "1.8-dev" } }, "autoload": { @@ -3214,20 +3372,248 @@ "portable", "shim" ], - "time": "2018-01-30T19:27:44+00:00" + "time": "2018-04-26T10:06:28+00:00" + }, + { + "name": "symfony/polyfill-php54", + "version": "v1.8.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php54.git", + "reference": "6c3a2b84c6025e4ea3f6a19feac35408c64b22e1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php54/zipball/6c3a2b84c6025e4ea3f6a19feac35408c64b22e1", + "reference": "6c3a2b84c6025e4ea3f6a19feac35408c64b22e1", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php54\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "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 5.4+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2018-04-26T10:06:28+00:00" + }, + { + "name": "symfony/polyfill-php55", + "version": "v1.8.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php55.git", + "reference": "a39456128377a85f2c5707fcae458678560cba46" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php55/zipball/a39456128377a85f2c5707fcae458678560cba46", + "reference": "a39456128377a85f2c5707fcae458678560cba46", + "shasum": "" + }, + "require": { + "ircmaxell/password-compat": "~1.0", + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php55\\": "" + }, + "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 5.5+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2018-04-26T10:06:28+00:00" + }, + { + "name": "symfony/polyfill-php70", + "version": "v1.8.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php70.git", + "reference": "77454693d8f10dd23bb24955cffd2d82db1007a6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/77454693d8f10dd23bb24955cffd2d82db1007a6", + "reference": "77454693d8f10dd23bb24955cffd2d82db1007a6", + "shasum": "" + }, + "require": { + "paragonie/random_compat": "~1.0|~2.0", + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php70\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "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.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2018-04-26T10:06:28+00:00" + }, + { + "name": "symfony/polyfill-php72", + "version": "v1.8.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php72.git", + "reference": "a4576e282d782ad82397f3e4ec1df8e0f0cafb46" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/a4576e282d782ad82397f3e4ec1df8e0f0cafb46", + "reference": "a4576e282d782ad82397f3e4ec1df8e0f0cafb46", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8-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": "2018-04-26T10:06:28+00:00" }, { "name": "symfony/process", - "version": "v2.8.34", + "version": "v2.8.40", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "905efe90024caa75a2fc93f54e14b26f2a099d96" + "reference": "713952f2ccbcc8342ecdbe1cb313d3e2da8aad28" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/905efe90024caa75a2fc93f54e14b26f2a099d96", - "reference": "905efe90024caa75a2fc93f54e14b26f2a099d96", + "url": "https://api.github.com/repos/symfony/process/zipball/713952f2ccbcc8342ecdbe1cb313d3e2da8aad28", + "reference": "713952f2ccbcc8342ecdbe1cb313d3e2da8aad28", "shasum": "" }, "require": { @@ -3263,11 +3649,11 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-01-29T08:54:45+00:00" + "time": "2018-05-15T21:17:45+00:00" }, { "name": "symfony/stopwatch", - "version": "v2.8.34", + "version": "v2.8.40", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", @@ -3380,20 +3766,21 @@ }, { "name": "symfony/validator", - "version": "v2.8.34", + "version": "v2.8.40", "source": { "type": "git", "url": "https://github.com/symfony/validator.git", - "reference": "71f4e46ff4ca3c8fee09cc1a3a1b90a06cde5e2a" + "reference": "96bbfd5534d2e07ba45255bad27ee90d3bc121a3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/validator/zipball/71f4e46ff4ca3c8fee09cc1a3a1b90a06cde5e2a", - "reference": "71f4e46ff4ca3c8fee09cc1a3a1b90a06cde5e2a", + "url": "https://api.github.com/repos/symfony/validator/zipball/96bbfd5534d2e07ba45255bad27ee90d3bc121a3", + "reference": "96bbfd5534d2e07ba45255bad27ee90d3bc121a3", "shasum": "" }, "require": { "php": ">=5.3.9", + "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.0", "symfony/translation": "~2.4|~3.0.0" }, @@ -3449,7 +3836,7 @@ ], "description": "Symfony Validator Component", "homepage": "https://symfony.com", - "time": "2018-01-29T08:54:45+00:00" + "time": "2018-05-07T06:57:27+00:00" }, { "name": "symfony/yaml", @@ -3508,16 +3895,16 @@ }, { "name": "twig/twig", - "version": "v1.35.0", + "version": "v1.35.3", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "daa657073e55b0a78cce8fdd22682fddecc6385f" + "reference": "b48680b6eb7d16b5025b9bfc4108d86f6b8af86f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/daa657073e55b0a78cce8fdd22682fddecc6385f", - "reference": "daa657073e55b0a78cce8fdd22682fddecc6385f", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/b48680b6eb7d16b5025b9bfc4108d86f6b8af86f", + "reference": "b48680b6eb7d16b5025b9bfc4108d86f6b8af86f", "shasum": "" }, "require": { @@ -3525,8 +3912,8 @@ }, "require-dev": { "psr/container": "^1.0", - "symfony/debug": "~2.7", - "symfony/phpunit-bridge": "~3.3@dev" + "symfony/debug": "^2.7", + "symfony/phpunit-bridge": "^3.3" }, "type": "library", "extra": { @@ -3569,7 +3956,7 @@ "keywords": [ "templating" ], - "time": "2017-09-27T18:06:46+00:00" + "time": "2018-03-20T04:25:58+00:00" }, { "name": "zendframework/zend-cache", @@ -3698,26 +4085,26 @@ }, { "name": "zendframework/zend-eventmanager", - "version": "3.2.0", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/zendframework/zend-eventmanager.git", - "reference": "9d72db10ceb6e42fb92350c0cb54460da61bd79c" + "reference": "5c80bdee0e952be112dcec0968bad770082c3a6e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/9d72db10ceb6e42fb92350c0cb54460da61bd79c", - "reference": "9d72db10ceb6e42fb92350c0cb54460da61bd79c", + "url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/5c80bdee0e952be112dcec0968bad770082c3a6e", + "reference": "5c80bdee0e952be112dcec0968bad770082c3a6e", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^5.5 || ^7.0" }, "require-dev": { "athletic/athletic": "^0.1", "container-interop/container-interop": "^1.1.0", - "phpunit/phpunit": "^6.0.7 || ^5.7.14", - "zendframework/zend-coding-standard": "~1.0.0", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "^2.0", "zendframework/zend-stdlib": "^2.7.3 || ^3.0" }, "suggest": { @@ -3727,8 +4114,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev", - "dev-develop": "3.3-dev" + "dev-master": "3.0-dev", + "dev-develop": "3.1-dev" } }, "autoload": { @@ -3748,7 +4135,7 @@ "events", "zf2" ], - "time": "2017-07-11T19:17:22+00:00" + "time": "2016-02-18T20:53:00+00:00" }, { "name": "zendframework/zend-filter", @@ -3870,26 +4257,26 @@ }, { "name": "zendframework/zend-i18n", - "version": "2.7.4", + "version": "2.7.3", "source": { "type": "git", "url": "https://github.com/zendframework/zend-i18n.git", - "reference": "d3431e29cc00c2a1c6704e601d4371dbf24f6a31" + "reference": "b2db0d8246a865c659f93199f90f5fc2cd2f3cd8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-i18n/zipball/d3431e29cc00c2a1c6704e601d4371dbf24f6a31", - "reference": "d3431e29cc00c2a1c6704e601d4371dbf24f6a31", + "url": "https://api.github.com/repos/zendframework/zend-i18n/zipball/b2db0d8246a865c659f93199f90f5fc2cd2f3cd8", + "reference": "b2db0d8246a865c659f93199f90f5fc2cd2f3cd8", "shasum": "" }, "require": { - "php": "^7.0 || ^5.6", + "php": "^5.5 || ^7.0", "zendframework/zend-stdlib": "^2.7 || ^3.0" }, "require-dev": { - "phpunit/phpunit": "^6.0.8 || ^5.7.15", + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0", "zendframework/zend-cache": "^2.6.1", - "zendframework/zend-coding-standard": "~1.0.0", "zendframework/zend-config": "^2.6", "zendframework/zend-eventmanager": "^2.6.2 || ^3.0", "zendframework/zend-filter": "^2.6.1", @@ -3933,39 +4320,44 @@ "i18n", "zf2" ], - "time": "2017-05-17T17:00:12+00:00" + "time": "2016-06-07T21:08:30+00:00" }, { "name": "zendframework/zend-json", - "version": "3.1.0", + "version": "2.6.1", "source": { "type": "git", "url": "https://github.com/zendframework/zend-json.git", - "reference": "4dd940e8e6f32f1d36ea6b0677ea57c540c7c19c" + "reference": "4c8705dbe4ad7d7e51b2876c5b9eea0ef916ba28" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-json/zipball/4dd940e8e6f32f1d36ea6b0677ea57c540c7c19c", - "reference": "4dd940e8e6f32f1d36ea6b0677ea57c540c7c19c", + "url": "https://api.github.com/repos/zendframework/zend-json/zipball/4c8705dbe4ad7d7e51b2876c5b9eea0ef916ba28", + "reference": "4c8705dbe4ad7d7e51b2876c5b9eea0ef916ba28", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^5.5 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^5.7.23 || ^6.4.3", - "zendframework/zend-coding-standard": "~1.0.0", - "zendframework/zend-stdlib": "^2.7.7 || ^3.1" + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0", + "zendframework/zend-http": "^2.5.4", + "zendframework/zend-server": "^2.6.1", + "zendframework/zend-stdlib": "^2.5 || ^3.0", + "zendframework/zendxml": "^1.0.2" }, "suggest": { - "zendframework/zend-json-server": "For implementing JSON-RPC servers", - "zendframework/zend-xml2json": "For converting XML documents to JSON" + "zendframework/zend-http": "Zend\\Http component, required to use Zend\\Json\\Server", + "zendframework/zend-server": "Zend\\Server component, required to use Zend\\Json\\Server", + "zendframework/zend-stdlib": "Zend\\Stdlib component, for use with caching Zend\\Json\\Server responses", + "zendframework/zendxml": "To support Zend\\Json\\Json::fromXml() usage" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1.x-dev", - "dev-develop": "3.2.x-dev" + "dev-master": "2.6-dev", + "dev-develop": "2.7-dev" } }, "autoload": { @@ -3978,48 +4370,47 @@ "BSD-3-Clause" ], "description": "provides convenience methods for serializing native PHP to JSON and decoding JSON to native PHP", + "homepage": "https://github.com/zendframework/zend-json", "keywords": [ - "ZendFramework", "json", - "zf" + "zf2" ], - "time": "2018-01-04T17:51:34+00:00" + "time": "2016-02-04T21:20:26+00:00" }, { "name": "zendframework/zend-serializer", - "version": "2.8.1", + "version": "2.7.2", "source": { "type": "git", "url": "https://github.com/zendframework/zend-serializer.git", - "reference": "7ac42b9a47e9cb23895173a3096bc3b3fb7ac580" + "reference": "95385c2342fc335d5164eb95ac3ca230aa51223b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-serializer/zipball/7ac42b9a47e9cb23895173a3096bc3b3fb7ac580", - "reference": "7ac42b9a47e9cb23895173a3096bc3b3fb7ac580", + "url": "https://api.github.com/repos/zendframework/zend-serializer/zipball/95385c2342fc335d5164eb95ac3ca230aa51223b", + "reference": "95385c2342fc335d5164eb95ac3ca230aa51223b", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0", - "zendframework/zend-json": "^2.5 || ^3.0", + "php": "^5.5 || ^7.0", + "zendframework/zend-json": "^2.5", "zendframework/zend-stdlib": "^2.7 || ^3.0" }, "require-dev": { - "doctrine/instantiator": "1.0.*", - "phpunit/phpunit": "^5.5", - "zendframework/zend-coding-standard": "~1.0.0", + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "^4.5", "zendframework/zend-math": "^2.6", "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3" }, "suggest": { - "zendframework/zend-math": "(^2.6 || ^3.0) To support Python Pickle serialization", - "zendframework/zend-servicemanager": "(^2.7.5 || ^3.0.3) To support plugin manager support" + "zendframework/zend-math": "(^2.6) To support Python Pickle serialization", + "zendframework/zend-servicemanager": "To support plugin manager support" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev", - "dev-develop": "2.9-dev" + "dev-master": "2.7-dev", + "dev-develop": "2.8-dev" }, "zf": { "component": "Zend\\Serializer", @@ -4041,7 +4432,7 @@ "serializer", "zf2" ], - "time": "2017-11-20T22:21:04+00:00" + "time": "2016-05-11T16:05:56+00:00" }, { "name": "zendframework/zend-servicemanager", diff --git a/integration-tests/LDDFeatureRequesterTest.php b/integration-tests/LDDFeatureRequesterTest.php index 6d41355ed..541d1bbc6 100644 --- a/integration-tests/LDDFeatureRequesterTest.php +++ b/integration-tests/LDDFeatureRequesterTest.php @@ -9,10 +9,12 @@ use Predis\Client; use LaunchDarkly\ApcuLDDFeatureRequester; -class LDDFeatureRetrieverTest extends \PHPUnit_Framework_TestCase { +class LDDFeatureRetrieverTest extends \PHPUnit_Framework_TestCase +{ const API_KEY = 'BOGUS_API_KEY'; - public function testGet() { + public function testGet() + { $redis = new Client(array( "scheme" => "tcp", "host" => 'localhost', @@ -27,7 +29,8 @@ public function testGet() { $this->assertEquals("bar", $client->variation('foo', $user, 'jim')); } - public function testGetApc() { + public function testGetApc() + { if (!extension_loaded('apc')) { self::markTestSkipped('Install `apc` extension to run this test.'); } @@ -53,7 +56,8 @@ public function testGetApc() { $this->assertEquals("baz", $client->variation('foo', $user, 'jim')); } - public function testGetApcu() { + public function testGetApcu() + { if (!extension_loaded('apcu')) { self::markTestSkipped('Install `apcu` extension to run this test.'); } @@ -121,7 +125,8 @@ public function testGetAll() $this->assertEquals($featureValue, $allFlags[$featureKey]); } - private function gen_feature($key, $val) { + private function gen_feature($key, $val) + { $data = [ 'name' => 'Feature ' . $key, 'key' => $key, @@ -171,6 +176,4 @@ private function gen_feature($key, $val) { return \json_encode($data); } - } - diff --git a/src/LaunchDarkly/EventProcessor.php b/src/LaunchDarkly/EventProcessor.php index 5bbf60498..c2600422a 100644 --- a/src/LaunchDarkly/EventProcessor.php +++ b/src/LaunchDarkly/EventProcessor.php @@ -12,14 +12,15 @@ class EventProcessor private $_capacity; private $_timeout; - public function __construct($sdkKey, $options = array()) { - $this->_eventPublisher = $this->getEventPublisher($sdkKey, $options); - $this->_eventSerializer = new EventSerializer($options); + public function __construct($sdkKey, $options = array()) + { + $this->_eventPublisher = $this->getEventPublisher($sdkKey, $options); + $this->_eventSerializer = new EventSerializer($options); - $this->_capacity = $options['capacity']; - $this->_timeout = $options['timeout']; + $this->_capacity = $options['capacity']; + $this->_timeout = $options['timeout']; - $this->_queue = array(); + $this->_queue = array(); } public function __destruct() @@ -43,44 +44,44 @@ public function enqueue($event) return true; } - /** - * Publish events to LaunchDarkly - * @return bool Whether the events were successfully published - */ - public function flush() - { - if (empty($this->_queue)) { - return null; - } + /** + * Publish events to LaunchDarkly + * @return bool Whether the events were successfully published + */ + public function flush() + { + if (empty($this->_queue)) { + return null; + } - $payload = $this->_eventSerializer->serializeEvents($this->_queue); + $payload = $this->_eventSerializer->serializeEvents($this->_queue); - // We don't expect flush to be called more than once per request cycle, but let's empty the queue just in case - $this->_queue = array(); + // We don't expect flush to be called more than once per request cycle, but let's empty the queue just in case + $this->_queue = array(); - return $this->_eventPublisher->publish($payload); - } + return $this->_eventPublisher->publish($payload); + } - /** - * @param string $sdkKey - * @param mixed[] $options - * @return EventPublisher - */ - private function getEventPublisher($sdkKey, array $options) - { - if (isset($options['event_publisher']) && $options['event_publisher'] instanceof EventPublisher) { - return $options['event_publisher']; - } + /** + * @param string $sdkKey + * @param mixed[] $options + * @return EventPublisher + */ + private function getEventPublisher($sdkKey, array $options) + { + if (isset($options['event_publisher']) && $options['event_publisher'] instanceof EventPublisher) { + return $options['event_publisher']; + } - if (isset($options['event_publisher_class'])) { - $eventPublisherClass = $options['event_publisher_class']; - } else { - $eventPublisherClass = CurlEventPublisher::class; - } + if (isset($options['event_publisher_class'])) { + $eventPublisherClass = $options['event_publisher_class']; + } else { + $eventPublisherClass = CurlEventPublisher::class; + } - if (!is_a($eventPublisherClass, EventPublisher::class, true)) { - throw new \InvalidArgumentException; - } - return new $eventPublisherClass($sdkKey, $options); - } + if (!is_a($eventPublisherClass, EventPublisher::class, true)) { + throw new \InvalidArgumentException; + } + return new $eventPublisherClass($sdkKey, $options); + } } diff --git a/src/LaunchDarkly/EventSerializer.php b/src/LaunchDarkly/EventSerializer.php index 63d1cec4d..85b6c616f 100644 --- a/src/LaunchDarkly/EventSerializer.php +++ b/src/LaunchDarkly/EventSerializer.php @@ -6,7 +6,6 @@ */ class EventSerializer { - private $_allAttrsPrivate; private $_privateAttrNames; @@ -31,8 +30,7 @@ private function filterEvent($e) foreach ($e as $key => $value) { if ($key == 'user') { $ret[$key] = $this->serializeUser($value); - } - else { + } else { $ret[$key] = $value; } } @@ -44,11 +42,10 @@ private function filterAttrs($attrs, &$json, $userPrivateAttrs, &$allPrivateAttr foreach ($attrs as $key => $value) { if ($value != null) { if ($this->_allAttrsPrivate || - array_search($key, $userPrivateAttrs) !== FALSE || - array_search($key, $this->_privateAttrNames) !== FALSE) { + array_search($key, $userPrivateAttrs) !== false || + array_search($key, $this->_privateAttrNames) !== false) { $allPrivateAttrs[$key] = true; - } - else { + } else { $json[$key] = $value; } } diff --git a/src/LaunchDarkly/GuzzleFeatureRequester.php b/src/LaunchDarkly/GuzzleFeatureRequester.php index 0c06bdd49..65f446d8d 100644 --- a/src/LaunchDarkly/GuzzleFeatureRequester.php +++ b/src/LaunchDarkly/GuzzleFeatureRequester.php @@ -113,7 +113,8 @@ public function getAllFeatures() } } - private function handleUnexpectedStatus($code, $method) { + private function handleUnexpectedStatus($code, $method) + { $this->_logger->error("$method received an unexpected HTTP status code $code"); if ($code == 401) { throw new InvalidSDKKeyException(); diff --git a/src/LaunchDarkly/LDClient.php b/src/LaunchDarkly/LDClient.php index 3604db65f..61f8c3d08 100644 --- a/src/LaunchDarkly/LDClient.php +++ b/src/LaunchDarkly/LDClient.php @@ -352,7 +352,8 @@ protected function _get_default($key, $default) } } - protected function handleInvalidSDKKey() { + protected function handleInvalidSDKKey() + { $this->_logger->error("Received 401 error, no further HTTP requests will be made during lifetime of LDClient since SDK key is invalid"); $this->_offline = true; } diff --git a/src/LaunchDarkly/LDUserBuilder.php b/src/LaunchDarkly/LDUserBuilder.php index 2e88b06be..ddd673874 100644 --- a/src/LaunchDarkly/LDUserBuilder.php +++ b/src/LaunchDarkly/LDUserBuilder.php @@ -47,7 +47,8 @@ public function privateSecondary($secondary) /** * Sets the IP for a user. */ - public function ip($ip){ + public function ip($ip) + { $this->_ip = $ip; return $this; } diff --git a/src/LaunchDarkly/Operators.php b/src/LaunchDarkly/Operators.php index 706af4fed..a02995218 100644 --- a/src/LaunchDarkly/Operators.php +++ b/src/LaunchDarkly/Operators.php @@ -137,7 +137,8 @@ public static function parseTime($in) * @param $in * @return null|string */ - public static function parseSemVer($in) { + public static function parseSemVer($in) + { try { return SemanticVersion::parse($in, true); } catch (\InvalidArgumentException $e) { diff --git a/src/LaunchDarkly/SemanticVersion.php b/src/LaunchDarkly/SemanticVersion.php index c828cccfc..3948edebd 100644 --- a/src/LaunchDarkly/SemanticVersion.php +++ b/src/LaunchDarkly/SemanticVersion.php @@ -10,9 +10,9 @@ */ class SemanticVersion { - private static $REGEX = '/^(?0|[1-9]\d*)(\.(?0|[1-9]\d*))?(\.(?0|[1-9]\d*))?(\-(?[0-9A-Za-z\-\.]+))?(\+(?[0-9A-Za-z\-\.]+))?$/'; + private static $REGEX = '/^(?0|[1-9]\d*)(\.(?0|[1-9]\d*))?(\.(?0|[1-9]\d*))?(\-(?[0-9A-Za-z\-\.]+))?(\+(?[0-9A-Za-z\-\.]+))?$/'; - /** @var int */ + /** @var int */ public $major; /** @var int */ public $minor; @@ -25,11 +25,11 @@ class SemanticVersion public function __construct($major, $minor, $patch, $prerelease, $build) { - $this->major = $major; - $this->minor = $minor; - $this->patch = $patch; - $this->prerelease = $prerelease; - $this->build = $build; + $this->major = $major; + $this->minor = $minor; + $this->patch = $patch; + $this->prerelease = $prerelease; + $this->build = $build; } /** @@ -41,18 +41,18 @@ public function __construct($major, $minor, $patch, $prerelease, $build) */ public static function parse($input, $loose = false) { - if (!preg_match(self::$REGEX, $input, $matches)) { - throw new \InvalidArgumentException("not a valid semantic version"); - } - $major = intval($matches['major']); - if (!$loose && (!array_key_exists('minor', $matches) || !array_key_exists('patch', $matches))) { - throw new \InvalidArgumentException("not a valid semantic version: minor and patch versions are required"); - } - $minor = array_key_exists('minor', $matches) ? intval($matches['minor']) : 0; - $patch = array_key_exists('patch', $matches) ? intval($matches['patch']) : 0; - $prerelease = array_key_exists('prerel', $matches) ? $matches['prerel'] : ''; - $build = array_key_exists('build', $matches) ? $matches['build'] : ''; - return new SemanticVersion($major, $minor, $patch, $prerelease, $build); + if (!preg_match(self::$REGEX, $input, $matches)) { + throw new \InvalidArgumentException("not a valid semantic version"); + } + $major = intval($matches['major']); + if (!$loose && (!array_key_exists('minor', $matches) || !array_key_exists('patch', $matches))) { + throw new \InvalidArgumentException("not a valid semantic version: minor and patch versions are required"); + } + $minor = array_key_exists('minor', $matches) ? intval($matches['minor']) : 0; + $patch = array_key_exists('patch', $matches) ? intval($matches['patch']) : 0; + $prerelease = array_key_exists('prerel', $matches) ? $matches['prerel'] : ''; + $build = array_key_exists('build', $matches) ? $matches['build'] : ''; + return new SemanticVersion($major, $minor, $patch, $prerelease, $build); } /** @@ -63,59 +63,59 @@ public static function parse($input, $loose = false) */ public function comparePrecedence($other) { - if ($this->major != $other->major) { - return ($this->major < $other->major) ? -1 : 1; - } - if ($this->minor != $other->minor) { - return ($this->minor < $other->minor) ? -1 : 1; - } - if ($this->patch != $other->patch) { - return ($this->patch < $other->patch) ? -1 : 1; - } - if ($this->prerelease != $other->prerelease) { - // *no* prerelease component always has a higher precedence than *any* prerelease component - if ($this->prerelease == '') { - return 1; - } - if ($other->prerelease == '') { - return -1; - } - return self::compareIdentifiers(explode('.', $this->prerelease), explode('.', $other->prerelease)); - } - // build metadata is always ignored in precedence comparison - return 0; + if ($this->major != $other->major) { + return ($this->major < $other->major) ? -1 : 1; + } + if ($this->minor != $other->minor) { + return ($this->minor < $other->minor) ? -1 : 1; + } + if ($this->patch != $other->patch) { + return ($this->patch < $other->patch) ? -1 : 1; + } + if ($this->prerelease != $other->prerelease) { + // *no* prerelease component always has a higher precedence than *any* prerelease component + if ($this->prerelease == '') { + return 1; + } + if ($other->prerelease == '') { + return -1; + } + return self::compareIdentifiers(explode('.', $this->prerelease), explode('.', $other->prerelease)); + } + // build metadata is always ignored in precedence comparison + return 0; } private static function compareIdentifiers($ids1, $ids2) { - for ($i = 0; ; $i++) { - if ($i >= count($ids1)) { - // x.y is always less than x.y.z - return ($i >= count($ids2)) ? 0 : -1; - } - if ($i >= count($ids2)) { - return 1; - } - $v1 = $ids1[$i]; - $v2 = $ids2[$i]; - // each sub-identifier is compared numerically if both are numeric; if both are non-numeric, - // they're compared as strings; otherwise, the numeric one is the lesser one - $isNum1 = is_numeric($v1); - $isNum2 = is_numeric($v2); - if ($isNum1 && $isNum2) { - $n1 = intval($v1); - $n2 = intval($v2); - $d = ($n1 == $n2) ? 0 : (($n1 < $n2) ? -1 : 1); - } else { - if ($isNum1 || $isNum2) { - $d = $isNum1 ? -1 : 1; - } else { - $d = ($v1 == $v2) ? 0 : (($v1 < $v2) ? -1 : 1); - } - } - if ($d != 0) { - return $d; - } - } + for ($i = 0; ; $i++) { + if ($i >= count($ids1)) { + // x.y is always less than x.y.z + return ($i >= count($ids2)) ? 0 : -1; + } + if ($i >= count($ids2)) { + return 1; + } + $v1 = $ids1[$i]; + $v2 = $ids2[$i]; + // each sub-identifier is compared numerically if both are numeric; if both are non-numeric, + // they're compared as strings; otherwise, the numeric one is the lesser one + $isNum1 = is_numeric($v1); + $isNum2 = is_numeric($v2); + if ($isNum1 && $isNum2) { + $n1 = intval($v1); + $n2 = intval($v2); + $d = ($n1 == $n2) ? 0 : (($n1 < $n2) ? -1 : 1); + } else { + if ($isNum1 || $isNum2) { + $d = $isNum1 ? -1 : 1; + } else { + $d = ($v1 == $v2) ? 0 : (($v1 < $v2) ? -1 : 1); + } + } + if ($d != 0) { + return $d; + } + } } } diff --git a/tests/EventSerializerTest.php b/tests/EventSerializerTest.php index c82bef127..6ccdc2ee2 100644 --- a/tests/EventSerializerTest.php +++ b/tests/EventSerializerTest.php @@ -6,7 +6,6 @@ class EventSerializerTest extends \PHPUnit_Framework_TestCase { - private function getUser() { return (new LDUserBuilder('abc')) @@ -41,7 +40,8 @@ private function getUserResultWithAllAttrsHidden() ); } - private function getUserResultWithSomeAttrsHidden() { + private function getUserResultWithSomeAttrsHidden() + { return array( 'key' => 'abc', 'custom' => array('dizzle' => 'ghi'), @@ -137,14 +137,16 @@ public function testEmptyCustom() $this->assertFalse(isset($json['custom'])); } - public function testEmptyPrivateCustom() { + public function testEmptyPrivateCustom() + { $builder = new LDUserBuilder("foo@bar.com"); $user = $builder->privateCustomAttribute("my-key", "my-value")->build(); $json = $this->getJsonForUserBySerializingEvent($user); $this->assertFalse(isset($json['custom'])); } - public function testUserSecondary() { + public function testUserSecondary() + { $builder = new LDUserBuilder("foo@bar.com"); $user = $builder->secondary("secondary")->build(); $json = $this->getJsonForUserBySerializingEvent($user); @@ -212,7 +214,6 @@ public function testUserAnonymous() $builder = new LDUserBuilder("foo@bar.com"); $user = $builder->anonymous(true)->build(); $json = $this->getJsonForUserBySerializingEvent($user); - $this->assertEquals(true, $json['anonymous']); + $this->assertEquals(true, $json['anonymous']); } } - diff --git a/tests/FeatureFlagTest.php b/tests/FeatureFlagTest.php index ac08dfa04..f64303648 100644 --- a/tests/FeatureFlagTest.php +++ b/tests/FeatureFlagTest.php @@ -6,7 +6,6 @@ use LaunchDarkly\LDUserBuilder; use LaunchDarkly\Segment; - class FeatureFlagTest extends \PHPUnit_Framework_TestCase { private static $json1 = "{ @@ -154,7 +153,7 @@ public function dataDecodeMulti() 'key' => 'sysops-test', 'version' => 14, 'on' => true, - 'prerequisites' => NULL, + 'prerequisites' => null, 'salt' => 'c3lzb3BzLXRlc3Q=', 'sel' => '8ed13de1bfb14507ba7e6dde01f3e035', 'targets' => [ @@ -171,7 +170,7 @@ public function dataDecodeMulti() 'fallthrough' => [ 'variation' => 0, ], - 'offVariation' => NULL, + 'offVariation' => null, 'variations' => [ true, false, @@ -573,7 +572,7 @@ class MockFeatureRequesterForFeature implements FeatureRequester public $key = null; public $val = null; - function __construct($baseurl = null, $key = null, $options = null) + public function __construct($baseurl = null, $key = null, $options = null) { } @@ -598,7 +597,7 @@ class MockFeatureRequesterForSegment implements FeatureRequester public $key = null; public $val = null; - function __construct($baseurl = null, $key = null, $options = null) + public function __construct($baseurl = null, $key = null, $options = null) { } @@ -617,4 +616,3 @@ public function getAllFeatures() return null; } } - diff --git a/tests/LDClientTest.php b/tests/LDClientTest.php index e02b9c138..53f664d2a 100644 --- a/tests/LDClientTest.php +++ b/tests/LDClientTest.php @@ -8,10 +8,8 @@ use LaunchDarkly\LDUserBuilder; use Psr\Log\LoggerInterface; - class LDClientTest extends \PHPUnit_Framework_TestCase { - public function testDefaultCtor() { $this->assertInstanceOf(LDClient::class, new LDClient("BOGUS_SDK_KEY")); @@ -70,7 +68,7 @@ public function testSecureModeHash() { $client = new LDClient("secret", ['offline' => true]); $user = new LDUser("Message"); - $this->assertEquals("aa747c502a898200f9e4fa21bac68136f886a0e27aec70ba06daf2e2a5cb5597", $client->secureModeHash($user)); + $this->assertEquals("aa747c502a898200f9e4fa21bac68136f886a0e27aec70ba06daf2e2a5cb5597", $client->secureModeHash($user)); } public function testLoggerInterfaceWarn() @@ -103,7 +101,7 @@ class MockFeatureRequester implements FeatureRequester { public static $val = null; - function __construct($baseurl, $key, $options) + public function __construct($baseurl, $key, $options) { } diff --git a/tests/LDUserTest.php b/tests/LDUserTest.php index 104019b0e..1b9d883cb 100644 --- a/tests/LDUserTest.php +++ b/tests/LDUserTest.php @@ -6,7 +6,6 @@ class LDUserTest extends \PHPUnit_Framework_TestCase { - public function testLDUserKey() { $builder = new LDUserBuilder("foo@bar.com"); @@ -22,7 +21,7 @@ public function testCoerceLDUserKey() } public function testEmptyCustom() - { + { $builder = new LDUserBuilder("foo@bar.com"); $user = $builder->build(); diff --git a/tests/OperatorsTest.php b/tests/OperatorsTest.php index 34157519a..84c894431 100644 --- a/tests/OperatorsTest.php +++ b/tests/OperatorsTest.php @@ -2,12 +2,10 @@ namespace LaunchDarkly\Tests; - use LaunchDarkly\Operators; class OperatorsTest extends \PHPUnit_Framework_TestCase { - public function testIn() { $this->assertTrue(Operators::apply("in", "A string to match", "A string to match")); @@ -56,7 +54,8 @@ public function testParseTime() $this->assertEquals(null, Operators::parseTime([])); } - public function testSemVer() { + public function testSemVer() + { $this->assertTrue(Operators::apply("semVerEqual", "2.0.0", "2.0.0")); $this->assertTrue(Operators::apply("semVerEqual", "2.0", "2.0.0")); $this->assertTrue(Operators::apply("semVerEqual", "2", "2.0.0")); @@ -74,4 +73,4 @@ public function testSemVer() { $this->assertFalse(Operators::apply("semVerLessThan", "2.0.0", "xbad%ver")); $this->assertFalse(Operators::apply("semVerGreaterThan", "2.0.0", "xbad%ver")); } -} \ No newline at end of file +} diff --git a/tests/SegmentTest.php b/tests/SegmentTest.php index 5ffb1ffb9..60331d9dc 100644 --- a/tests/SegmentTest.php +++ b/tests/SegmentTest.php @@ -6,174 +6,181 @@ class SegmentTest extends \PHPUnit_Framework_TestCase { - public function testExplicitIncludeUser() { - $json = array( - 'key' => 'test', - 'included' => array('foo'), - 'excluded' => array(), - 'rules' => array(), - 'salt' => 'salt', - 'version' => 1, - 'deleted' => false - ); - $segment = Segment::decode($json); - $ub = new LDUserBuilder('foo'); - $this->assertTrue($segment->matchesUser($ub->build())); - } + public function testExplicitIncludeUser() + { + $json = array( + 'key' => 'test', + 'included' => array('foo'), + 'excluded' => array(), + 'rules' => array(), + 'salt' => 'salt', + 'version' => 1, + 'deleted' => false + ); + $segment = Segment::decode($json); + $ub = new LDUserBuilder('foo'); + $this->assertTrue($segment->matchesUser($ub->build())); + } - public function testExplicitExcludeUser() { - $json = array( - 'key' => 'test', - 'included' => array(), - 'excluded' => array('foo'), - 'rules' => array(), - 'salt' => 'salt', - 'version' => 1, - 'deleted' => false - ); - $segment = Segment::decode($json); - $ub = new LDUserBuilder('foo'); - $this->assertFalse($segment->matchesUser($ub->build())); - } + public function testExplicitExcludeUser() + { + $json = array( + 'key' => 'test', + 'included' => array(), + 'excluded' => array('foo'), + 'rules' => array(), + 'salt' => 'salt', + 'version' => 1, + 'deleted' => false + ); + $segment = Segment::decode($json); + $ub = new LDUserBuilder('foo'); + $this->assertFalse($segment->matchesUser($ub->build())); + } - public function testExplicitIncludePasPrecedence() { - $json = array( - 'key' => 'test', - 'included' => array('foo'), - 'excluded' => array('foo'), - 'rules' => array(), - 'salt' => 'salt', - 'version' => 1, - 'deleted' => false - ); - $segment = Segment::decode($json); - $ub = new LDUserBuilder('foo'); - $this->assertTrue($segment->matchesUser($ub->build())); - } + public function testExplicitIncludePasPrecedence() + { + $json = array( + 'key' => 'test', + 'included' => array('foo'), + 'excluded' => array('foo'), + 'rules' => array(), + 'salt' => 'salt', + 'version' => 1, + 'deleted' => false + ); + $segment = Segment::decode($json); + $ub = new LDUserBuilder('foo'); + $this->assertTrue($segment->matchesUser($ub->build())); + } - public function testMatchingRuleWithFullRollout() { - $json = array( - 'key' => 'test', - 'included' => array(), - 'excluded' => array(), - 'salt' => 'salt', - 'rules' => array( - array( - 'clauses' => array( - array( - 'attribute' => 'email', - 'op' => 'in', - 'values' => array('test@example.com'), - 'negate' => false - ) - ), - 'weight' => 100000 - ) - ), - 'version' => 1, - 'deleted' => false - ); - $segment = Segment::decode($json); - $ub = new LDUserBuilder('foo'); - $ub->email('test@example.com'); - $this->assertTrue($segment->matchesUser($ub->build())); - } + public function testMatchingRuleWithFullRollout() + { + $json = array( + 'key' => 'test', + 'included' => array(), + 'excluded' => array(), + 'salt' => 'salt', + 'rules' => array( + array( + 'clauses' => array( + array( + 'attribute' => 'email', + 'op' => 'in', + 'values' => array('test@example.com'), + 'negate' => false + ) + ), + 'weight' => 100000 + ) + ), + 'version' => 1, + 'deleted' => false + ); + $segment = Segment::decode($json); + $ub = new LDUserBuilder('foo'); + $ub->email('test@example.com'); + $this->assertTrue($segment->matchesUser($ub->build())); + } - public function testMatchingRuleWithZeroRollout() { - $json = array( - 'key' => 'test', - 'included' => array(), - 'excluded' => array(), - 'salt' => 'salt', - 'rules' => array( - array( - 'clauses' => array( - array( - 'attribute' => 'email', - 'op' => 'in', - 'values' => array('test@example.com'), - 'negate' => false - ) - ), - 'weight' => 0 - ) - ), - 'version' => 1, - 'deleted' => false - ); - $segment = Segment::decode($json); - $ub = new LDUserBuilder('foo'); - $ub->email('test@example.com'); - $this->assertFalse($segment->matchesUser($ub->build())); - } + public function testMatchingRuleWithZeroRollout() + { + $json = array( + 'key' => 'test', + 'included' => array(), + 'excluded' => array(), + 'salt' => 'salt', + 'rules' => array( + array( + 'clauses' => array( + array( + 'attribute' => 'email', + 'op' => 'in', + 'values' => array('test@example.com'), + 'negate' => false + ) + ), + 'weight' => 0 + ) + ), + 'version' => 1, + 'deleted' => false + ); + $segment = Segment::decode($json); + $ub = new LDUserBuilder('foo'); + $ub->email('test@example.com'); + $this->assertFalse($segment->matchesUser($ub->build())); + } - public function testMatchingRuleWithMultipleClauses() { - $json = array( - 'key' => 'test', - 'included' => array(), - 'excluded' => array(), - 'salt' => 'salt', - 'rules' => array( - array( - 'clauses' => array( - array( - 'attribute' => 'email', - 'op' => 'in', - 'values' => array('test@example.com'), - 'negate' => false - ), - array( - 'attribute' => 'name', - 'op' => 'in', - 'values' => array('bob'), - 'negate' => false - ) - ), - 'weight' => 100000 - ) - ), - 'version' => 1, - 'deleted' => false - ); - $segment = Segment::decode($json); - $ub = new LDUserBuilder('foo'); - $ub->email('test@example.com'); - $ub->name('bob'); - $this->assertTrue($segment->matchesUser($ub->build())); - } + public function testMatchingRuleWithMultipleClauses() + { + $json = array( + 'key' => 'test', + 'included' => array(), + 'excluded' => array(), + 'salt' => 'salt', + 'rules' => array( + array( + 'clauses' => array( + array( + 'attribute' => 'email', + 'op' => 'in', + 'values' => array('test@example.com'), + 'negate' => false + ), + array( + 'attribute' => 'name', + 'op' => 'in', + 'values' => array('bob'), + 'negate' => false + ) + ), + 'weight' => 100000 + ) + ), + 'version' => 1, + 'deleted' => false + ); + $segment = Segment::decode($json); + $ub = new LDUserBuilder('foo'); + $ub->email('test@example.com'); + $ub->name('bob'); + $this->assertTrue($segment->matchesUser($ub->build())); + } - public function testNonMatchingRuleWithMultipleClauses() { - $json = array( - 'key' => 'test', - 'included' => array(), - 'excluded' => array(), - 'salt' => 'salt', - 'rules' => array( - array( - 'clauses' => array( - array( - 'attribute' => 'email', - 'op' => 'in', - 'values' => array('test@example.com'), - 'negate' => false - ), - array( - 'attribute' => 'name', - 'op' => 'in', - 'values' => array('bill'), - 'negate' => false - ) - ), - 'weight' => 100000 - ) - ), - 'version' => 1, - 'deleted' => false - ); - $segment = Segment::decode($json); - $ub = new LDUserBuilder('foo'); - $ub->email('test@example.com'); - $ub->name('bob'); - $this->assertFalse($segment->matchesUser($ub->build())); - } + public function testNonMatchingRuleWithMultipleClauses() + { + $json = array( + 'key' => 'test', + 'included' => array(), + 'excluded' => array(), + 'salt' => 'salt', + 'rules' => array( + array( + 'clauses' => array( + array( + 'attribute' => 'email', + 'op' => 'in', + 'values' => array('test@example.com'), + 'negate' => false + ), + array( + 'attribute' => 'name', + 'op' => 'in', + 'values' => array('bill'), + 'negate' => false + ) + ), + 'weight' => 100000 + ) + ), + 'version' => 1, + 'deleted' => false + ); + $segment = Segment::decode($json); + $ub = new LDUserBuilder('foo'); + $ub->email('test@example.com'); + $ub->name('bob'); + $this->assertFalse($segment->matchesUser($ub->build())); + } } diff --git a/tests/SemanticVersionTest.php b/tests/SemanticVersionTest.php index 5ef68c399..621ed4aa6 100644 --- a/tests/SemanticVersionTest.php +++ b/tests/SemanticVersionTest.php @@ -2,7 +2,6 @@ namespace LaunchDarkly\Tests; - use LaunchDarkly\SemanticVersion; class SemanticVersionTest extends \PHPUnit_Framework_TestCase