From faa0f0ae5f85c3c9afeeaefa55a7d0b7fce010df Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Wed, 20 Dec 2017 22:40:24 -0500 Subject: [PATCH] Further clean up code, implement signature checking --- php/composer.json | 3 - php/composer.lock | 1560 ++--------------------------------- php/mass-rebuild-filter.php | 15 - php/src/EventClassifier.php | 185 ----- php/web/index.php | 167 +++- 5 files changed, 192 insertions(+), 1738 deletions(-) delete mode 100644 php/src/EventClassifier.php diff --git a/php/composer.json b/php/composer.json index 2c7424a..df67e8b 100644 --- a/php/composer.json +++ b/php/composer.json @@ -7,8 +7,5 @@ "minimum-stability": "dev", "autoload": { "psr-4": {"GHE\\": "src/"} - }, - "require-dev": { - "phpunit/phpunit": "^6.4" } } diff --git a/php/composer.lock b/php/composer.lock index df5b6ee..a453b7f 100644 --- a/php/composer.lock +++ b/php/composer.lock @@ -4,7 +4,7 @@ "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": "5ac078c9602fc65993891726f1216093", + "content-hash": "0ee26122485b777e3ea752a8d5da0c61", "packages": [ { "name": "clue/stream-filter", @@ -129,12 +129,12 @@ "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "e9cdab6ff93ff789b5b599326c727f51d10893a6" + "reference": "2e48ae638dc0bf0849772f5590835fcd700a2e1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/e9cdab6ff93ff789b5b599326c727f51d10893a6", - "reference": "e9cdab6ff93ff789b5b599326c727f51d10893a6", + "url": "https://api.github.com/repos/guzzle/promises/zipball/2e48ae638dc0bf0849772f5590835fcd700a2e1d", + "reference": "2e48ae638dc0bf0849772f5590835fcd700a2e1d", "shasum": "" }, "require": { @@ -172,7 +172,7 @@ "keywords": [ "promise" ], - "time": "2017-10-06T12:25:00+00:00" + "time": "2017-12-07T21:04:15+00:00" }, { "name": "guzzlehttp/psr7", @@ -241,20 +241,20 @@ }, { "name": "knplabs/github-api", - "version": "dev-master", + "version": "2.7.0", "source": { "type": "git", "url": "https://github.com/KnpLabs/php-github-api.git", - "reference": "13003af4d8f5abf8e55a8ad38a4eea4dfed5a513" + "reference": "d445f1eec4788763315c3c96a214db4e149f9deb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/KnpLabs/php-github-api/zipball/13003af4d8f5abf8e55a8ad38a4eea4dfed5a513", - "reference": "13003af4d8f5abf8e55a8ad38a4eea4dfed5a513", + "url": "https://api.github.com/repos/KnpLabs/php-github-api/zipball/d445f1eec4788763315c3c96a214db4e149f9deb", + "reference": "d445f1eec4788763315c3c96a214db4e149f9deb", "shasum": "" }, "require": { - "php": "^5.5 || ^7.0", + "php": "^5.6 || ^7.0", "php-http/cache-plugin": "^1.4", "php-http/client-common": "^1.3", "php-http/client-implementation": "^1.0", @@ -268,7 +268,7 @@ "guzzlehttp/psr7": "^1.2", "php-http/guzzle6-adapter": "^1.0", "php-http/mock-client": "^1.0", - "phpunit/phpunit": "^4.0 || ^5.5", + "phpunit/phpunit": "^5.5 || ^6.0", "sllh/php-cs-fixer-styleci-bridge": "^1.3" }, "type": "library", @@ -305,20 +305,20 @@ "gist", "github" ], - "time": "2017-10-13T06:47:44+00:00" + "time": "2017-12-12T20:14:04+00:00" }, { "name": "php-amqplib/php-amqplib", - "version": "v2.7.0", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/php-amqplib/php-amqplib.git", - "reference": "f48748546e398d846134c594dfca9070c4c3b356" + "reference": "0f90b3d8bc50403458f0eefbcba7d1e2329dd0f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-amqplib/php-amqplib/zipball/f48748546e398d846134c594dfca9070c4c3b356", - "reference": "f48748546e398d846134c594dfca9070c4c3b356", + "url": "https://api.github.com/repos/php-amqplib/php-amqplib/zipball/0f90b3d8bc50403458f0eefbcba7d1e2329dd0f6", + "reference": "0f90b3d8bc50403458f0eefbcba7d1e2329dd0f6", "shasum": "" }, "require": { @@ -375,7 +375,7 @@ "queue", "rabbitmq" ], - "time": "2017-08-03T22:06:21+00:00" + "time": "2017-09-26T05:30:15+00:00" }, { "name": "php-http/cache-plugin", @@ -383,12 +383,12 @@ "source": { "type": "git", "url": "https://github.com/php-http/cache-plugin.git", - "reference": "eef8c86e91af39d0d9323a921f55187ad8282194" + "reference": "c573ac6ea9b4e33fad567f875b844229d18000b9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/cache-plugin/zipball/eef8c86e91af39d0d9323a921f55187ad8282194", - "reference": "eef8c86e91af39d0d9323a921f55187ad8282194", + "url": "https://api.github.com/repos/php-http/cache-plugin/zipball/c573ac6ea9b4e33fad567f875b844229d18000b9", + "reference": "c573ac6ea9b4e33fad567f875b844229d18000b9", "shasum": "" }, "require": { @@ -396,7 +396,7 @@ "php-http/client-common": "^1.1", "php-http/message-factory": "^1.0", "psr/cache": "^1.0", - "symfony/options-resolver": "^2.6 || ^3.0" + "symfony/options-resolver": "^2.6 || ^3.0 || ^4.0" }, "require-dev": { "henrikbjorn/phpspec-code-coverage": "^1.0", @@ -431,7 +431,7 @@ "httplug", "plugin" ], - "time": "2017-07-31T06:46:14+00:00" + "time": "2017-11-29T20:45:41+00:00" }, { "name": "php-http/client-common", @@ -439,25 +439,24 @@ "source": { "type": "git", "url": "https://github.com/php-http/client-common.git", - "reference": "1901ad36347227c14751a218d8f4ea1467d1f1ed" + "reference": "9accb4a082eb06403747c0ffd444112eda41a0fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/client-common/zipball/1901ad36347227c14751a218d8f4ea1467d1f1ed", - "reference": "1901ad36347227c14751a218d8f4ea1467d1f1ed", + "url": "https://api.github.com/repos/php-http/client-common/zipball/9accb4a082eb06403747c0ffd444112eda41a0fd", + "reference": "9accb4a082eb06403747c0ffd444112eda41a0fd", "shasum": "" }, "require": { - "php": ">=5.4", + "php": "^5.4 || ^7.0", "php-http/httplug": "^1.1", "php-http/message": "^1.6", "php-http/message-factory": "^1.0", - "symfony/options-resolver": "^2.6 || ^3.0" + "symfony/options-resolver": "^2.6 || ^3.0 || ^4.0" }, "require-dev": { "guzzlehttp/psr7": "^1.4", - "henrikbjorn/phpspec-code-coverage": "^1.0", - "phpspec/phpspec": "^2.4" + "phpspec/phpspec": "^2.5 || ^3.4 || ^4.2" }, "suggest": { "php-http/cache-plugin": "PSR-6 Cache plugin", @@ -493,7 +492,7 @@ "http", "httplug" ], - "time": "2017-10-16T16:16:36+00:00" + "time": "2017-11-30T11:06:59+00:00" }, { "name": "php-http/discovery", @@ -501,12 +500,12 @@ "source": { "type": "git", "url": "https://github.com/php-http/discovery.git", - "reference": "d39a8798c473b6b896059a8de576598e4d17d992" + "reference": "0ecc08360e6011a4454dc60077db6e9f412be94c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/discovery/zipball/d39a8798c473b6b896059a8de576598e4d17d992", - "reference": "d39a8798c473b6b896059a8de576598e4d17d992", + "url": "https://api.github.com/repos/php-http/discovery/zipball/0ecc08360e6011a4454dc60077db6e9f412be94c", + "reference": "0ecc08360e6011a4454dc60077db6e9f412be94c", "shasum": "" }, "require": { @@ -555,7 +554,7 @@ "message", "psr7" ], - "time": "2017-09-13T14:06:45+00:00" + "time": "2017-11-22T21:17:04+00:00" }, { "name": "php-http/guzzle6-adapter", @@ -623,12 +622,12 @@ "source": { "type": "git", "url": "https://github.com/php-http/httplug.git", - "reference": "036f86f0cb1f37c13dd9b5e75b71866e7ab3f60b" + "reference": "afa7b216322f8157e21025f04f72eda0ee12f89d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/httplug/zipball/036f86f0cb1f37c13dd9b5e75b71866e7ab3f60b", - "reference": "036f86f0cb1f37c13dd9b5e75b71866e7ab3f60b", + "url": "https://api.github.com/repos/php-http/httplug/zipball/afa7b216322f8157e21025f04f72eda0ee12f89d", + "reference": "afa7b216322f8157e21025f04f72eda0ee12f89d", "shasum": "" }, "require": { @@ -671,7 +670,7 @@ "client", "http" ], - "time": "2017-08-18T18:51:51+00:00" + "time": "2017-12-18T08:01:36+00:00" }, { "name": "php-http/message", @@ -679,16 +678,16 @@ "source": { "type": "git", "url": "https://github.com/php-http/message.git", - "reference": "2edd63bae5f52f79363c5f18904b05ce3a4b7253" + "reference": "977edb516e3c0419d3477610b4b718c8a9da1575" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/message/zipball/2edd63bae5f52f79363c5f18904b05ce3a4b7253", - "reference": "2edd63bae5f52f79363c5f18904b05ce3a4b7253", + "url": "https://api.github.com/repos/php-http/message/zipball/977edb516e3c0419d3477610b4b718c8a9da1575", + "reference": "977edb516e3c0419d3477610b4b718c8a9da1575", "shasum": "" }, "require": { - "clue/stream-filter": "^1.3", + "clue/stream-filter": "^1.4", "php": ">=5.4", "php-http/message-factory": "^1.0.2", "psr/http-message": "^1.0" @@ -743,7 +742,7 @@ "message", "psr-7" ], - "time": "2017-07-05T06:40:53+00:00" + "time": "2017-11-25T06:38:46+00:00" }, { "name": "php-http/message-factory", @@ -801,12 +800,12 @@ "source": { "type": "git", "url": "https://github.com/php-http/promise.git", - "reference": "810b30da8bcf69e4b82c4b9bc6b31518234293ab" + "reference": "1cc44dc01402d407fc6da922591deebe4659826f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/promise/zipball/810b30da8bcf69e4b82c4b9bc6b31518234293ab", - "reference": "810b30da8bcf69e4b82c4b9bc6b31518234293ab", + "url": "https://api.github.com/repos/php-http/promise/zipball/1cc44dc01402d407fc6da922591deebe4659826f", + "reference": "1cc44dc01402d407fc6da922591deebe4659826f", "shasum": "" }, "require-dev": { @@ -843,7 +842,7 @@ "keywords": [ "promise" ], - "time": "2016-01-28T07:54:12+00:00" + "time": "2017-11-22T21:24:54+00:00" }, { "name": "psr/cache", @@ -943,25 +942,25 @@ }, { "name": "symfony/options-resolver", - "version": "3.4.x-dev", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "d0412a6676e80d5aea70f42ec964de77f61a3516" + "reference": "95a16ad04c0ca3404c9286eca3b4a0c36cc46f7d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/d0412a6676e80d5aea70f42ec964de77f61a3516", - "reference": "d0412a6676e80d5aea70f42ec964de77f61a3516", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/95a16ad04c0ca3404c9286eca3b4a0c36cc46f7d", + "reference": "95a16ad04c0ca3404c9286eca3b4a0c36cc46f7d", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^7.1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -993,1461 +992,10 @@ "configuration", "options" ], - "time": "2017-10-12T16:27:27+00:00" - } - ], - "packages-dev": [ - { - "name": "doctrine/instantiator", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "7af8066e48b8a4cbd90849bbe9234ab444057968" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/7af8066e48b8a4cbd90849bbe9234ab444057968", - "reference": "7af8066e48b8a4cbd90849bbe9234ab444057968", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "ext-pdo": "*", - "ext-phar": "*", - "phpunit/phpunit": "^6.2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", - "keywords": [ - "constructor", - "instantiate" - ], - "time": "2017-09-19T12:41:22+00:00" - }, - { - "name": "myclabs/deep-copy", - "version": "1.7.0", - "source": { - "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^4.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - }, - "files": [ - "src/DeepCopy/deep_copy.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Create deep copies (clones) of your objects", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "time": "2017-10-19T19:58:43+00:00" - }, - { - "name": "phar-io/manifest", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "014feadb268809af7c8e2f7ccd396b8494901f58" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/014feadb268809af7c8e2f7ccd396b8494901f58", - "reference": "014feadb268809af7c8e2f7ccd396b8494901f58", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-phar": "*", - "phar-io/version": "^1.0.1", - "php": "^5.6 || ^7.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": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "time": "2017-04-07T07:07:10+00:00" - }, - { - "name": "phar-io/version", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", - "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Library for handling version information and constraints", - "time": "2017-03-05T17:38:23+00:00" - }, - { - "name": "phpdocumentor/reflection-common", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", - "shasum": "" - }, - "require": { - "php": ">=5.5" - }, - "require-dev": { - "phpunit/phpunit": "^4.6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "time": "2017-09-11T18:02:19+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "4.1.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "2d3d238c433cf69caeb4842e97a3223a116f94b2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/2d3d238c433cf69caeb4842e97a3223a116f94b2", - "reference": "2d3d238c433cf69caeb4842e97a3223a116f94b2", - "shasum": "" - }, - "require": { - "php": "^7.0", - "phpdocumentor/reflection-common": "^1.0@dev", - "phpdocumentor/type-resolver": "^0.4.0", - "webmozart/assert": "^1.0" - }, - "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^4.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2017-08-30T18:51:59+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "0.4.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", - "shasum": "" - }, - "require": { - "php": "^5.5 || ^7.0", - "phpdocumentor/reflection-common": "^1.0" - }, - "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^5.2||^4.8.24" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "time": "2017-07-14T14:27:02+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6", - "reference": "c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6", - "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/recursion-context": "^1.0|^2.0|^3.0" - }, - "require-dev": { - "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8 || ^5.6.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.7.x-dev" - } - }, - "autoload": { - "psr-0": { - "Prophecy\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "time": "2017-09-04T11:05:03+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "77a1ba8076365f943e2a3d75573b6c9822840ac6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/77a1ba8076365f943e2a3d75573b6c9822840ac6", - "reference": "77a1ba8076365f943e2a3d75573b6c9822840ac6", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-xmlwriter": "*", - "php": "^7.0", - "phpunit/php-file-iterator": "^1.4.2", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^2.0", - "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^3.0", - "sebastian/version": "^2.0.1", - "theseer/tokenizer": "^1.1" - }, - "require-dev": { - "ext-xdebug": "^2.5", - "phpunit/phpunit": "^6.0" - }, - "suggest": { - "ext-xdebug": "^2.5.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "time": "2017-08-25T06:32:04+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "time": "2016-10-03T07:40:28+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "time": "2015-06-21T13:50:34+00:00" - }, - { - "name": "phpunit/php-timer", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "d107f347d368dd8a384601398280c7c608390ab7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/d107f347d368dd8a384601398280c7c608390ab7", - "reference": "d107f347d368dd8a384601398280c7c608390ab7", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "time": "2017-03-07T15:42:04+00:00" - }, - { - "name": "phpunit/php-token-stream", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "9a02332089ac48e704c70f6cefed30c224e3c0b0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/9a02332089ac48e704c70f6cefed30c224e3c0b0", - "reference": "9a02332089ac48e704c70f6cefed30c224e3c0b0", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.2.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "time": "2017-08-20T05:47:52+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "1ce64f90a27a563c9eeef8cf384aabfeddaf572a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/1ce64f90a27a563c9eeef8cf384aabfeddaf572a", - "reference": "1ce64f90a27a563c9eeef8cf384aabfeddaf572a", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "myclabs/deep-copy": "^1.6.1", - "phar-io/manifest": "^1.0.1", - "phar-io/version": "^1.0", - "php": "^7.0", - "phpspec/prophecy": "^1.7", - "phpunit/php-code-coverage": "^5.2.2", - "phpunit/php-file-iterator": "^1.4.2", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^1.0.9", - "phpunit/phpunit-mock-objects": "^4.0.3", - "sebastian/comparator": "^2.0.2", - "sebastian/diff": "^2.0", - "sebastian/environment": "^3.1", - "sebastian/exporter": "^3.1", - "sebastian/global-state": "^2.0", - "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^1.0", - "sebastian/version": "^2.0.1" - }, - "conflict": { - "phpdocumentor/reflection-docblock": "3.0.2", - "phpunit/dbunit": "<3.0" - }, - "require-dev": { - "ext-pdo": "*" - }, - "suggest": { - "ext-xdebug": "*", - "phpunit/php-invoker": "^1.1" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.5.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" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "time": "2017-10-23T05:05:42+00:00" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "2f789b59ab89669015ad984afa350c4ec577ade0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/2f789b59ab89669015ad984afa350c4ec577ade0", - "reference": "2f789b59ab89669015ad984afa350c4ec577ade0", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.5", - "php": "^7.0", - "phpunit/php-text-template": "^1.2.1", - "sebastian/exporter": "^3.0" - }, - "conflict": { - "phpunit/phpunit": "<6.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "suggest": { - "ext-soap": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "time": "2017-08-03T14:08:16+00:00" - }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "3488be0a7b346cd6e5361510ed07e88f9bea2e88" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/3488be0a7b346cd6e5361510ed07e88f9bea2e88", - "reference": "3488be0a7b346cd6e5361510ed07e88f9bea2e88", - "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-04T10:23:55+00:00" - }, - { - "name": "sebastian/comparator", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "7672f0c31b6ec068e3e941dc5025f822fe724b73" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/7672f0c31b6ec068e3e941dc5025f822fe724b73", - "reference": "7672f0c31b6ec068e3e941dc5025f822fe724b73", - "shasum": "" - }, - "require": { - "php": "^7.0", - "sebastian/diff": "^2.0", - "sebastian/exporter": "^3.1" - }, - "require-dev": { - "phpunit/phpunit": "^6.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "https://github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "time": "2017-10-16T04:35:48+00:00" - }, - { - "name": "sebastian/diff", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "376cb25efae48c66fb660c9ce7bc07e1682b5e84" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/376cb25efae48c66fb660c9ce7bc07e1682b5e84", - "reference": "376cb25efae48c66fb660c9ce7bc07e1682b5e84", - "shasum": "" - }, - "require": { - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff" - ], - "time": "2017-10-05T13:24:46+00:00" - }, - { - "name": "sebastian/environment", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", - "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", - "shasum": "" - }, - "require": { - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "time": "2017-07-01T08:51:00+00:00" - }, - { - "name": "sebastian/exporter", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", - "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", - "shasum": "" - }, - "require": { - "php": "^7.0", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "time": "2017-04-03T13:19:02+00:00" - }, - { - "name": "sebastian/global-state", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", - "shasum": "" - }, - "require": { - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "time": "2017-04-27T15:39:26+00:00" - }, - { - "name": "sebastian/object-enumerator", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", - "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", - "shasum": "" - }, - "require": { - "php": "^7.0", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.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": "2017-08-03T12:35:26+00:00" - }, - { - "name": "sebastian/object-reflector", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "773f97c67f28de00d397be301821b06708fca0be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", - "reference": "773f97c67f28de00d397be301821b06708fca0be", - "shasum": "" - }, - "require": { - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Allows reflection of object attributes, including inherited and non-public ones", - "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "time": "2017-03-29T09:07:27+00:00" - }, - { - "name": "sebastian/recursion-context", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "a0e54bc9bf04e2c5b302236984cebc277631f0f1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/a0e54bc9bf04e2c5b302236984cebc277631f0f1", - "reference": "a0e54bc9bf04e2c5b302236984cebc277631f0f1", - "shasum": "" - }, - "require": { - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2017-03-07T15:09:59+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "fadc83f7c41fb2924e542635fea47ae546816ece" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/fadc83f7c41fb2924e542635fea47ae546816ece", - "reference": "fadc83f7c41fb2924e542635fea47ae546816ece", - "shasum": "" - }, - "require": { - "php": ">=5.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": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2016-10-03T07:43:09+00:00" - }, - { - "name": "sebastian/version", - "version": "dev-master", - "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" - } - ], - "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" - }, - { - "name": "theseer/tokenizer", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b", - "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": "^7.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - } - ], - "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "time": "2017-04-07T12:08:54+00:00" - }, - { - "name": "webmozart/assert", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/webmozart/assert.git", - "reference": "4a8bf11547e139e77b651365113fc12850c43d9a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/4a8bf11547e139e77b651365113fc12850c43d9a", - "reference": "4a8bf11547e139e77b651365113fc12850c43d9a", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "time": "2016-11-23T20:04:41+00:00" + "time": "2017-12-14T19:50:39+00:00" } ], + "packages-dev": [], "aliases": [], "minimum-stability": "dev", "stability-flags": { diff --git a/php/mass-rebuild-filter.php b/php/mass-rebuild-filter.php index 92aa512..a73ba29 100644 --- a/php/mass-rebuild-filter.php +++ b/php/mass-rebuild-filter.php @@ -31,21 +31,6 @@ function runner($msg) { echo "Msg Sha: " . md5($msg->body) . "\n"; $in = json_decode($msg->body); - try { - $etype = \GHE\EventClassifier::classifyEvent($in); - - if ($etype != "pull_request") { - echo "Skipping event type: $etype\n"; - $msg->delivery_info['channel']->basic_ack($msg->delivery_info['delivery_tag']); - return true; - } - } catch (\GHE\EventClassifierUnknownException $e) { - echo "Skipping unknown event type\n"; - print_r($in); - $msg->delivery_info['channel']->basic_ack($msg->delivery_info['delivery_tag']); - return true; - } - if (!\GHE\ACL::isRepoEligible($in->repository->full_name)) { echo "Repo not authorized (" . $in->repository->full_name . ")\n"; $msg->delivery_info['channel']->basic_ack($msg->delivery_info['delivery_tag']); diff --git a/php/src/EventClassifier.php b/php/src/EventClassifier.php deleted file mode 100644 index 85ce1da..0000000 --- a/php/src/EventClassifier.php +++ /dev/null @@ -1,185 +0,0 @@ -issue) - && !isset($payload->comment) - && isset($payload->action) - && in_array($payload->action, - [ "assigned", "unassigned", "labeled", - "unlabeled", "opened", "edited", - "milestoned", "demilestoned", "closed", - "reopened" ]); - } - - public static function isIssueComment($payload) { - return isset($payload->issue) - && isset($payload->comment) - && isset($payload->action) - && in_array($payload->action, - ['created', 'edited', 'deleted']); - } - - public static function isCommitComment($payload) { - return !isset($payload->issue) - && !isset($payload->pull_request) - && isset($payload->comment) - && isset($payload->action); - } - - public static function isPullRequestReviewComment($payload) { - return !isset($payload->issue) - && isset($payload->pull_request) - && isset($payload->comment) - && isset($payload->action) - && in_array($payload->action, - ['created', 'edited', 'deleted']); - } - - public static function isPullRequestReviewEvent($payload) { - return isset($payload->review) - && isset($payload->pull_request) - && isset($payload->action) - && in_array($payload->action, - ['submitted', 'edited', 'dismissed']); - } - - public static function isPullRequestEvent($payload) { - return isset($payload->number) - && isset($payload->pull_request) - && isset($payload->action) - && in_array($payload->action, - [ "assigned", "unassigned", - "review_requested", - "review_request_removed", "labeled", - "unlabeled", "opened", "edited", "closed", - "reopened", "synchronize" ]); - } - - public static function isStatusEvent($payload) { - return isset($payload->sha) - && isset($payload->commit) - && isset($payload->state) - && in_array($payload->state, - ['pending', 'success', 'failure', 'error']); - - } - - public static function isPushEvent($payload) { - return isset($payload->before) - && isset($payload->after); - } - - public static function isWatchEvent($payload) { - return isset($payload->action) - && $payload->action == "started"; - } - - public static function isForkEvent($payload) { - return isset($payload->forkee); - } - - public static function isCreateEvent($payload) { - return isset($payload->ref_type) - && isset($payload->ref) - && isset($payload->master_branch); - } - - public static function isDeleteEvent($payload) { - return isset($payload->ref_type) - && isset($payload->ref) - && !isset($payload->master_branch); - } - - public static function isProjectEvent($payload) { - return isset($payload->project); - } - - public static function isProjectCardEvent($payload) { - return isset($payload->project_card); - } - - public static function isProjectColumnEvent($payload) { - return isset($payload->project_column); - } - - public static function isLabelEvent($payload) { - return isset($payload->label) - && isset($payload->action) - && in_array($payload->action, - ['created', 'edited', 'deleted']); - } - -} - -class EventClassifierUnknownException extends \Exception{}; \ No newline at end of file diff --git a/php/web/index.php b/php/web/index.php index 3af86bc..28209a7 100644 --- a/php/web/index.php +++ b/php/web/index.php @@ -1,44 +1,153 @@ channel(); +class DumpableException extends \Exception{} +class InvalidPayloadException extends DumpableException {} +class InvalidSignatureException extends DumpableException {} +class InvalidEventTypeException extends DumpableException {} +class ValidationFailureException extends DumpableException {} +class ExecutionFailureException extends DumpableException {} -$raw = file_get_contents('php://input'); -$input = json_decode($raw); -if (!isset($input->repository->full_name)) { - echo "no full_name set?"; - exit(); -} else { - echo "full_name present\n"; +function payload() { + if (!isset($_SERVER)) { + throw new InvalidPayloadException('_SERVER undefined'); + } + + if (!isset($_SERVER['CONTENT_TYPE'])) { + throw new InvalidPayloadException('CONTENT_TYPE not set in _SERVER'); + } + + switch ($_SERVER['CONTENT_TYPE']) { + case 'application/json': + $input = file_get_contents('php://input'); + if ($input === false) { + throw new InvalidPayloadException('Failed to read php://input for application/json'); + } else { + return $input; + } + case 'application/x-www-form-urlencoded': + if (!isset($_POST)) { + throw new InvalidPayloadException('_POST undefined'); + } + + if (!isset($_POST['payload'])) { + throw new InvalidPayloadException('payload not set in _POST'); + } + + return $_POST['payload']; + default: + throw new InvalidPayloadException('Unsupported content type: ' . $_SERVER['HTTP_CONTENT_TYPE']); + } } -$name = strtolower($input->repository->full_name); -if (!GHE\ACL::isRepoEligible($name)) { - echo "repo not in ok name list"; - exit(1); -} else { - echo "full_name ok\n"; +function signature() { + if (!isset($_SERVER)) { + throw new InvalidSignatureException('_SERVER undefined'); + } + + if (!isset($_SERVER['HTTP_X_HUB_SIGNATURE'])) { + throw new InvalidSignatureException('HTTP_X_HUB_SIGNATURE absent from _SERVER'); + } + + return $_SERVER['HTTP_X_HUB_SIGNATURE']; } -$dec = $channel->exchange_declare('github-events', 'topic', false, true, false); +function event_type() { + if (!isset($_SERVER)) { + throw new InvalidEventTypeException('_SERVER undefined'); + } -$message = new AMQPMessage(json_encode($input), - array( - 'content_type' => 'application/json', - 'delivery_mode' => AMQPMessage::DELIVERY_MODE_PERSISTENT, - )); + if (!isset($_SERVER['HTTP_X_GITHUB_EVENT'])) { + throw new InvalidEventTypeException('HTTP_X_GITHUB_EVENT absent from _SERVER'); + } + + $type = trim($_SERVER['HTTP_X_GITHUB_EVENT']); + + if (strlen($type) === 0) { + throw new InvalidEventTypeException('After trimming, event type is zero-length'); + } + + return $type; +} + +function validate_payload_signature($secret, $payload, $signature) { + if (!extension_loaded('hash')) { + throw new ValidationFailureException('Missing hash extension'); + } + + $components = explode('=', $signature, 2); + if (count($components) != 2) { + throw new ValidationFailureException('Provided signature seems invalid after splitting on ='); + } + + $algo = $components[0]; + $provided_hash = $components[1]; + + if (!in_array($algo, hash_algos(), true)) { + throw new ValidationFailureException("Hash algorithm '$algo' is not supported by the extension."); + } + + $ok_algos = [ + 'sha1', + 'sha256', + 'sha512', + ]; + if (!in_array($algo, $ok_algos, true)) { + throw new ValidationFailureException("Hash algorithm '$algo' is not considered okay"); + } + + $calculated_hash = hash_hmac($algo, $payload, $secret); + + return hash_equals($provided_hash, $calculated_hash); +} try { - $etype = \GHE\EventClassifier::classifyEvent($input); -} catch (\GHE\EventClassifierUnknownException $e) { - $etype = "unknown"; -} + $raw = payload(); + if (!validate_payload_signature(gh_secret(), $raw, signature())) { + throw new ExecutionFailureException('Failed to validate signature'); + } -$routing_key = "$etype.$name"; -var_dump($routing_key); -$rec = $channel->basic_publish($message, 'github-events', $routing_key); + $input = json_decode($raw); + if ($input === null) { + throw new ExecutionFailureException('Failed to decode the JSON'); + } -echo "ok"; \ No newline at end of file + if (!isset($input->repository)) { + throw new\ExecutionFailureException('Dataset does not have a repository'); + } + + if (!isset($input->repository->full_name)) { + throw new ExecutionFailureException('Dataset repository does not have a name'); + } + + $name = strtolower($input->repository->full_name); + $eventtype = event_type(); + + $connection = rabbitmq_conn(); + $channel = $connection->channel(); + + $dec = $channel->exchange_declare('github-events', 'topic', false, true, false); + + $message = new AMQPMessage(json_encode($input), + array( + 'content_type' => 'application/json', + 'delivery_mode' => AMQPMessage::DELIVERY_MODE_PERSISTENT, + )); + + $routing_key = "$eventtype.$name"; + $rec = $channel->basic_publish($message, 'github-events', $routing_key); + + echo "ok"; +} catch (DumpableException $e) { + header($_SERVER["SERVER_PROTOCOL"]." 400 Eh", true, 400); + var_dump($e); + echo ob_get_clean(); +} catch (\Exception $e) { + header($_SERVER["SERVER_PROTOCOL"]." 400 Meh", true, 400); + var_dump(get_class($e)); + echo ob_get_clean(); +} \ No newline at end of file