From 7b655aaf18c36faa59f4ea8822ac60ac1d47a3f5 Mon Sep 17 00:00:00 2001 From: James Galecki Date: Thu, 1 Mar 2018 16:22:00 -0500 Subject: [PATCH 01/22] remove build.php --- build.php | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100755 build.php diff --git a/build.php b/build.php deleted file mode 100755 index 0ff45c1..0000000 --- a/build.php +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env php - ['PSR2'], - 'files' => ['src', 'tests', 'build.php'], -]; -$phpcsViolations = $phpcsCLI->process($phpcsArguments); -if ($phpcsViolations > 0) { - exit(1); -} - -$phpunitConfiguration = PHPUnit_Util_Configuration::getInstance(__DIR__ . '/phpunit.xml'); -$phpunitArguments = ['coverageHtml' => __DIR__ . '/coverage', 'configuration' => $phpunitConfiguration]; -$testRunner = new PHPUnit_TextUI_TestRunner(); -$result = $testRunner->doRun($phpunitConfiguration->getTestSuiteConfiguration(), $phpunitArguments, false); -if (!$result->wasSuccessful()) { - exit(1); -} - -$cloverCoverage = new PHP_CodeCoverage_Report_Clover(); -file_put_contents('clover.xml', $cloverCoverage->process($result->getCodeCoverage())); - -$coverageFactory = new PHP_CodeCoverage_Report_Factory(); -$coverageReport = $coverageFactory->create($result->getCodeCoverage()); -if ($coverageReport->getNumExecutedLines() !== $coverageReport->getNumExecutableLines()) { - file_put_contents('php://stderr', "Code coverage was NOT 100%\n"); - exit(1); -} - -echo "Code coverage was 100%\n"; From 3d3014c7d912752d35f29a5a50e6b5cd8b59c5d4 Mon Sep 17 00:00:00 2001 From: James Galecki Date: Thu, 1 Mar 2018 16:23:07 -0500 Subject: [PATCH 02/22] composer.lock changes --- .gitignore | 1 + composer.lock | 1773 ------------------------------------------------- 2 files changed, 1 insertion(+), 1773 deletions(-) delete mode 100644 composer.lock diff --git a/.gitignore b/.gitignore index f7a6152..cdaeadc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /coverage/ /vendor/ /clover.xml +composer.lock diff --git a/composer.lock b/composer.lock deleted file mode 100644 index 136d7e0..0000000 --- a/composer.lock +++ /dev/null @@ -1,1773 +0,0 @@ -{ - "_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", - "This file is @generated automatically" - ], - "hash": "0de0b0ff66ff7da021a69e383e85bfe9", - "content-hash": "7fef95dd5db326574413f9986fb72d3b", - "packages": [], - "packages-dev": [ - { - "name": "doctrine/instantiator", - "version": "1.0.5", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", - "shasum": "" - }, - "require": { - "php": ">=5.3,<8.0-DEV" - }, - "require-dev": { - "athletic/athletic": "~0.1.8", - "ext-pdo": "*", - "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.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": "2015-06-14 21:17:01" - }, - { - "name": "guzzle/guzzle", - "version": "v3.9.3", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle3.git", - "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle3/zipball/0645b70d953bc1c067bbc8d5bc53194706b628d9", - "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "php": ">=5.3.3", - "symfony/event-dispatcher": "~2.1" - }, - "replace": { - "guzzle/batch": "self.version", - "guzzle/cache": "self.version", - "guzzle/common": "self.version", - "guzzle/http": "self.version", - "guzzle/inflection": "self.version", - "guzzle/iterator": "self.version", - "guzzle/log": "self.version", - "guzzle/parser": "self.version", - "guzzle/plugin": "self.version", - "guzzle/plugin-async": "self.version", - "guzzle/plugin-backoff": "self.version", - "guzzle/plugin-cache": "self.version", - "guzzle/plugin-cookie": "self.version", - "guzzle/plugin-curlauth": "self.version", - "guzzle/plugin-error-response": "self.version", - "guzzle/plugin-history": "self.version", - "guzzle/plugin-log": "self.version", - "guzzle/plugin-md5": "self.version", - "guzzle/plugin-mock": "self.version", - "guzzle/plugin-oauth": "self.version", - "guzzle/service": "self.version", - "guzzle/stream": "self.version" - }, - "require-dev": { - "doctrine/cache": "~1.3", - "monolog/monolog": "~1.0", - "phpunit/phpunit": "3.7.*", - "psr/log": "~1.0", - "symfony/class-loader": "~2.1", - "zendframework/zend-cache": "2.*,<2.3", - "zendframework/zend-log": "2.*,<2.3" - }, - "suggest": { - "guzzlehttp/guzzle": "Guzzle 5 has moved to a new package name. The package you have installed, Guzzle 3, is deprecated." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.9-dev" - } - }, - "autoload": { - "psr-0": { - "Guzzle": "src/", - "Guzzle\\Tests": "tests/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Guzzle Community", - "homepage": "https://github.com/guzzle/guzzle/contributors" - } - ], - "description": "PHP HTTP client. This library is deprecated in favor of https://packagist.org/packages/guzzlehttp/guzzle", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ], - "time": "2015-03-18 18:23:50" - }, - { - "name": "myclabs/deep-copy", - "version": "1.5.1", - "source": { - "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "a8773992b362b58498eed24bf85005f363c34771" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/a8773992b362b58498eed24bf85005f363c34771", - "reference": "a8773992b362b58498eed24bf85005f363c34771", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "require-dev": { - "doctrine/collections": "1.*", - "phpunit/phpunit": "~4.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Create deep copies (clones) of your objects", - "homepage": "https://github.com/myclabs/DeepCopy", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "time": "2015-11-20 12:04:31" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "2.0.4", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "suggest": { - "dflydev/markdown": "~1.0", - "erusev/parsedown": "~1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "phpDocumentor": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" - } - ], - "time": "2015-02-03 12:10:50" - }, - { - "name": "phpspec/prophecy", - "version": "v1.6.0", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "3c91bdf81797d725b14cb62906f9a4ce44235972" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/3c91bdf81797d725b14cb62906f9a4ce44235972", - "reference": "3c91bdf81797d725b14cb62906f9a4ce44235972", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "~2.0", - "sebastian/comparator": "~1.1", - "sebastian/recursion-context": "~1.0" - }, - "require-dev": { - "phpspec/phpspec": "~2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.5.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": "2016-02-15 07:46:21" - }, - { - "name": "phpunit/php-code-coverage", - "version": "3.3.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "2431befdd451fac43fbcde94d1a92fb3b8b68f86" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2431befdd451fac43fbcde94d1a92fb3b8b68f86", - "reference": "2431befdd451fac43fbcde94d1a92fb3b8b68f86", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0", - "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", - "sebastian/environment": "^1.3.2", - "sebastian/version": "~1.0|~2.0" - }, - "require-dev": { - "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "~5" - }, - "suggest": { - "ext-dom": "*", - "ext-xdebug": ">=2.4.0", - "ext-xmlwriter": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3.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": "2016-04-08 08:14:53" - }, - { - "name": "phpunit/php-file-iterator", - "version": "1.4.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0", - "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0", - "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": "2015-06-21 13:08:43" - }, - { - "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-21 13:50:34" - }, - { - "name": "phpunit/php-timer", - "version": "1.0.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260", - "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4|~5" - }, - "type": "library", - "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": "2016-05-12 18:03:57" - }, - { - "name": "phpunit/php-token-stream", - "version": "1.4.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", - "reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-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": "2015-09-15 10:49:45" - }, - { - "name": "phpunit/phpunit", - "version": "5.3.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "00dd95ffb48805503817ced06399017df315fe5c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/00dd95ffb48805503817ced06399017df315fe5c", - "reference": "00dd95ffb48805503817ced06399017df315fe5c", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "myclabs/deep-copy": "~1.3", - "php": "^5.6 || ^7.0", - "phpspec/prophecy": "^1.3.1", - "phpunit/php-code-coverage": "^3.3.0", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "^3.1", - "sebastian/comparator": "~1.1", - "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", - "symfony/yaml": "~2.1|~3.0" - }, - "suggest": { - "phpunit/php-invoker": "~1.1" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.3.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": "2016-05-11 13:28:45" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "3.1.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "151c96874bff6fe61a25039df60e776613a61489" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/151c96874bff6fe61a25039df60e776613a61489", - "reference": "151c96874bff6fe61a25039df60e776613a61489", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": ">=5.6", - "phpunit/php-text-template": "~1.2", - "sebastian/exporter": "~1.2" - }, - "require-dev": { - "phpunit/phpunit": "~5" - }, - "suggest": { - "ext-soap": "*" - }, - "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": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "time": "2016-04-20 14:39:26" - }, - { - "name": "psr/log", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", - "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", - "shasum": "" - }, - "type": "library", - "autoload": { - "psr-0": { - "Psr\\Log\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "time": "2012-12-21 11:40:51" - }, - { - "name": "satooshi/php-coveralls", - "version": "v0.6.1", - "source": { - "type": "git", - "url": "https://github.com/satooshi/php-coveralls.git", - "reference": "dd0df95bd37a7cf5c5c50304dfe260ffe4b50760" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/satooshi/php-coveralls/zipball/dd0df95bd37a7cf5c5c50304dfe260ffe4b50760", - "reference": "dd0df95bd37a7cf5c5c50304dfe260ffe4b50760", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "ext-json": "*", - "ext-simplexml": "*", - "guzzle/guzzle": ">=3.0", - "php": ">=5.3", - "psr/log": "1.0.0", - "symfony/config": ">=2.0", - "symfony/console": ">=2.0", - "symfony/stopwatch": ">=2.2", - "symfony/yaml": ">=2.0" - }, - "require-dev": { - "apigen/apigen": "2.8.*@stable", - "pdepend/pdepend": "dev-master", - "phpmd/phpmd": "dev-master", - "phpunit/php-invoker": ">=1.1.0,<1.2.0", - "phpunit/phpunit": "3.7.*@stable", - "sebastian/finder-facade": "dev-master", - "sebastian/phpcpd": "1.4.*@stable", - "squizlabs/php_codesniffer": "1.4.*@stable", - "theseer/fdomdocument": "dev-master" - }, - "bin": [ - "composer/bin/coveralls" - ], - "type": "library", - "autoload": { - "psr-0": { - "Contrib\\Component": "src/", - "Contrib\\Bundle": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Kitamura Satoshi", - "email": "with.no.parachute@gmail.com", - "homepage": "https://www.facebook.com/satooshi.jp" - } - ], - "description": "PHP client library for Coveralls API", - "homepage": "https://github.com/satooshi/php-coveralls", - "keywords": [ - "ci", - "coverage", - "github", - "test" - ], - "time": "2013-05-04 08:07:33" - }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "c36f5e7cfce482fde5bf8d10d41a53591e0198fe" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/c36f5e7cfce482fde5bf8d10d41a53591e0198fe", - "reference": "c36f5e7cfce482fde5bf8d10d41a53591e0198fe", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "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": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2016-02-13 06:45:14" - }, - { - "name": "sebastian/comparator", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "937efb279bd37a375bcadf584dec0726f84dbf22" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", - "reference": "937efb279bd37a375bcadf584dec0726f84dbf22", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.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": "http://www.github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "time": "2015-07-26 15:48:44" - }, - { - "name": "sebastian/diff", - "version": "1.4.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", - "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-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": "2015-12-08 07:14:41" - }, - { - "name": "sebastian/environment", - "version": "1.3.7", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/4e8f0da10ac5802913afc151413bc8c53b6c2716", - "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3.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": "2016-05-17 03:18:57" - }, - { - "name": "sebastian/exporter", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.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": "2015-06-21 07:55:53" - }, - { - "name": "sebastian/global-state", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "suggest": { - "ext-uopz": "*" - }, - "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": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "time": "2015-10-12 03:26:01" - }, - { - "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-28 13:25:10" - }, - { - "name": "sebastian/recursion-context", - "version": "1.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "913401df809e99e4f47b27cdd781f4a258d58791" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791", - "reference": "913401df809e99e4f47b27cdd781f4a258d58791", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "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": "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": "2015-11-11 19:50:13" - }, - { - "name": "sebastian/resource-operations", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", - "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": "2015-07-28 20:34:47" - }, - { - "name": "sebastian/version", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5", - "reference": "c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5", - "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-02-04 12:56:52" - }, - { - "name": "squizlabs/php_codesniffer", - "version": "2.6.0", - "source": { - "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "1bcdf03b068a530ac1962ce671dead356eeba43b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/1bcdf03b068a530ac1962ce671dead356eeba43b", - "reference": "1bcdf03b068a530ac1962ce671dead356eeba43b", - "shasum": "" - }, - "require": { - "ext-simplexml": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=5.1.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "bin": [ - "scripts/phpcs", - "scripts/phpcbf" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } - }, - "autoload": { - "classmap": [ - "CodeSniffer.php", - "CodeSniffer/CLI.php", - "CodeSniffer/Exception.php", - "CodeSniffer/File.php", - "CodeSniffer/Fixer.php", - "CodeSniffer/Report.php", - "CodeSniffer/Reporting.php", - "CodeSniffer/Sniff.php", - "CodeSniffer/Tokens.php", - "CodeSniffer/Reports/", - "CodeSniffer/Tokenizers/", - "CodeSniffer/DocGenerators/", - "CodeSniffer/Standards/AbstractPatternSniff.php", - "CodeSniffer/Standards/AbstractScopeSniff.php", - "CodeSniffer/Standards/AbstractVariableSniff.php", - "CodeSniffer/Standards/IncorrectPatternException.php", - "CodeSniffer/Standards/Generic/Sniffs/", - "CodeSniffer/Standards/MySource/Sniffs/", - "CodeSniffer/Standards/PEAR/Sniffs/", - "CodeSniffer/Standards/PSR1/Sniffs/", - "CodeSniffer/Standards/PSR2/Sniffs/", - "CodeSniffer/Standards/Squiz/Sniffs/", - "CodeSniffer/Standards/Zend/Sniffs/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Greg Sherwood", - "role": "lead" - } - ], - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "http://www.squizlabs.com/php-codesniffer", - "keywords": [ - "phpcs", - "standards" - ], - "time": "2016-04-03 22:58:34" - }, - { - "name": "symfony/config", - "version": "v3.0.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/config.git", - "reference": "24f155da1ff180df8e15e34a8f6e2f8a0eadefa8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/24f155da1ff180df8e15e34a8f6e2f8a0eadefa8", - "reference": "24f155da1ff180df8e15e34a8f6e2f8a0eadefa8", - "shasum": "" - }, - "require": { - "php": ">=5.5.9", - "symfony/filesystem": "~2.8|~3.0" - }, - "suggest": { - "symfony/yaml": "To use the yaml reference dumper" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Config\\": "" - }, - "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 Config Component", - "homepage": "https://symfony.com", - "time": "2016-04-20 18:53:54" - }, - { - "name": "symfony/console", - "version": "v3.0.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "34a214710e0714b6efcf40ba3cd1e31373a97820" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/34a214710e0714b6efcf40ba3cd1e31373a97820", - "reference": "34a214710e0714b6efcf40ba3cd1e31373a97820", - "shasum": "" - }, - "require": { - "php": ">=5.5.9", - "symfony/polyfill-mbstring": "~1.0" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.8|~3.0", - "symfony/process": "~2.8|~3.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/process": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "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 Console Component", - "homepage": "https://symfony.com", - "time": "2016-04-28 09:48:42" - }, - { - "name": "symfony/event-dispatcher", - "version": "v2.8.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "a158f13992a3147d466af7a23b564ac719a4ddd8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a158f13992a3147d466af7a23b564ac719a4ddd8", - "reference": "a158f13992a3147d466af7a23b564ac719a4ddd8", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.0,>=2.0.5|~3.0.0", - "symfony/dependency-injection": "~2.6|~3.0.0", - "symfony/expression-language": "~2.6|~3.0.0", - "symfony/stopwatch": "~2.3|~3.0.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - }, - "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 EventDispatcher Component", - "homepage": "https://symfony.com", - "time": "2016-05-03 18:59:18" - }, - { - "name": "symfony/filesystem", - "version": "v3.0.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "74fec3511b62cb934b64bce1d96f06fffa4beafd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/74fec3511b62cb934b64bce1d96f06fffa4beafd", - "reference": "74fec3511b62cb934b64bce1d96f06fffa4beafd", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - }, - "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 Filesystem Component", - "homepage": "https://symfony.com", - "time": "2016-04-12 18:09:53" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.2.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "dff51f72b0706335131b00a7f49606168c582594" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/dff51f72b0706335131b00a7f49606168c582594", - "reference": "dff51f72b0706335131b00a7f49606168c582594", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "time": "2016-05-18 14:26:46" - }, - { - "name": "symfony/stopwatch", - "version": "v3.0.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/stopwatch.git", - "reference": "6015187088421e9499d8f8316bdb396f8b806c06" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/6015187088421e9499d8f8316bdb396f8b806c06", - "reference": "6015187088421e9499d8f8316bdb396f8b806c06", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Stopwatch\\": "" - }, - "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 Stopwatch Component", - "homepage": "https://symfony.com", - "time": "2016-03-04 07:55:57" - }, - { - "name": "symfony/yaml", - "version": "v3.0.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "0047c8366744a16de7516622c5b7355336afae96" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/0047c8366744a16de7516622c5b7355336afae96", - "reference": "0047c8366744a16de7516622c5b7355336afae96", - "shasum": "" - }, - "require": { - "php": ">=5.5.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "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 Yaml Component", - "homepage": "https://symfony.com", - "time": "2016-03-04 07:55:57" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": "~5.6 || ~7.0" - }, - "platform-dev": [] -} From b797320f933076c9fac3396af5c727e36deab4e8 Mon Sep 17 00:00:00 2001 From: James Galecki Date: Thu, 1 Mar 2018 16:25:08 -0500 Subject: [PATCH 03/22] update composer.json --- composer.json | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 47803fb..2e0503e 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "dominionenterprises/util-http", + "name": "traderinteractive/util-http", "description": "A collection of http classes.", "keywords": ["utility", "http"], "authors": [ @@ -20,13 +20,16 @@ } ], "license": "MIT", + "config": { + "sort-packages": true + }, "require": { - "php": "~5.6 || ~7.0" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~5.0", - "satooshi/php-coveralls": "~0.6.1", - "squizlabs/php_codesniffer": "~2.0" + "php-coveralls/php-coveralls": "^1.0", + "phpunit/phpunit": "^6.0", + "squizlabs/php_codesniffer": "^3.2" }, "autoload": { "psr-4": { "DominionEnterprises\\": "src" } From 9542c992d36b7eb4e91334f3eda1248d9c809d56 Mon Sep 17 00:00:00 2001 From: James Galecki Date: Thu, 1 Mar 2018 16:25:34 -0500 Subject: [PATCH 04/22] update coveralls --- .coveralls.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.coveralls.yml b/.coveralls.yml index a343c9a..4eecff5 100644 --- a/.coveralls.yml +++ b/.coveralls.yml @@ -1,4 +1,3 @@ service_name: travis-ci -src_dir: . coverage_clover: clover.xml json_path: coveralls-upload.json From 02f018f9fc4cee77f5dc8d33d03f49cf9cb00bd4 Mon Sep 17 00:00:00 2001 From: James Galecki Date: Thu, 1 Mar 2018 16:27:45 -0500 Subject: [PATCH 05/22] update travis --- .travis.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 05b0850..36bdffb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,18 @@ sudo: false language: php php: - - 5.6 - - 7 - - hhvm -install: composer install + - 7.0 + - 7.1 + - 7.2 + - nightly +env: + - PREFER_LOWEST="--prefer-lowest --prefer-stable" + - PREFER_LOWEST="" +matrix: + fast_finish: true + allow_failures: + - php: nightly +before_script: + - composer update $PREFER_LOWEST script: ./vendor/bin/phpunit --coverage-clover clover.xml -after_success: sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then ./vendor/bin/coveralls -v; fi' +after_success: ./vendor/bin/coveralls -v From 76426e8436f720f87e54592bae59f5770b1d841b Mon Sep 17 00:00:00 2001 From: James Galecki Date: Thu, 1 Mar 2018 16:28:23 -0500 Subject: [PATCH 06/22] move phpunit files --- .gitignore | 1 + phpunit.xml => phpunit.xml.dist | 0 2 files changed, 1 insertion(+) rename phpunit.xml => phpunit.xml.dist (100%) diff --git a/.gitignore b/.gitignore index cdaeadc..fb27267 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /vendor/ /clover.xml composer.lock +phpunit.xml diff --git a/phpunit.xml b/phpunit.xml.dist similarity index 100% rename from phpunit.xml rename to phpunit.xml.dist From 61bdb07a1070d9b0dc539e388bba2f49a2692402 Mon Sep 17 00:00:00 2001 From: James Galecki Date: Thu, 1 Mar 2018 16:29:35 -0500 Subject: [PATCH 07/22] phpunit passing --- tests/HttpExceptionTest.php | 4 +++- tests/Util/HttpTest.php | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/HttpExceptionTest.php b/tests/HttpExceptionTest.php index 24d887e..22e2219 100644 --- a/tests/HttpExceptionTest.php +++ b/tests/HttpExceptionTest.php @@ -5,10 +5,12 @@ namespace DominionEnterprises; +use PHPUnit\Framework\TestCase; + /** * @coversDefaultClass \DominionEnterprises\HttpException */ -final class HttpExceptionTest extends \PHPUnit_Framework_TestCase +final class HttpExceptionTest extends TestCase { /** * @test diff --git a/tests/Util/HttpTest.php b/tests/Util/HttpTest.php index f7c139a..117cf7b 100644 --- a/tests/Util/HttpTest.php +++ b/tests/Util/HttpTest.php @@ -1,10 +1,13 @@ Date: Thu, 1 Mar 2018 16:30:17 -0500 Subject: [PATCH 08/22] phpcs update --- phpcs.xml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 phpcs.xml diff --git a/phpcs.xml b/phpcs.xml new file mode 100644 index 0000000..a93990e --- /dev/null +++ b/phpcs.xml @@ -0,0 +1,8 @@ + + + . + */vendor/* + + + + From b10a98673129d1a8a5168c9cb13aed0301270342 Mon Sep 17 00:00:00 2001 From: James Galecki Date: Thu, 1 Mar 2018 16:31:54 -0500 Subject: [PATCH 09/22] scrutinizer adjust --- .scrutinizer.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 214d92b..a92719a 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -1,7 +1,6 @@ filter: excluded_paths: - 'vendor/*' - - 'tests/*' before_commands: - 'composer install' tools: @@ -14,7 +13,6 @@ tools: php_loc: excluded_dirs: - vendor - - tests php_pdepend: true php_sim: true build_failure_conditions: From 6c239dd82446cd2eb00b364104b4c0f288dfd015 Mon Sep 17 00:00:00 2001 From: James Galecki Date: Thu, 1 Mar 2018 16:38:57 -0500 Subject: [PATCH 10/22] update to php7 --- src/HttpException.php | 44 +++++++++++++++---------------- src/Util/Http.php | 36 ++++++++++++------------- tests/HttpExceptionTest.php | 48 +--------------------------------- tests/Util/HttpTest.php | 52 ++++--------------------------------- 4 files changed, 45 insertions(+), 135 deletions(-) diff --git a/src/HttpException.php b/src/HttpException.php index a221353..b83956b 100644 --- a/src/HttpException.php +++ b/src/HttpException.php @@ -1,16 +1,16 @@ httpStatusCode; } @@ -78,7 +78,7 @@ public function getHttpStatusCode() * * @return string the user message */ - public function getUserMessage() + public function getUserMessage() : string { return $this->userMessage; } diff --git a/src/Util/Http.php b/src/Util/Http.php index f608268..de74577 100644 --- a/src/Util/Http.php +++ b/src/Util/Http.php @@ -1,11 +1,9 @@ $parameterValue) { @@ -157,13 +155,13 @@ public static function buildQueryString(array $parameters) * * @return array such as ['id' => ['boo'], 'another' => ['wee', 'boo']] * - * @throws \InvalidArgumentException if $url was not a string - * @throws \Exception if more than one value in a $collapsedParams param + * @throws InvalidArgumentException if $url was not a string + * @throws Exception if more than one value in a $collapsedParams param */ - public static function getQueryParams($url, array $collapsedParams = []) + public static function getQueryParams(string $url, array $collapsedParams = []) : array { if (!is_string($url)) { - throw new \InvalidArgumentException('$url was not a string'); + throw new InvalidArgumentException('$url was not a string'); } $queryString = parse_url($url, PHP_URL_QUERY); @@ -196,7 +194,7 @@ public static function getQueryParams($url, array $collapsedParams = []) } if ($collapsed) { - throw new \Exception("Parameter '{$name}' had more than one value but in \$collapsedParams"); + throw new Exception("Parameter '{$name}' had more than one value but in \$collapsedParams"); } $result[$name][] = $value; @@ -213,13 +211,13 @@ public static function getQueryParams($url, array $collapsedParams = []) * * @return array such as ['single' => 'boo', 'multi' => ['wee', 'boo']] if 'multi' is given in $expectedArrayParams * - * @throws \InvalidArgumentException if $url was not a string - * @throws \Exception if a parameter is given as array but not included in the expected array argument + * @throws InvalidArgumentException if $url was not a string + * @throws Exception if a parameter is given as array but not included in the expected array argument */ - public static function getQueryParamsCollapsed($url, array $expectedArrayParams = []) + public static function getQueryParamsCollapsed(string $url, array $expectedArrayParams = []) : array { if (!is_string($url)) { - throw new \InvalidArgumentException('$url was not a string'); + throw new InvalidArgumentException('$url was not a string'); } $queryString = parse_url($url, PHP_URL_QUERY); @@ -245,7 +243,7 @@ public static function getQueryParamsCollapsed($url, array $expectedArrayParams } if (!in_array($name, $expectedArrayParams)) { - throw new \Exception("Parameter '{$name}' is not expected to be an array, but array given"); + throw new Exception("Parameter '{$name}' is not expected to be an array, but array given"); } if (!is_array($result[$name])) { diff --git a/tests/HttpExceptionTest.php b/tests/HttpExceptionTest.php index 22e2219..5d84c89 100644 --- a/tests/HttpExceptionTest.php +++ b/tests/HttpExceptionTest.php @@ -1,10 +1,8 @@ fail('No exception thrown'); } catch (\Exception $e) { $this->assertSame('Unsupported header format: &some', $e->getMessage()); @@ -163,7 +148,7 @@ public function buildQueryStringComplexValues() } /** - * Verifies Mulit Parameter Method can handle a normal url + * Verifies Multi Parameter Method can handle a normal url * * @test * @group unit @@ -185,7 +170,7 @@ public function getQueryParamsNormal() } /** - * Verifies Mulit Parameter Method can handle a url with an empty parameter + * Verifies Multi Parameter Method can handle a url with an empty parameter * * @test * @group unit @@ -219,20 +204,6 @@ public function getQueryParamsGarbage() $this->assertSame([], Http::getQueryParams('GARBAGE')); } - /** - * @test - * @group unit - * @covers ::getQueryParams - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage $url was not a string - * - * @return void - */ - public function getQueryParamsUrlNotString() - { - Http::getQueryParams(1); - } - /** * @test * @covers ::getQueryParams @@ -285,19 +256,6 @@ public function getQueryParamsCollapsedUnexpectedArray() Http::getQueryParamsCollapsed($url); } - /** - * @test - * @covers ::getQueryParamsCollapsed - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage $url was not a string - * - * @return void - */ - public function getQueryParamsCollapsedUrlNotString() - { - Http::getQueryParamsCollapsed(1); - } - /** * Verifies multi parameter method with a garbage query string * @@ -306,13 +264,13 @@ public function getQueryParamsCollapsedUrlNotString() * * @return void */ - public function getQueryParamsCollaspedGarbage() + public function getQueryParamsCollapsedGarbage() { $this->assertSame([], Http::getQueryParamsCollapsed('GARBAGE')); } /** - * Verifies Mulit Parameter Method can handle a url with an empty parameter + * Verifies Multi Parameter Method can handle a url with an empty parameter * * @test * @covers ::getQueryParamsCollapsed From c298475d4d6564daab31ebdfa5f759d0d89adadd Mon Sep 17 00:00:00 2001 From: James Galecki Date: Thu, 1 Mar 2018 16:43:36 -0500 Subject: [PATCH 11/22] github files --- .gitattributes | 14 ++++++++++++++ .github | 1 + CONTRIBUTING.md | 15 --------------- README.md | 20 ++++++++++---------- 4 files changed, 25 insertions(+), 25 deletions(-) create mode 100644 .gitattributes create mode 160000 .github delete mode 100644 CONTRIBUTING.md diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..6f4c549 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,14 @@ +# Enforce Unix newlines +* text=lf + +# Exclude unused files +# see: https://redd.it/2jzp6k +/tests export-ignore +/.github export-ignore +/.gitattributes export-ignore +/.gitignore export-ignore +/.*.yml export-ignore +/phpcs.xml export-ignore +/phpunit.xml.dist export-ignore +/README.md export-ignore + diff --git a/.github b/.github new file mode 160000 index 0000000..a699624 --- /dev/null +++ b/.github @@ -0,0 +1 @@ +Subproject commit a69962491b290cf0ea284d053534e12b1d01d7ac diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 1063417..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,15 +0,0 @@ -# Contribution Guidelines -We welcome you to report [issues](https://github.com/dominionenterprises/util-http-php/issues) or submit -[pull requests](https://github.com/dominionenterprises/util-http-php/pulls). While the below guidelines are necessary to get code merged, you can -submit pull requests that do not adhere to them and we will try to take care of them in our spare time. We are a smallish group of developers, -though, so if you can make sure the build is passing 100%, that would be very useful. - -We recommend including details of your particular usecase(s) with any issues or pull requests. We love to hear how our libraries are being used -and we can get things merged in quicker when we understand its expected usage. - -## Building -Our [build](build.php) runs the code through our [coding standard](http://www.php-fig.org/psr/psr-2/) and through our -test suite. Failures in either will keep us from merging the pull request. The test suite MUST have 100% code coverage in the report. - -## Travis CI -Our [Travis build](https://travis-ci.org/dominionenterprises/util-http-php) executes the build above against pull requests. diff --git a/README.md b/README.md index 67ae913..ecc8d0b 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ # util-http-php -[![Build Status](https://travis-ci.org/dominionenterprises/util-http-php.svg?branch=master)](https://travis-ci.org/dominionenterprises/util-http-php) -[![Scrutinizer Code Quality](http://img.shields.io/scrutinizer/g/dominionenterprises/util-http-php.svg?style=flat)](https://scrutinizer-ci.com/g/dominionenterprises/util-http-php/) -[![Coverage Status](https://coveralls.io/repos/dominionenterprises/util-http-php/badge.svg?branch=master&service=github)](https://coveralls.io/github/dominionenterprises/util-http-php?branch=master) +[![Build Status](https://travis-ci.org/traderinteractive/util-http-php.svg?branch=master)](https://travis-ci.org/traderinteractive/util-http-php) +[![Scrutinizer Code Quality](http://img.shields.io/scrutinizer/g/traderinteractive/util-http-php.svg?style=flat)](https://scrutinizer-ci.com/g/traderinteractive/util-http-php/) +[![Coverage Status](https://coveralls.io/repos/traderinteractive/util-http-php/badge.svg?branch=master&service=github)](https://coveralls.io/github/traderinteractive/util-http-php?branch=master) -[![Latest Stable Version](http://img.shields.io/packagist/v/dominionenterprises/util-http.svg?style=flat)](https://packagist.org/packages/dominionenterprises/util-http) -[![Total Downloads](http://img.shields.io/packagist/dt/dominionenterprises/util-http.svg?style=flat)](https://packagist.org/packages/dominionenterprises/util-http) -[![License](http://img.shields.io/packagist/l/dominionenterprises/util-http.svg?style=flat)](https://packagist.org/packages/dominionenterprises/util-http) +[![Latest Stable Version](http://img.shields.io/packagist/v/traderinteractive/util-http.svg?style=flat)](https://packagist.org/packages/traderinteractive/util-http) +[![Total Downloads](http://img.shields.io/packagist/dt/traderinteractive/util-http.svg?style=flat)](https://packagist.org/packages/traderinteractive/util-http) +[![License](http://img.shields.io/packagist/l/traderinteractive/util-http.svg?style=flat)](https://packagist.org/packages/traderinteractive/util-http) A collection of general util-httpities for making common programming tasks easier. @@ -15,12 +15,12 @@ util-http-php requires PHP 5.4 (or later). ##Composer To add the library as a local, per-project dependency use [Composer](http://getcomposer.org)! Simply add a dependency on -`dominionenterprises/util-http` to your project's `composer.json` file such as: +`traderinteractive/util-http` to your project's `composer.json` file such as: ```json { "require": { - "dominionenterprises/util-http": "~1.0" + "traderinteractive/util-http": "~1.0" } } ``` @@ -30,8 +30,8 @@ Found in the [source](src) itself, take a look! ##Contact Developers may be contacted at: - * [Pull Requests](https://github.com/dominionenterprises/util-http-php/pulls) - * [Issues](https://github.com/dominionenterprises/util-http-php/issues) + * [Pull Requests](https://github.com/traderinteractive/util-http-php/pulls) + * [Issues](https://github.com/traderinteractive/util-http-php/issues) ##Project Build With a checkout of the code get [Composer](http://getcomposer.org) in your PATH and run: From 5715b927a0f7e50288321b98aa5906455baf40f3 Mon Sep 17 00:00:00 2001 From: James Galecki Date: Thu, 1 Mar 2018 16:44:19 -0500 Subject: [PATCH 12/22] added license --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..1939055 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2017 Trader Interactive + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From 7a3fbc4ed2e0b99526d1d0b90e77d31267495769 Mon Sep 17 00:00:00 2001 From: James Galecki Date: Thu, 1 Mar 2018 16:49:06 -0500 Subject: [PATCH 13/22] fix readme --- README.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ecc8d0b..a434db1 100644 --- a/README.md +++ b/README.md @@ -17,12 +17,8 @@ util-http-php requires PHP 5.4 (or later). To add the library as a local, per-project dependency use [Composer](http://getcomposer.org)! Simply add a dependency on `traderinteractive/util-http` to your project's `composer.json` file such as: -```json -{ - "require": { - "traderinteractive/util-http": "~1.0" - } -} +```sh +composer require traderinteractive/util-http ``` ##Documentation Found in the [source](src) itself, take a look! From b6ddf36ee5acb68e9c2fa1168cdae2d3e10444e3 Mon Sep 17 00:00:00 2001 From: James Galecki Date: Thu, 1 Mar 2018 17:06:18 -0500 Subject: [PATCH 14/22] scrutiny! --- src/Util/Http.php | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/src/Util/Http.php b/src/Util/Http.php index de74577..3df52b4 100644 --- a/src/Util/Http.php +++ b/src/Util/Http.php @@ -79,15 +79,13 @@ public static function parseHeaders(string $rawHeaders) : array continue; } - if (preg_match('#([A-Za-z]+) +([^ ]+) +HTTP/([\d.]+)#', $field, $match)) { - $headers['Request Method'] = trim($match[1]); - $headers['Request Url'] = trim($match[2]); + if (self::isRequest($field, $match)) { + $headers = self::setRequest($match, $headers); continue; } - if (preg_match('#HTTP/([\d.]+) +(\d{3}) +(.*)#', $field, $match)) { - $headers['Response Code'] = (int)$match[2]; - $headers['Response Status'] = trim($match[3]); + if (self::isResponse($field, $match)) { + $headers = self::setResponse($match, $headers); continue; } @@ -255,4 +253,28 @@ public static function getQueryParamsCollapsed(string $url, array $expectedArray return $result; } + + private static function setRequest($match, array $headers) : array + { + $headers['Request Method'] = trim($match[1]); + $headers['Request Url'] = trim($match[2]); + return $headers; + } + + private static function setResponse($match, array $headers) : array + { + $headers['Response Code'] = (int)$match[2]; + $headers['Response Status'] = trim($match[3]); + return $headers; + } + + private static function isResponse(string $field, array &$match) + { + return preg_match('#HTTP/([\d.]+) +(\d{3}) +(.*)#', $field, $match); + } + + private static function isRequest(string $field, array &$match) + { + return preg_match('#([A-Za-z]+) +([^ ]+) +HTTP/([\d.]+)#', $field, $match); + } } From 2f764b4bb3a3210943035f85b3160103a9e0b707 Mon Sep 17 00:00:00 2001 From: James Galecki Date: Fri, 2 Mar 2018 09:36:27 -0500 Subject: [PATCH 15/22] unrefactor --- src/Util/Http.php | 42 ++++++++++++++++-------------------------- 1 file changed, 16 insertions(+), 26 deletions(-) diff --git a/src/Util/Http.php b/src/Util/Http.php index 3df52b4..a7bae6c 100644 --- a/src/Util/Http.php +++ b/src/Util/Http.php @@ -79,12 +79,12 @@ public static function parseHeaders(string $rawHeaders) : array continue; } - if (self::isRequest($field, $match)) { + if (preg_match('#([A-Za-z]+) +([^ ]+) +HTTP/([\d.]+)#', $field, $match)) { $headers = self::setRequest($match, $headers); continue; } - if (self::isResponse($field, $match)) { + if (preg_match('#HTTP/([\d.]+) +(\d{3}) +(.*)#', $field, $match)) { $headers = self::setResponse($match, $headers); continue; } @@ -95,6 +95,20 @@ public static function parseHeaders(string $rawHeaders) : array return $headers; } + private static function setRequest($match, array $headers) : array + { + $headers['Request Method'] = trim($match[1]); + $headers['Request Url'] = trim($match[2]); + return $headers; + } + + private static function setResponse($match, array $headers) : array + { + $headers['Response Code'] = (int)$match[2]; + $headers['Response Status'] = trim($match[3]); + return $headers; + } + /** * Generate URL-encoded query string * @@ -253,28 +267,4 @@ public static function getQueryParamsCollapsed(string $url, array $expectedArray return $result; } - - private static function setRequest($match, array $headers) : array - { - $headers['Request Method'] = trim($match[1]); - $headers['Request Url'] = trim($match[2]); - return $headers; - } - - private static function setResponse($match, array $headers) : array - { - $headers['Response Code'] = (int)$match[2]; - $headers['Response Status'] = trim($match[3]); - return $headers; - } - - private static function isResponse(string $field, array &$match) - { - return preg_match('#HTTP/([\d.]+) +(\d{3}) +(.*)#', $field, $match); - } - - private static function isRequest(string $field, array &$match) - { - return preg_match('#([A-Za-z]+) +([^ ]+) +HTTP/([\d.]+)#', $field, $match); - } } From f31aead25767cf284f568f132daf5780764330c9 Mon Sep 17 00:00:00 2001 From: James Galecki Date: Mon, 5 Mar 2018 11:25:37 -0500 Subject: [PATCH 16/22] pr suggestions --- README.md | 18 +++++++++++++----- src/HttpException.php | 12 ------------ src/Util/Http.php | 8 ++------ 3 files changed, 15 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index a434db1..6dbf452 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # util-http-php + [![Build Status](https://travis-ci.org/traderinteractive/util-http-php.svg?branch=master)](https://travis-ci.org/traderinteractive/util-http-php) [![Scrutinizer Code Quality](http://img.shields.io/scrutinizer/g/traderinteractive/util-http-php.svg?style=flat)](https://scrutinizer-ci.com/g/traderinteractive/util-http-php/) [![Coverage Status](https://coveralls.io/repos/traderinteractive/util-http-php/badge.svg?branch=master&service=github)](https://coveralls.io/github/traderinteractive/util-http-php?branch=master) @@ -13,32 +14,39 @@ A collection of general util-httpities for making common programming tasks easie util-http-php requires PHP 5.4 (or later). -##Composer +## Composer + To add the library as a local, per-project dependency use [Composer](http://getcomposer.org)! Simply add a dependency on `traderinteractive/util-http` to your project's `composer.json` file such as: ```sh composer require traderinteractive/util-http ``` -##Documentation + +## Documentation + Found in the [source](src) itself, take a look! -##Contact +## Contact + Developers may be contacted at: * [Pull Requests](https://github.com/traderinteractive/util-http-php/pulls) * [Issues](https://github.com/traderinteractive/util-http-php/issues) -##Project Build +## Project Build + With a checkout of the code get [Composer](http://getcomposer.org) in your PATH and run: ```sh -./build.php +./vendor/bin/phpcs +./vendor/bin/phpunit ``` There is also a [docker](http://www.docker.com/)-based [fig](http://www.fig.sh/) configuration that will execute the build inside a docker container. This is an easy way to build the application: + ```sh fig run build ``` diff --git a/src/HttpException.php b/src/HttpException.php index b83956b..fb300dd 100644 --- a/src/HttpException.php +++ b/src/HttpException.php @@ -36,18 +36,6 @@ public function __construct( Exception $previous = null, string $userMessage = null ) { - if (!is_string($message)) { - throw new InvalidArgumentException('$message was not a string'); - } - - if (!is_int($httpStatusCode)) { - throw new InvalidArgumentException('$httpStatusCode was not an int'); - } - - if (!is_int($code)) { - throw new InvalidArgumentException('$code was not an int'); - } - if ($userMessage !== null && !is_string($userMessage)) { throw new InvalidArgumentException('$userMessage was not null and not a string'); } diff --git a/src/Util/Http.php b/src/Util/Http.php index a7bae6c..0e071d6 100644 --- a/src/Util/Http.php +++ b/src/Util/Http.php @@ -48,10 +48,6 @@ final class Http */ public static function parseHeaders(string $rawHeaders) : array { - if (!is_string($rawHeaders) || trim($rawHeaders) === '') { - throw new InvalidArgumentException('$rawHeaders was not a string'); - } - $headers = []; $rawHeaders = preg_replace("/\r\n[\t ]+/", ' ', trim($rawHeaders)); $fields = explode("\r\n", $rawHeaders); @@ -95,14 +91,14 @@ public static function parseHeaders(string $rawHeaders) : array return $headers; } - private static function setRequest($match, array $headers) : array + private static function setRequest(array $match, array $headers) : array { $headers['Request Method'] = trim($match[1]); $headers['Request Url'] = trim($match[2]); return $headers; } - private static function setResponse($match, array $headers) : array + private static function setResponse(array $match, array $headers) : array { $headers['Response Code'] = (int)$match[2]; $headers['Response Status'] = trim($match[3]); From 50494b09d7d87a61b33915027ffab8f2c39e4806 Mon Sep 17 00:00:00 2001 From: James Galecki Date: Mon, 5 Mar 2018 11:26:23 -0500 Subject: [PATCH 17/22] readme fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6dbf452..59ddb29 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ A collection of general util-httpities for making common programming tasks easie ## Requirements -util-http-php requires PHP 5.4 (or later). +util-http-php requires PHP 7.0 (or later). ## Composer From 9ad26e26e2d2a35e82e13a256d32c0d8649379b2 Mon Sep 17 00:00:00 2001 From: James Galecki Date: Mon, 5 Mar 2018 12:50:35 -0500 Subject: [PATCH 18/22] pr suggestions --- src/HttpException.php | 10 ---------- src/Util/Http.php | 19 ++++--------------- 2 files changed, 4 insertions(+), 25 deletions(-) diff --git a/src/HttpException.php b/src/HttpException.php index fb300dd..6b33906 100644 --- a/src/HttpException.php +++ b/src/HttpException.php @@ -3,7 +3,6 @@ namespace DominionEnterprises; use Exception; -use InvalidArgumentException; /** * Exception to throw when an http status code should be included. @@ -23,11 +22,6 @@ final class HttpException extends Exception * @param int $code @see Exception::__construct() * @param Exception $previous @see Exception::__construct() * @param string|null $userMessage a nicer message to display to the user sans sensitive details - * - * @throws InvalidArgumentException if $message is not a string - * @throws InvalidArgumentException if $httpStatusCode is not an int - * @throws InvalidArgumentException if $code is not an int - * @throws InvalidArgumentException if $userMessage is not null and is not a string */ public function __construct( string $message = 'Application Error', @@ -36,10 +30,6 @@ public function __construct( Exception $previous = null, string $userMessage = null ) { - if ($userMessage !== null && !is_string($userMessage)) { - throw new InvalidArgumentException('$userMessage was not null and not a string'); - } - parent::__construct($message, $code, $previous); $this->httpStatusCode = $httpStatusCode; diff --git a/src/Util/Http.php b/src/Util/Http.php index 0e071d6..6f4ab4e 100644 --- a/src/Util/Http.php +++ b/src/Util/Http.php @@ -3,7 +3,6 @@ namespace DominionEnterprises\Util; use Exception; -use InvalidArgumentException; /** * Static class with various HTTP related functions. @@ -76,12 +75,12 @@ public static function parseHeaders(string $rawHeaders) : array } if (preg_match('#([A-Za-z]+) +([^ ]+) +HTTP/([\d.]+)#', $field, $match)) { - $headers = self::setRequest($match, $headers); + $headers = self::addRequestDataToHeaders($match, $headers); continue; } if (preg_match('#HTTP/([\d.]+) +(\d{3}) +(.*)#', $field, $match)) { - $headers = self::setResponse($match, $headers); + $headers = self::addResponseDataToHeaders($match, $headers); continue; } @@ -91,14 +90,14 @@ public static function parseHeaders(string $rawHeaders) : array return $headers; } - private static function setRequest(array $match, array $headers) : array + private static function addRequestDataToHeaders(array $match, array $headers) : array { $headers['Request Method'] = trim($match[1]); $headers['Request Url'] = trim($match[2]); return $headers; } - private static function setResponse(array $match, array $headers) : array + private static function addResponseDataToHeaders(array $match, array $headers) : array { $headers['Response Code'] = (int)$match[2]; $headers['Response Status'] = trim($match[3]); @@ -163,15 +162,10 @@ public static function buildQueryString(array $parameters) : string * * @return array such as ['id' => ['boo'], 'another' => ['wee', 'boo']] * - * @throws InvalidArgumentException if $url was not a string * @throws Exception if more than one value in a $collapsedParams param */ public static function getQueryParams(string $url, array $collapsedParams = []) : array { - if (!is_string($url)) { - throw new InvalidArgumentException('$url was not a string'); - } - $queryString = parse_url($url, PHP_URL_QUERY); if (!is_string($queryString)) { return []; @@ -219,15 +213,10 @@ public static function getQueryParams(string $url, array $collapsedParams = []) * * @return array such as ['single' => 'boo', 'multi' => ['wee', 'boo']] if 'multi' is given in $expectedArrayParams * - * @throws InvalidArgumentException if $url was not a string * @throws Exception if a parameter is given as array but not included in the expected array argument */ public static function getQueryParamsCollapsed(string $url, array $expectedArrayParams = []) : array { - if (!is_string($url)) { - throw new InvalidArgumentException('$url was not a string'); - } - $queryString = parse_url($url, PHP_URL_QUERY); if (!is_string($queryString)) { return []; From 8d78ae1c5ff183e90c8e8e7d9d224f0b15eff0ae Mon Sep 17 00:00:00 2001 From: James Galecki Date: Mon, 5 Mar 2018 13:23:37 -0500 Subject: [PATCH 19/22] re-namespace --- composer.json | 2 +- src/HttpException.php | 2 +- src/Util/Http.php | 6 +++--- tests/HttpExceptionTest.php | 4 ++-- tests/Util/HttpTest.php | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index 2e0503e..ca62d48 100644 --- a/composer.json +++ b/composer.json @@ -32,6 +32,6 @@ "squizlabs/php_codesniffer": "^3.2" }, "autoload": { - "psr-4": { "DominionEnterprises\\": "src" } + "psr-4": { "TraderInteractive\\": "src" } } } diff --git a/src/HttpException.php b/src/HttpException.php index 6b33906..a603f60 100644 --- a/src/HttpException.php +++ b/src/HttpException.php @@ -1,6 +1,6 @@ * The above example will output: *
@@ -115,7 +115,7 @@ private static function addResponseDataToHeaders(array $match, array $headers) :
      *   'param3' => false,
      * ];
      *
-     * $queryString = \DominionEnterprises\HttpUtil::buildQueryString($parameters);
+     * $queryString = \TraderInteractive\HttpUtil::buildQueryString($parameters);
      *
      * echo $queryString
      * 
diff --git a/tests/HttpExceptionTest.php b/tests/HttpExceptionTest.php
index 5d84c89..4659932 100644
--- a/tests/HttpExceptionTest.php
+++ b/tests/HttpExceptionTest.php
@@ -1,12 +1,12 @@
 
Date: Mon, 5 Mar 2018 14:05:23 -0500
Subject: [PATCH 20/22] remove github submodule

---
 .github | 1 -
 1 file changed, 1 deletion(-)
 delete mode 160000 .github

diff --git a/.github b/.github
deleted file mode 160000
index a699624..0000000
--- a/.github
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit a69962491b290cf0ea284d053534e12b1d01d7ac

From 14ee1bd5c801ba6efec1fa1f42f2ed9d72a22302 Mon Sep 17 00:00:00 2001
From: James Galecki 
Date: Mon, 5 Mar 2018 14:06:47 -0500
Subject: [PATCH 21/22] add .github folder

---
 .github/CODEOWNERS               |  1 +
 .github/CONTRIBUTING.md          | 24 ++++++++++++++++++++++++
 .github/ISSUE_TEMPLATE.md        |  6 ++++++
 .github/PULL_REQUEST_TEMPLATE.md |  9 +++++++++
 4 files changed, 40 insertions(+)
 create mode 100644 .github/CODEOWNERS
 create mode 100644 .github/CONTRIBUTING.md
 create mode 100644 .github/ISSUE_TEMPLATE.md
 create mode 100644 .github/PULL_REQUEST_TEMPLATE.md

diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
new file mode 100644
index 0000000..9a4b075
--- /dev/null
+++ b/.github/CODEOWNERS
@@ -0,0 +1 @@
+* @traderinteractive/opensource
diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
new file mode 100644
index 0000000..7da9b9f
--- /dev/null
+++ b/.github/CONTRIBUTING.md
@@ -0,0 +1,24 @@
+# Contribution Guidelines
+We welcome you to report [issues](/../../issues) or submit [pull requests](/../../pulls).  While the below guidelines are necessary to get code merged, you can
+submit pull requests that do not adhere to them and we will try to take care of them in our spare time.  We are a smallish group of developers,
+though, so if you can make sure the build is passing 100%, that would be very useful.
+
+We recommend including details of your particular usecase(s) with any issues or pull requests.  We love to hear how our libraries are being used
+and we can get things merged in quicker when we understand its expected usage.
+
+## Pull Requests
+Code changes should be sent through [GitHub Pull Requests](/../../pulls).  Before submitting the pull request, make sure that phpunit reports success
+by running:
+```sh
+./vendor/bin/phpunit
+```
+And there are not coding standard violations by running
+```sh
+./vendor/bin/phpcs
+```
+
+## Builds
+Our [Travis build](https://travis-ci.org/traderinteractive/util-http-php) executes [PHPUnit](http://www.phpunit.de) and uses [Coveralls](https://coveralls.io/) to enforce code coverage.
+While the build does not strictly enforce 100% code coverage, it will not allow coverage to drop below its current percentage.
+[Scrutinizer](https://scrutinizer-ci.com/) is used to ensure code quality and enforce the [coding standard](http://www.php-fig.org/psr/psr-2/).
+
diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md
new file mode 100644
index 0000000..4eef22e
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE.md
@@ -0,0 +1,6 @@
+## Expected Behavior
+
+## Actual Behavior
+
+## Steps to reproduce the behavior
+
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 0000000..c0d57b0
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,9 @@
+Fixes # .
+
+#### What does this PR do?
+
+#### Checklist
+- [  ] Pull request contains a clear definition of changes
+- [  ] Tests (either unit, integration, or acceptance) written and passing
+- [  ] Relevant documentation produced and/or updated
+

From 7c90640ae2e47d6a53496dd8ca3b800c6e904a6a Mon Sep 17 00:00:00 2001
From: James Galecki 
Date: Mon, 5 Mar 2018 14:16:20 -0500
Subject: [PATCH 22/22] ensure rawheaders is not whitespace

---
 src/Util/Http.php       |  5 +++++
 tests/Util/HttpTest.php | 17 +++++++++++++++++
 2 files changed, 22 insertions(+)

diff --git a/src/Util/Http.php b/src/Util/Http.php
index a27ac05..f839373 100644
--- a/src/Util/Http.php
+++ b/src/Util/Http.php
@@ -3,6 +3,7 @@
 namespace TraderInteractive\Util;
 
 use Exception;
+use InvalidArgumentException;
 
 /**
  * Static class with various HTTP related functions.
@@ -47,6 +48,10 @@ final class Http
      */
     public static function parseHeaders(string $rawHeaders) : array
     {
+        if (empty(trim($rawHeaders))) {
+            throw new InvalidArgumentException('$rawHeaders cannot be whitespace');
+        }
+
         $headers = [];
         $rawHeaders = preg_replace("/\r\n[\t ]+/", ' ', trim($rawHeaders));
         $fields = explode("\r\n", $rawHeaders);
diff --git a/tests/Util/HttpTest.php b/tests/Util/HttpTest.php
index c7b73a5..8a2e372 100644
--- a/tests/Util/HttpTest.php
+++ b/tests/Util/HttpTest.php
@@ -97,6 +97,23 @@ public function parseHeadersMethodAndUrlSet()
         $this->assertSame($expected, $result);
     }
 
+    /**
+     * Verifies that the rawHeaders string cannot be whitespace.
+     *
+     * @test
+     * @group unit
+     * @covers ::parseHeaders
+     *
+     * @expectedException \InvalidArgumentException
+     * @expectedExceptionMessage $rawHeaders cannot be whitespace
+     *
+     * @return void
+     */
+    public function parseHeadersWhitespace()
+    {
+        Http::parseHeaders('');
+    }
+
     /**
      * @test
      * @covers ::buildQueryString