diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..cd8eb86 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +; This file is for unifying the coding style for different editors and IDEs. +; More information at http://editorconfig.org + +root = true + +[*] +charset = utf-8 +indent_size = 4 +indent_style = space +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +trim_trailing_whitespace = false diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..7410f14 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,11 @@ +# Path-based git attributes +# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html + +# Ignore all test and documentation with "export-ignore". +/.gitattributes export-ignore +/.gitignore export-ignore +/.travis.yml export-ignore +/phpunit.xml.dist export-ignore +/.scrutinizer.yml export-ignore +/examples export-ignore +/tests export-ignore diff --git a/.gitignore b/.gitignore index 9363478..b9662e7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ -vendor/ -build/ -.idea/ +build +docs +vendor diff --git a/.travis.yml b/.travis.yml index fb9aed0..6a1c66b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,18 +1,36 @@ language: php +dist: trusty + php: - - 5.4 - - 5.5 - 5.6 + - 7.0 + - 7.1 + - 7.2 + - 7.3 + - 7.4 -branches: - only: - - master +env: + - 'BSON=0 MSGPACK=0' + - 'BSON=0 MSGPACK=1' + - 'BSON=mongo MSGPACK=0' + - 'BSON=mongodb MSGPACK=0' + - 'BSON=mongodb MSGPACK=1' before_script: - # Composer Setup - - composer self-update - - composer install --prefer-source --no-interaction --dev + - sh -c "if [ $MSGPACK -eq 1 -a $(phpenv version-name) \< 7.0 ]; then wget https://github.com/msgpack/msgpack-php/archive/php5.zip -O php-msgpack.zip && unzip php-msgpack.zip && mv msgpack-php-php5 msgpack-php; fi" + - sh -c "if [ $MSGPACK -eq 1 -a $(phpenv version-name) \> 6.0 ]; then wget https://github.com/msgpack/msgpack-php/archive/master.zip -O php-msgpack.zip && unzip php-msgpack.zip && mv msgpack-php-master msgpack-php; fi" + - sh -c "if [ $MSGPACK -eq 1 ]; then cd msgpack-php/ && phpize && ./configure && make && make install; fi" + - sh -c "if [ $MSGPACK -eq 1 ]; then echo \"extension=msgpack.so\" >> `php --ini | grep \"Loaded Configuration\" | sed -e \"s|.*:\s*||\"`; fi" + - sh -c "if [ $MSGPACK -eq 0 ]; then echo \"Not Installing MSGPack Extension\"; fi" + - sh -c "if [ $BSON = mongo -a $(phpenv version-name) \< 7.0 ]; then wget https://github.com/mongodb/mongo-php-driver-legacy/archive/master.zip -O php-mongo.zip && unzip php-mongo.zip; fi" + - sh -c "if [ $BSON = mongo -a $(phpenv version-name) \< 7.0 ]; then cd mongo-php-driver-legacy-master/ && phpize && ./configure && make && make install; fi" + - sh -c "if [ $BSON = mongo -a $(phpenv version-name) \< 7.0 ]; then echo \"extension=mongo.so\" >> `php --ini | grep \"Loaded Configuration\" | sed -e \"s|.*:\s*||\"`; fi" + - sh -c "if [ $BSON = mongodb ]; then git clone --depth=50 --recursive https://github.com/mongodb/mongo-php-driver/; fi" + - sh -c "if [ $BSON = mongodb ]; then cd mongo-php-driver/ && git submodule status --recursive && ./.travis.scripts/before_script.sh; fi" + - sh -c "if [ $BSON = 0 ]; then echo \"Not Installing Mongo or MongoDB Extension\"; fi" + - travis_retry composer self-update + - travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-source -after_script: - - php vendor/bin/coveralls +script: + - vendor/bin/phpunit diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..3d1c54e --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,32 @@ +# Contributing + +Contributions are **welcome** and will be fully **credited**. + +We accept contributions via Pull Requests on [Github](https://github.com/nathanmac/Parser). + + +## Pull Requests + +- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer). + +- **Add tests!** - Your patch won't be accepted if it doesn't have tests. + +- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date. + +- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option. + +- **Create feature branches** - Don't ask us to pull from your master branch. + +- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests. + +- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting. + + +## Running Tests + +``` bash +$ phpunit +``` + + +**Happy coding**! diff --git a/LICENSE.md b/LICENSE.md index 29c9928..42af652 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ -The MIT License (MIT) +MIT License -Copyright (c) 2014 Nathan Macnamara +Copyright (c) 2016 Nathan Macnamara Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 0bc409c..44af8cc 100644 --- a/README.md +++ b/README.md @@ -1,31 +1,29 @@ Parser ====== -[![License](http://img.shields.io/packagist/l/nathanmac/parser.svg)](https://github.com/nathanmac/Parser/blob/master/LICENSE.md) -[![Build Status](https://travis-ci.org/nathanmac/Parser.svg?branch=master)](https://travis-ci.org/nathanmac/Parser) -[![Coverage Status](https://coveralls.io/repos/nathanmac/Parser/badge.png?branch=master)](https://coveralls.io/r/nathanmac/Parser?branch=master) -[![Code Climate](https://codeclimate.com/github/nathanmac/Parser.png)](https://codeclimate.com/github/nathanmac/Parser) -[![Latest Stable Version](https://poser.pugx.org/nathanmac/parser/v/stable.svg)](https://packagist.org/packages/nathanmac/parser) -[![SensioLabsInsight](https://insight.sensiolabs.com/projects/c5bc4a3d-b954-4901-905f-cd49fb8c3986/mini.png)](https://insight.sensiolabs.com/projects/c5bc4a3d-b954-4901-905f-cd49fb8c3986) +[![Latest Version on Packagist](https://img.shields.io/packagist/v/nathanmac/Parser.svg?style=flat-square)](https://packagist.org/packages/nathanmac/parser) +[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md) +[![Build Status](https://img.shields.io/travis/nathanmac/Parser/master.svg?style=flat-square)](https://travis-ci.org/nathanmac/Parser) +[![Total Downloads](https://img.shields.io/packagist/dt/nathanmac/Parser.svg?style=flat-square)](https://packagist.org/packages/nathanmac/Parser) Simple PHP Parser Library for API Development, parse a post http payload into a php array. +Also see the [Responder](https://github.com/nathanmac/Responder) library for handling output. + Installation ------------ -Begin by installing this package through Composer. Edit your project's `composer.json` file to require `Nathanmac/Parser`. - - "require": { - "Nathanmac/Parser": "3.*" - } - -Next, update Composer from the Terminal: - - composer update +Begin by installing this package through Composer. From the Terminal: + composer require nathanmac/parser ### Laravel/Lumen Users +Laravel/Lumen Verison | Supported Library Verison +----------------------|-------------------------- +Laravel/Lumen 5+ | > 3.* +Laravel 4 | 2.* + #### Laravel Users (Adding the Service Provider) If you are a Laravel user, then there is a service provider that you can make use of to automatically prepare the bindings and such. @@ -34,8 +32,8 @@ Include the service provider within `app/config/app.php`. ```php 'providers' => [ - '...', - 'Nathanmac\Utilities\Parser\ParserServiceProvider' + ..., + Nathanmac\Utilities\Parser\ParserServiceProvider::class ]; ``` @@ -43,8 +41,8 @@ And, for convenience, add a facade alias to this same file at the bottom: ```php 'aliases' => [ - '...', - 'Parser' => 'Nathanmac\Utilities\Parser\Facades\Parser', + ..., + 'Parser' => Nathanmac\Utilities\Parser\Facades\Parser::class, ]; ``` @@ -58,37 +56,64 @@ If you are a Lumen user, then there is a service provider that you can make use $app->register('Nathanmac\Utilities\Parser\ParserServiceProvider'); ``` +Lumen users can also add the facade alias. + +```php +// bootstrap/app.php + +class_alias('Nathanmac\Utilities\Parser\Facades\Parser', 'Parser'); +``` + #### Using the Facade ```php public function index() { Parser::payload('application/json'); - + Parser::json($payload); // JSON > Array Parser::xml($payload); // XML > Array Parser::yaml($payload); // YAML > Array Parser::querystr($payload); // Query String > Array Parser::serialize($payload); // Serialized Object > Array - + Parser::bson($payload); // BSON > Array + Parser::msgpack($payload); // MSGPack > Array + Parser::all(); // Return all values - Parser::get('key', 'default value'); // Get value by key, set an optional default. Parser::has('key'); // Does a key exist, with value. + Parser::get('key', 'default value'); // Get value by key, set an optional default. Parser::only('id', 'name', 'email'); // Only return value from the selected keys. Parser::except('password'); // Don't return values from the selected keys. + Parser::mask($mask); // Return masked values (see Mask Function, below). } ``` +All the examples below assume you *aren't* using Laravel (or Lumen), and therefore don't have access to the facade. As with any other facade, instead of: + +```php +$parser = new Parser(); + +$parser->{$method}($payload); +``` + +just use: + +```php +Parser::{$method}($payload); +``` + Usage ----- -#### Parsing Functions +### Parsing Functions ```php $parser->json($payload); // JSON > Array $parser->xml($payload); // XML > Array $parser->yaml($payload); // YAML > Array $parser->querystr($payload); // Query String > Array $parser->serialize($payload); // Serialized Object > Array +$parser->bson($payload); // BSON > Array +$parser->msgpack($payload); // MSGPack > Array ``` #### Parse Input/Payload (PUT/POST) @@ -102,25 +127,84 @@ $parser->payload('application/json'); // Specifiy the content type ```php $parser = new Parser(); $parser->all(); // Return all values -$parser->get('key', 'default value'); // Get value by key, set an optional default. $parser->has('key'); // Does a key exist, with value. +$parser->get('key', 'default value'); // Get value by key, set an optional default. $parser->only('id', 'name', 'email'); // Only return value from the selected keys. $parser->except('password'); // Don't return values from the selected keys. +$parser->mask($mask); // Return masked values (see Mask Function, below). +``` + +#### Mask function +The mask function processes payload data using a configuration mask, thereby returning only a selected subset of the data. +It works just like the `only` method but with the added benefit of allowing you to specify a mask in the form of an array, +this means you can generate masks on-the-fly based on system and/or user defined conditions. + +##### Demo +###### Mask +Defining the mask, masks consist of basic array structure, for this particular example we have some rules for the data +to be returned they include: + - the title of the post + - all the body's for all the comments. + +```php +$mask = [ + 'post' => [ + 'title' => '*', + 'comments' => [ + 'body' => '*' + ] + ] +]; +``` + +###### Sample Payload +```json +{ + "post": { + "title": "Hello World", + "author": "John Smith", + "comments": [ + {"body": "This is a comment", "date": "2015-02-20"}, + {"body": "This is another comment", "date": "2015-05-09"} + ] + } +} +``` + +###### Applying the Mask +```php + $parser = new Parser(); + $output = $parser->mask($mask); +``` + +###### Output +This is the output generated as a result of applying the mask against the sample payload provided above. + +```php +$output = [ + 'post' => [ + 'title' => 'Hello World', + 'comments' => [ + ['body' => 'This is a comment'], + ['body' => 'This is another comment'] + ] + ] +]; ``` #### Wildcards/Special Keys (*, %, :first, :last, :index[0], :item[0]) ```php $parser = new Parser(); -$parser->get('message.*'); // Get value by key. (Wildcard key returns first item found) $parser->has('message.*'); // Does a key exist, with value. (Wildcard key returns first item found) -$parser->get('message.:first'); // Get value by key. (:first key returns first item found) +$parser->get('message.*'); // Get value by key. (Wildcard key returns first item found) $parser->has('message.:first'); // Does a key exist, with value. (:first key returns first item found) -$parser->get('message.:last'); // Get value by key. (:last key returns first item found) -$parser->has('message.:last'); // Does a key exist, with value. (:last key returns first item found) -$parser->get('message.:index[0]'); // Get value by key. (:index[0] key returns item at index 0) +$parser->get('message.:first'); // Get value by key. (:first key returns first item found) +$parser->has('message.:last'); // Does a key exist, with value. (:last key returns last item found) +$parser->get('message.:last'); // Get value by key. (:last key returns last item found) $parser->has('message.:index[0]'); // Does a key exist, with value. (:index[0] key returns item at index 0) -$parser->get('message.:item[0]'); // Get value by key. (:item[0] key returns item at index 0) +$parser->get('message.:index[0]'); // Get value by key. (:index[0] key returns item at index 0) $parser->has('message.:item[0]'); // Does a key exist, with value. (:item[0] key returns item at index 0) +$parser->get('message.:item[0]'); // Get value by key. (:item[0] key returns item at index 0) ``` #### Parse JSON @@ -142,8 +226,9 @@ $parsed = $parser->json(' $parser = new Parser(); $parsed = $parser->xml(' - - + + + Created 5 minutes ago Jack Smith Jane Doe Hello World @@ -183,6 +268,12 @@ $parser = new Parser(); $parsed = $parser->bson('BSON DATA HERE'); ``` +#### Parse MSGPack +```php +$parser = new Parser(); +$parsed = $parser->msgpack('MSGPACK DATA HERE'); +``` + Custom Parsers/Formatters ------------------------- @@ -194,7 +285,7 @@ use Nathanmac\Utilities\Parser\Formats\FormatInterface; /** * Custom Formatter */ - + class CustomFormatter implements FormatInterface { /** * Parse Payload Data @@ -208,15 +299,15 @@ class CustomFormatter implements FormatInterface { public function parse($payload) { $payload; // Raw payload data - + $output = // Process raw payload data to array - + return $output; // return array parsed data } } ``` -##### Using the CustomFormatter +### Using the CustomFormatter ```php use Acme\Formatters\CustomFormatter; @@ -225,13 +316,38 @@ $parser = new Parser(); $parsed = $parser->parse('RAW PAYLOAD DATA', new CustomFormatter()); ``` +### Autodetecting the CustomFormatter + +```php +use Acme\Formatters\CustomFormatter; + +$parser = new Parser(); +$parser->registerFormat('application/x-custom-format', 'Acme\Formatters\CustomFormatter'); +$parser->payload('application/x-custom-format'); +``` + Testing ------- -To test the library itself, run the PHPUnit tests: +To test the library itself, run the tests: - phpunit tests/ + composer test +Contributing +------------ + +Please see [CONTRIBUTING](CONTRIBUTING.md) for details. + +Credits +------- + +- [nathanmac](https://github.com/nathanmac) +- [All Contributors](../../contributors) + +License +------- + +The MIT License (MIT). Please see [License File](LICENSE.md) for more information. Appendix -------- @@ -262,6 +378,11 @@ BSON ---- application/bson > BSON +MSGPack +------- +application/msgpack > MSGPack +application/x-msgpack > MSGPack + MISC ---- application/vnd.php.serialized > Serialized Object diff --git a/apigen.neon b/apigen.neon deleted file mode 100644 index 0932f34..0000000 --- a/apigen.neon +++ /dev/null @@ -1,7 +0,0 @@ -source: - - src -destination: ./docs -templateTheme: bootstrap -title: PHP Parser -baseUrl: http://nathanmac.github.io/Parser -googleAnalytics: UA-58213797-1 diff --git a/composer.json b/composer.json index 4c8b1d3..b57580f 100644 --- a/composer.json +++ b/composer.json @@ -1,29 +1,54 @@ { "name": "nathanmac/parser", "description": "Simple PHP Parser Utility Library for API Development", - "keywords": ["parser", "json", "xml", "API"], + "keywords": [ + "parser", + "json", + "xml", + "API" + ], "homepage": "https://github.com/nathanmac/Parser", + "license": "MIT", "authors": [ { "name": "Nathan Macnamara", - "email": "nathan.macnamara@outlook.com" + "email": "hola@nathanmac.com" } ], - "license": "MIT", "require": { - "php": ">=5.2.0", - "illuminate/support": "~5.0", - "symfony/yaml": "2.6.*" + "php": ">=5.3.0", + "symfony/yaml": "~2.0|~3.0|~4.0|~5.0" }, "require-dev": { - "phpunit/phpunit": "4.*", + "illuminate/support": "~5.0|~6.0|~7.0", + "phpunit/phpunit": "4.*|5.*", "mockery/mockery": "0.9.3", - "satooshi/php-coveralls": "0.6.*" + "scrutinizer/ocular": "^1.1" }, "autoload": { "psr-4": { "Nathanmac\\Utilities\\Parser\\": "src/" } }, - "minimum-stability": "stable" + "autoload-dev": { + "psr-4": { + "Nathanmac\\Utilities\\Parser\\Test\\": "tests/" + } + }, + "scripts": { + "test": "phpunit" + }, + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + }, + "laravel": { + "providers": [ + "Nathanmac\\Utilities\\Parser\\ParserServiceProvider" + ], + "aliases": { + "Parser": "Nathanmac\\Utilities\\Parser\\Facades\\Parser" + } + } + } } diff --git a/composer.lock b/composer.lock index aa39bb0..1f8ab04 100644 --- a/composer.lock +++ b/composer.lock @@ -1,39 +1,43 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "803b6aa10849bb22b94245d8c8e4a8cd", + "content-hash": "d970f457903484965f1862deda8bbeb2", "packages": [ { - "name": "danielstjules/stringy", - "version": "1.9.0", + "name": "symfony/polyfill-ctype", + "version": "v1.14.0", "source": { "type": "git", - "url": "https://github.com/danielstjules/Stringy.git", - "reference": "3cf18e9e424a6dedc38b7eb7ef580edb0929461b" + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "fbdeaec0df06cf3d51c93de80c7eb76e271f5a38" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/danielstjules/Stringy/zipball/3cf18e9e424a6dedc38b7eb7ef580edb0929461b", - "reference": "3cf18e9e424a6dedc38b7eb7ef580edb0929461b", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/fbdeaec0df06cf3d51c93de80c7eb76e271f5a38", + "reference": "fbdeaec0df06cf3d51c93de80c7eb76e271f5a38", "shasum": "" }, "require": { - "ext-mbstring": "*", - "php": ">=5.3.0" + "php": ">=5.3.3" }, - "require-dev": { - "phpunit/phpunit": "~4.0" + "suggest": { + "ext-ctype": "For best performance" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.14-dev" + } + }, "autoload": { "psr-4": { - "Stringy\\": "src/" + "Symfony\\Polyfill\\Ctype\\": "" }, "files": [ - "src/Create.php" + "bootstrap.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -42,56 +46,64 @@ ], "authors": [ { - "name": "Daniel St. Jules", - "email": "danielst.jules@gmail.com", - "homepage": "http://www.danielstjules.com" + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "A string manipulation library with multibyte support", - "homepage": "https://github.com/danielstjules/Stringy", + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", "keywords": [ - "UTF", - "helpers", - "manipulation", - "methods", - "multibyte", - "string", - "utf-8", - "utility", - "utils" - ], - "time": "2015-02-10 06:19:18" + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2020-01-13T11:15:53+00:00" }, { - "name": "doctrine/inflector", - "version": "v1.0.1", + "name": "symfony/yaml", + "version": "v4.4.5", "source": { "type": "git", - "url": "https://github.com/doctrine/inflector.git", - "reference": "0bcb2e79d8571787f18b7eb036ed3d004908e604" + "url": "https://github.com/symfony/yaml.git", + "reference": "94d005c176db2080e98825d98e01e8b311a97a88" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/0bcb2e79d8571787f18b7eb036ed3d004908e604", - "reference": "0bcb2e79d8571787f18b7eb036ed3d004908e604", + "url": "https://api.github.com/repos/symfony/yaml/zipball/94d005c176db2080e98825d98e01e8b311a97a88", + "reference": "94d005c176db2080e98825d98e01e8b311a97a88", "shasum": "" }, "require": { - "php": ">=5.3.2" + "php": "^7.1.3", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "symfony/console": "<3.4" }, "require-dev": { - "phpunit/phpunit": "4.*" + "symfony/console": "^3.4|^4.0|^5.0" + }, + "suggest": { + "symfony/console": "For validating YAML files using the lint command" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "4.4-dev" } }, "autoload": { - "psr-0": { - "Doctrine\\Common\\Inflector\\": "lib/" - } + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -99,62 +111,51 @@ ], "authors": [ { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Common String Manipulations with regard to casing and singular/plural rules.", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "inflection", - "pluralize", - "singularize", - "string" - ], - "time": "2014-12-20 21:24:13" - }, + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2020-02-03T10:46:43+00:00" + } + ], + "packages-dev": [ { - "name": "illuminate/contracts", - "version": "v5.0.0", + "name": "doctrine/annotations", + "version": "v1.8.0", "source": { "type": "git", - "url": "https://github.com/illuminate/contracts.git", - "reference": "78f1dba092d5fcb6d3a19537662abe31c4d128fd" + "url": "https://github.com/doctrine/annotations.git", + "reference": "904dca4eb10715b92569fbcd79e201d5c349b6bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/contracts/zipball/78f1dba092d5fcb6d3a19537662abe31c4d128fd", - "reference": "78f1dba092d5fcb6d3a19537662abe31c4d128fd", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/904dca4eb10715b92569fbcd79e201d5c349b6bc", + "reference": "904dca4eb10715b92569fbcd79e201d5c349b6bc", "shasum": "" }, "require": { - "php": ">=5.4.0" + "doctrine/lexer": "1.*", + "php": "^7.1" + }, + "require-dev": { + "doctrine/cache": "1.*", + "phpunit/phpunit": "^7.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-master": "1.7.x-dev" } }, "autoload": { "psr-4": { - "Illuminate\\Contracts\\": "" + "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" } }, "notification-url": "https://packagist.org/downloads/", @@ -163,50 +164,65 @@ ], "authors": [ { - "name": "Taylor Otwell", - "email": "taylorotwell@gmail.com" + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" } ], - "description": "The Illuminate Contracts package.", - "time": "2015-01-30 16:27:08" + "description": "Docblock Annotations Parser", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "annotations", + "docblock", + "parser" + ], + "time": "2019-10-01T18:55:10+00:00" }, { - "name": "illuminate/support", - "version": "v5.0.28", + "name": "doctrine/inflector", + "version": "1.3.1", "source": { "type": "git", - "url": "https://github.com/illuminate/support.git", - "reference": "b6d68e1f2a7053bf4c755c5e6b15fcfb700e14e7" + "url": "https://github.com/doctrine/inflector.git", + "reference": "ec3a55242203ffa6a4b27c58176da97ff0a7aec1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/support/zipball/b6d68e1f2a7053bf4c755c5e6b15fcfb700e14e7", - "reference": "b6d68e1f2a7053bf4c755c5e6b15fcfb700e14e7", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/ec3a55242203ffa6a4b27c58176da97ff0a7aec1", + "reference": "ec3a55242203ffa6a4b27c58176da97ff0a7aec1", "shasum": "" }, "require": { - "danielstjules/stringy": "~1.8", - "doctrine/inflector": "~1.0", - "ext-mbstring": "*", - "illuminate/contracts": "5.0.*", - "php": ">=5.4.0" + "php": "^7.1" }, - "suggest": { - "jeremeamia/superclosure": "Required to be able to serialize closures (~2.0)." + "require-dev": { + "phpunit/phpunit": "^6.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { "psr-4": { - "Illuminate\\Support\\": "" - }, - "files": [ - "helpers.php" - ] + "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -214,41 +230,71 @@ ], "authors": [ { - "name": "Taylor Otwell", - "email": "taylorotwell@gmail.com" + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" } ], - "description": "The Illuminate Support package.", - "homepage": "http://laravel.com", - "time": "2015-04-15 19:26:55" + "description": "Common String Manipulations with regard to casing and singular/plural rules.", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "inflection", + "pluralize", + "singularize", + "string" + ], + "time": "2019-10-30T19:59:35+00:00" }, { - "name": "symfony/yaml", - "version": "v2.4.10", - "target-dir": "Symfony/Component/Yaml", + "name": "doctrine/instantiator", + "version": "1.3.0", "source": { "type": "git", - "url": "https://github.com/symfony/Yaml.git", - "reference": "297fd84aa9377e54268e9ff74cb81377350e230f" + "url": "https://github.com/doctrine/instantiator.git", + "reference": "ae466f726242e637cebdd526a7d991b9433bacf1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/297fd84aa9377e54268e9ff74cb81377350e230f", - "reference": "297fd84aa9377e54268e9ff74cb81377350e230f", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/ae466f726242e637cebdd526a7d991b9433bacf1", + "reference": "ae466f726242e637cebdd526a7d991b9433bacf1", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.1" + }, + "require-dev": { + "doctrine/coding-standard": "^6.0", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^0.13", + "phpstan/phpstan-phpunit": "^0.11", + "phpstan/phpstan-shim": "^0.11", + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.4-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { - "psr-0": { - "Symfony\\Component\\Yaml\\": "" + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" } }, "notification-url": "https://packagist.org/downloads/", @@ -257,53 +303,50 @@ ], "authors": [ { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" } ], - "description": "Symfony Yaml Component", - "homepage": "http://symfony.com", - "time": "2014-09-22 08:51:05" - } - ], - "packages-dev": [ + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2019-10-21T16:45:58+00:00" + }, { - "name": "doctrine/instantiator", - "version": "1.0.4", + "name": "doctrine/lexer", + "version": "1.2.0", "source": { "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "f976e5de371104877ebc89bd8fecb0019ed9c119" + "url": "https://github.com/doctrine/lexer.git", + "reference": "5242d66dbeb21a30dd8a3e66bf7a73b66e05e1f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/f976e5de371104877ebc89bd8fecb0019ed9c119", - "reference": "f976e5de371104877ebc89bd8fecb0019ed9c119", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/5242d66dbeb21a30dd8a3e66bf7a73b66e05e1f6", + "reference": "5242d66dbeb21a30dd8a3e66bf7a73b66e05e1f6", "shasum": "" }, "require": { - "php": ">=5.3,<8.0-DEV" + "php": "^7.2" }, "require-dev": { - "athletic/athletic": "~0.1.8", - "ext-pdo": "*", - "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "2.0.*@ALPHA" + "doctrine/coding-standard": "^6.0", + "phpstan/phpstan": "^0.11.8", + "phpunit/phpunit": "^8.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { - "psr-0": { - "Doctrine\\Instantiator\\": "src" + "psr-4": { + "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" } }, "notification-url": "https://packagist.org/downloads/", @@ -312,85 +355,71 @@ ], "authors": [ { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" } ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", + "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "https://www.doctrine-project.org/projects/lexer.html", "keywords": [ - "constructor", - "instantiate" + "annotations", + "docblock", + "lexer", + "parser", + "php" ], - "time": "2014-10-13 12:58:55" + "time": "2019-10-30T14:39:59+00:00" }, { - "name": "guzzle/guzzle", - "version": "v3.9.3", + "name": "guzzlehttp/guzzle", + "version": "6.5.2", "source": { "type": "git", - "url": "https://github.com/guzzle/guzzle3.git", - "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9" + "url": "https://github.com/guzzle/guzzle.git", + "reference": "43ece0e75098b7ecd8d13918293029e555a50f82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle3/zipball/0645b70d953bc1c067bbc8d5bc53194706b628d9", - "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/43ece0e75098b7ecd8d13918293029e555a50f82", + "reference": "43ece0e75098b7ecd8d13918293029e555a50f82", "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" + "ext-json": "*", + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.6.1", + "php": ">=5.5" }, "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" + "ext-curl": "*", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", + "psr/log": "^1.1" }, "suggest": { - "guzzlehttp/guzzle": "Guzzle 5 has moved to a new package name. The package you have installed, Guzzle 3, is deprecated." + "ext-intl": "Required for Internationalized Domain Name (IDN) support", + "psr/log": "Required for using the Log middleware" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.9-dev" + "dev-master": "6.5-dev" } }, "autoload": { - "psr-0": { - "Guzzle": "src/", - "Guzzle\\Tests": "tests/" - } + "psr-4": { + "GuzzleHttp\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -401,13 +430,9 @@ "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", + "description": "Guzzle is a PHP HTTP client library", "homepage": "http://guzzlephp.org/", "keywords": [ "client", @@ -418,218 +443,1215 @@ "rest", "web service" ], - "time": "2015-03-18 18:23:50" + "time": "2019-12-23T11:57:10+00:00" }, { - "name": "mockery/mockery", - "version": "0.9.3", + "name": "guzzlehttp/promises", + "version": "v1.3.1", "source": { "type": "git", - "url": "https://github.com/padraic/mockery.git", - "reference": "686f85fa5b3b079cc0157d7cd3e9adb97f0b41e1" + "url": "https://github.com/guzzle/promises.git", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/padraic/mockery/zipball/686f85fa5b3b079cc0157d7cd3e9adb97f0b41e1", - "reference": "686f85fa5b3b079cc0157d7cd3e9adb97f0b41e1", + "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", "shasum": "" }, "require": { - "lib-pcre": ">=7.0", - "php": ">=5.3.2" + "php": ">=5.5.0" }, "require-dev": { - "hamcrest/hamcrest-php": "~1.1", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "~0.7@dev" + "phpunit/phpunit": "^4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "0.9.x-dev" + "dev-master": "1.4-dev" } }, "autoload": { - "psr-0": { - "Mockery": "library/" - } + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Pádraic Brady", - "email": "padraic.brady@gmail.com", - "homepage": "http://blog.astrumfutura.com" - }, - { - "name": "Dave Marshall", - "email": "dave.marshall@atstsolutions.co.uk", - "homepage": "http://davedevelopment.co.uk" + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" } ], - "description": "Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succint API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL). Designed as a drop in alternative to PHPUnit's phpunit-mock-objects library, Mockery is easy to integrate with PHPUnit and can operate alongside phpunit-mock-objects without the World ending.", - "homepage": "http://github.com/padraic/mockery", + "description": "Guzzle promises library", "keywords": [ - "BDD", - "TDD", - "library", - "mock", - "mock objects", - "mockery", - "stub", - "test", - "test double", - "testing" + "promise" ], - "time": "2014-12-22 10:06:19" + "time": "2016-12-20T10:07:11+00:00" }, { - "name": "phpdocumentor/reflection-docblock", - "version": "2.0.4", + "name": "guzzlehttp/psr7", + "version": "1.6.1", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" + "url": "https://github.com/guzzle/psr7.git", + "reference": "239400de7a173fe9901b9ac7c06497751f00727a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/239400de7a173fe9901b9ac7c06497751f00727a", + "reference": "239400de7a173fe9901b9ac7c06497751f00727a", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.4.0", + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "ext-zlib": "*", + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" }, "suggest": { - "dflydev/markdown": "~1.0", - "erusev/parsedown": "~1.0" + "zendframework/zend-httphandlerrunner": "Emit PSR-7 responses" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "1.6-dev" } }, "autoload": { - "psr-0": { - "phpDocumentor": [ - "src/" + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "time": "2019-07-01T23:21:34+00:00" + }, + { + "name": "illuminate/contracts", + "version": "v7.0.8", + "source": { + "type": "git", + "url": "https://github.com/illuminate/contracts.git", + "reference": "d806109dfee7b44b3633d0562aa4575c1365e0b1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/contracts/zipball/d806109dfee7b44b3633d0562aa4575c1365e0b1", + "reference": "d806109dfee7b44b3633d0562aa4575c1365e0b1", + "shasum": "" + }, + "require": { + "php": "^7.2.5", + "psr/container": "^1.0", + "psr/simple-cache": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "7.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Contracts\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Contracts package.", + "homepage": "https://laravel.com", + "time": "2020-03-06T01:34:22+00:00" + }, + { + "name": "illuminate/support", + "version": "v7.0.8", + "source": { + "type": "git", + "url": "https://github.com/illuminate/support.git", + "reference": "826782d01ec7a0befe26b106713822df5933ee69" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/support/zipball/826782d01ec7a0befe26b106713822df5933ee69", + "reference": "826782d01ec7a0befe26b106713822df5933ee69", + "shasum": "" + }, + "require": { + "doctrine/inflector": "^1.1", + "ext-json": "*", + "ext-mbstring": "*", + "illuminate/contracts": "^7.0", + "nesbot/carbon": "^2.17", + "php": "^7.2.5", + "voku/portable-ascii": "^1.4.8" + }, + "conflict": { + "tightenco/collect": "<5.5.33" + }, + "suggest": { + "illuminate/filesystem": "Required to use the composer class (^7.0).", + "moontoast/math": "Required to use ordered UUIDs (^1.1).", + "ramsey/uuid": "Required to use Str::uuid() (^3.7).", + "symfony/process": "Required to use the composer class (^5.0).", + "symfony/var-dumper": "Required to use the dd function (^5.0).", + "vlucas/phpdotenv": "Required to use the Env class and env helper (^4.0)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "7.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Support\\": "" + }, + "files": [ + "helpers.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Support package.", + "homepage": "https://laravel.com", + "time": "2020-03-06T19:50:43+00:00" + }, + { + "name": "jms/metadata", + "version": "1.7.0", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/metadata.git", + "reference": "e5854ab1aa643623dc64adde718a8eec32b957a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/metadata/zipball/e5854ab1aa643623dc64adde718a8eec32b957a8", + "reference": "e5854ab1aa643623dc64adde718a8eec32b957a8", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "doctrine/cache": "~1.0", + "symfony/cache": "~3.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5.x-dev" + } + }, + "autoload": { + "psr-0": { + "Metadata\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Asmir Mustafic", + "email": "goetas@gmail.com" + }, + { + "name": "Johannes M. Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Class/method/property metadata management in PHP", + "keywords": [ + "annotations", + "metadata", + "xml", + "yaml" + ], + "time": "2018-10-26T12:40:10+00:00" + }, + { + "name": "jms/parser-lib", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/parser-lib.git", + "reference": "c509473bc1b4866415627af0e1c6cc8ac97fa51d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/parser-lib/zipball/c509473bc1b4866415627af0e1c6cc8ac97fa51d", + "reference": "c509473bc1b4866415627af0e1c6cc8ac97fa51d", + "shasum": "" + }, + "require": { + "phpoption/phpoption": ">=0.9,<2.0-dev" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "JMS\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache2" + ], + "description": "A library for easily creating recursive-descent parsers.", + "time": "2012-11-18T18:08:43+00:00" + }, + { + "name": "jms/serializer", + "version": "1.14.1", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/serializer.git", + "reference": "ba908d278fff27ec01fb4349f372634ffcd697c0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/serializer/zipball/ba908d278fff27ec01fb4349f372634ffcd697c0", + "reference": "ba908d278fff27ec01fb4349f372634ffcd697c0", + "shasum": "" + }, + "require": { + "doctrine/annotations": "^1.0", + "doctrine/instantiator": "^1.0.3", + "jms/metadata": "^1.3", + "jms/parser-lib": "1.*", + "php": "^5.5|^7.0", + "phpcollection/phpcollection": "~0.1", + "phpoption/phpoption": "^1.1" + }, + "conflict": { + "twig/twig": "<1.12" + }, + "require-dev": { + "doctrine/orm": "~2.1", + "doctrine/phpcr-odm": "^1.3|^2.0", + "ext-pdo_sqlite": "*", + "jackalope/jackalope-doctrine-dbal": "^1.1.5", + "phpunit/phpunit": "^4.8|^5.0", + "propel/propel1": "~1.7", + "psr/container": "^1.0", + "symfony/dependency-injection": "^2.7|^3.3|^4.0", + "symfony/expression-language": "^2.6|^3.0", + "symfony/filesystem": "^2.1", + "symfony/form": "~2.1|^3.0", + "symfony/translation": "^2.1|^3.0", + "symfony/validator": "^2.2|^3.0", + "symfony/yaml": "^2.1|^3.0", + "twig/twig": "~1.12|~2.0" + }, + "suggest": { + "doctrine/cache": "Required if you like to use cache functionality.", + "doctrine/collections": "Required if you like to use doctrine collection types as ArrayCollection.", + "symfony/yaml": "Required if you'd like to serialize data to YAML format." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-1.x": "1.14-dev" + } + }, + "autoload": { + "psr-0": { + "JMS\\Serializer": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Johannes M. Schmitt", + "email": "schmittjoh@gmail.com" + }, + { + "name": "Asmir Mustafic", + "email": "goetas@gmail.com" + } + ], + "description": "Library for (de-)serializing data of any complexity; supports XML, JSON, and YAML.", + "homepage": "http://jmsyst.com/libs/serializer", + "keywords": [ + "deserialization", + "jaxb", + "json", + "serialization", + "xml" + ], + "time": "2020-02-22T20:59:37+00:00" + }, + { + "name": "mockery/mockery", + "version": "0.9.3", + "source": { + "type": "git", + "url": "https://github.com/mockery/mockery.git", + "reference": "686f85fa5b3b079cc0157d7cd3e9adb97f0b41e1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mockery/mockery/zipball/686f85fa5b3b079cc0157d7cd3e9adb97f0b41e1", + "reference": "686f85fa5b3b079cc0157d7cd3e9adb97f0b41e1", + "shasum": "" + }, + "require": { + "lib-pcre": ">=7.0", + "php": ">=5.3.2" + }, + "require-dev": { + "hamcrest/hamcrest-php": "~1.1", + "phpunit/phpunit": "~4.0", + "satooshi/php-coveralls": "~0.7@dev" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.9.x-dev" + } + }, + "autoload": { + "psr-0": { + "Mockery": "library/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Pádraic Brady", + "email": "padraic.brady@gmail.com", + "homepage": "http://blog.astrumfutura.com" + }, + { + "name": "Dave Marshall", + "email": "dave.marshall@atstsolutions.co.uk", + "homepage": "http://davedevelopment.co.uk" + } + ], + "description": "Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succint API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL). Designed as a drop in alternative to PHPUnit's phpunit-mock-objects library, Mockery is easy to integrate with PHPUnit and can operate alongside phpunit-mock-objects without the World ending.", + "homepage": "http://github.com/padraic/mockery", + "keywords": [ + "BDD", + "TDD", + "library", + "mock", + "mock objects", + "mockery", + "stub", + "test", + "test double", + "testing" + ], + "time": "2014-12-22T10:06:19+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.9.5", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/b2c28789e80a97badd14145fda39b545d83ca3ef", + "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "replace": { + "myclabs/deep-copy": "self.version" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^7.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": "2020-01-17T21:11:47+00:00" + }, + { + "name": "nesbot/carbon", + "version": "2.31.0", + "source": { + "type": "git", + "url": "https://github.com/briannesbitt/Carbon.git", + "reference": "bbc0ab53f41a4c6f223c18efcdbd9bc725eb5d2d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/bbc0ab53f41a4c6f223c18efcdbd9bc725eb5d2d", + "reference": "bbc0ab53f41a4c6f223c18efcdbd9bc725eb5d2d", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": "^7.1.8 || ^8.0", + "symfony/translation": "^3.4 || ^4.0 || ^5.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.14 || ^3.0", + "kylekatarnls/multi-tester": "^1.1", + "phpmd/phpmd": "^2.8", + "phpstan/phpstan": "^0.11", + "phpunit/phpunit": "^7.5 || ^8.0", + "squizlabs/php_codesniffer": "^3.4" + }, + "bin": [ + "bin/carbon" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + }, + "laravel": { + "providers": [ + "Carbon\\Laravel\\ServiceProvider" ] } }, + "autoload": { + "psr-4": { + "Carbon\\": "src/Carbon/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Brian Nesbitt", + "email": "brian@nesbot.com", + "homepage": "http://nesbot.com" + }, + { + "name": "kylekatarnls", + "homepage": "http://github.com/kylekatarnls" + } + ], + "description": "An API extension for DateTime that supports 281 different languages.", + "homepage": "http://carbon.nesbot.com", + "keywords": [ + "date", + "datetime", + "time" + ], + "time": "2020-03-01T11:11:58+00:00" + }, + { + "name": "phpcollection/phpcollection", + "version": "0.5.0", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/php-collection.git", + "reference": "f2bcff45c0da7c27991bbc1f90f47c4b7fb434a6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/php-collection/zipball/f2bcff45c0da7c27991bbc1f90f47c4b7fb434a6", + "reference": "f2bcff45c0da7c27991bbc1f90f47c4b7fb434a6", + "shasum": "" + }, + "require": { + "phpoption/phpoption": "1.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.4-dev" + } + }, + "autoload": { + "psr-0": { + "PhpCollection": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache2" + ], + "authors": [ + { + "name": "Johannes M. Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "General-Purpose Collection Library for PHP", + "keywords": [ + "collection", + "list", + "map", + "sequence", + "set" + ], + "time": "2015-05-17T12:39:23+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/63a995caa1ca9e5590304cd845c15ad6d482a62a", + "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "phpunit/phpunit": "~6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.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": "2018-08-07T13:53:10+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "5.1.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e", + "reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e", + "shasum": "" + }, + "require": { + "ext-filter": "^7.1", + "php": "^7.2", + "phpdocumentor/reflection-common": "^2.0", + "phpdocumentor/type-resolver": "^1.0", + "webmozart/assert": "^1" + }, + "require-dev": { + "doctrine/instantiator": "^1", + "mockery/mockery": "^1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.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" + }, + { + "name": "Jaap van Otterdijk", + "email": "account@ijaap.nl" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2020-02-22T12:28:44+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "7462d5f123dfc080dfdf26897032a6513644fc95" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/7462d5f123dfc080dfdf26897032a6513644fc95", + "reference": "7462d5f123dfc080dfdf26897032a6513644fc95", + "shasum": "" + }, + "require": { + "php": "^7.2", + "phpdocumentor/reflection-common": "^2.0" + }, + "require-dev": { + "ext-tokenizer": "^7.2", + "mockery/mockery": "~1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.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" + } + ], + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "time": "2020-02-18T18:59:58+00:00" + }, + { + "name": "phpoption/phpoption", + "version": "1.7.2", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/php-option.git", + "reference": "77f7c4d2e65413aff5b5a8cc8b3caf7a28d81959" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/77f7c4d2e65413aff5b5a8cc8b3caf7a28d81959", + "reference": "77f7c4d2e65413aff5b5a8cc8b3caf7a28d81959", + "shasum": "" + }, + "require": { + "php": "^5.5.9 || ^7.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.3", + "phpunit/phpunit": "^4.8.35 || ^5.0 || ^6.0 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.7-dev" + } + }, + "autoload": { + "psr-4": { + "PhpOption\\": "src/PhpOption/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Johannes M. Schmitt", + "email": "schmittjoh@gmail.com" + }, + { + "name": "Graham Campbell", + "email": "graham@alt-three.com" + } + ], + "description": "Option Type for PHP", + "keywords": [ + "language", + "option", + "php", + "type" + ], + "time": "2019-12-15T19:35:24+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "v1.10.3", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "451c3cd1418cf640de218914901e51b064abb093" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093", + "reference": "451c3cd1418cf640de218914901e51b064abb093", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", + "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5 || ^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10.x-dev" + } + }, + "autoload": { + "psr-4": { + "Prophecy\\": "src/Prophecy" + } + }, + "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": "2020-03-05T15:02:03+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "4.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^5.6 || ^7.0", + "phpunit/php-file-iterator": "^1.3", + "phpunit/php-text-template": "^1.2", + "phpunit/php-token-stream": "^1.4.2 || ^2.0", + "sebastian/code-unit-reverse-lookup": "^1.0", + "sebastian/environment": "^1.3.2 || ^2.0", + "sebastian/version": "^1.0 || ^2.0" + }, + "require-dev": { + "ext-xdebug": "^2.1.4", + "phpunit/phpunit": "^5.7" + }, + "suggest": { + "ext-xdebug": "^2.5.1" + }, + "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": "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-04-02T07:44:40+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "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": "2017-11-27T13:52:08+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": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "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": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" } ], - "time": "2015-02-03 12:10:50" + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26T11:10:40+00:00" }, { - "name": "phpspec/prophecy", - "version": "v1.4.1", + "name": "phpunit/php-token-stream", + "version": "2.0.2", "source": { "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373" + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "791198a2c6254db10131eecfe8c06670700904db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373", - "reference": "3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", + "reference": "791198a2c6254db10131eecfe8c06670700904db", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.2", - "phpdocumentor/reflection-docblock": "~2.0", - "sebastian/comparator": "~1.1" + "ext-tokenizer": "*", + "php": "^7.0" }, "require-dev": { - "phpspec/phpspec": "~2.0" + "phpunit/phpunit": "^6.2.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "2.0-dev" } }, "autoload": { - "psr-0": { - "Prophecy\\": "src/" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" } ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" + "tokenizer" ], - "time": "2015-04-27 22:15:08" + "time": "2017-11-27T05:48:46+00:00" }, { - "name": "phpunit/php-code-coverage", - "version": "2.0.16", + "name": "phpunit/phpunit", + "version": "5.7.27", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "934fd03eb6840508231a7f73eb8940cf32c3b66c" + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/934fd03eb6840508231a7f73eb8940cf32c3b66c", - "reference": "934fd03eb6840508231a7f73eb8940cf32c3b66c", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", + "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", "shasum": "" }, "require": { - "php": ">=5.3.3", - "phpunit/php-file-iterator": "~1.3", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "~1.3", + "php": "^5.6 || ^7.0", + "phpspec/prophecy": "^1.6.2", + "phpunit/php-code-coverage": "^4.0.4", + "phpunit/php-file-iterator": "~1.4", "phpunit/php-text-template": "~1.2", - "phpunit/php-token-stream": "~1.3", - "sebastian/environment": "~1.0", - "sebastian/version": "~1.0" + "phpunit/php-timer": "^1.0.6", + "phpunit/phpunit-mock-objects": "^3.2", + "sebastian/comparator": "^1.2.4", + "sebastian/diff": "^1.4.3", + "sebastian/environment": "^1.3.4 || ^2.0", + "sebastian/exporter": "~2.0", + "sebastian/global-state": "^1.1", + "sebastian/object-enumerator": "~2.0", + "sebastian/resource-operations": "~1.0", + "sebastian/version": "^1.0.6|^2.0.1", + "symfony/yaml": "~2.1|~3.0|~4.0" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "3.0.2" }, "require-dev": { - "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "~4" + "ext-pdo": "*" }, "suggest": { - "ext-dom": "*", - "ext-xdebug": ">=2.2.1", - "ext-xmlwriter": "*" + "ext-xdebug": "*", + "phpunit/php-invoker": "~1.1" }, + "bin": [ + "phpunit" + ], "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "5.7.x-dev" } }, "autoload": { @@ -644,179 +1666,378 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.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", + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", "keywords": [ - "coverage", + "phpunit", "testing", "xunit" ], - "time": "2015-04-11 04:35:00" + "time": "2018-02-01T05:50:59+00:00" }, { - "name": "phpunit/php-file-iterator", - "version": "1.4.0", + "name": "phpunit/phpunit-mock-objects", + "version": "3.4.4", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "a923bb15680d0089e2316f7a4af8f437046e96bb" + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a923bb15680d0089e2316f7a4af8f437046e96bb", - "reference": "a923bb15680d0089e2316f7a4af8f437046e96bb", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", + "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", "shasum": "" }, "require": { - "php": ">=5.3.3" + "doctrine/instantiator": "^1.0.2", + "php": "^5.6 || ^7.0", + "phpunit/php-text-template": "^1.2", + "sebastian/exporter": "^1.2 || ^2.0" + }, + "conflict": { + "phpunit/phpunit": "<5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.4" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.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": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "abandoned": true, + "time": "2017-06-30T09:13:00+00:00" + }, + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14T16:28:37+00:00" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "psr/simple-cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for simple caching", + "keywords": [ + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" + ], + "time": "2017-10-23T01:57:42+00:00" + }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, "autoload": { - "classmap": [ - "src/" + "files": [ + "src/getallheaders.php" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" } ], - "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-04-02 05:19:05" + "description": "A polyfill for getallheaders.", + "time": "2019-03-08T08:55:37+00:00" }, { - "name": "phpunit/php-text-template", - "version": "1.2.0", + "name": "scrutinizer/ocular", + "version": "1.7.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a" + "url": "https://github.com/scrutinizer-ci/ocular.git", + "reference": "65566d2e9c7c9e1f96502f5ffc49799b2a53ca29" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", - "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", + "url": "https://api.github.com/repos/scrutinizer-ci/ocular/zipball/65566d2e9c7c9e1f96502f5ffc49799b2a53ca29", + "reference": "65566d2e9c7c9e1f96502f5ffc49799b2a53ca29", "shasum": "" }, "require": { - "php": ">=5.3.3" + "guzzlehttp/guzzle": "~6.3", + "jms/serializer": "^1.0.0", + "phpoption/phpoption": "~1.0", + "symfony/console": "^2.1.0|~3.0|~4.0|~5.0", + "symfony/process": "~2.3|~3.0|~4.0|~5.0" }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.2", + "phpunit/phpunit": "^4.8.0", + "symfony/filesystem": "~2.0|~3.0|~4.0|~5.0" + }, + "bin": [ + "bin/ocular" + ], "type": "library", "autoload": { - "classmap": [ - "Text/" - ] + "psr-4": { + "Scrutinizer\\Ocular\\": "src/Scrutinizer/Ocular" + } }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" + "Apache-2.0" ], - "time": "2014-01-30 17:20:04" + "time": "2019-11-25T10:14:15+00:00" }, { - "name": "phpunit/php-timer", - "version": "1.0.5", + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c" + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/19689d4354b295ee3d8c54b4f42c3efb69cbc17c", - "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", "shasum": "" }, "require": { - "php": ">=5.3.3" + "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": [ - "PHP/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "email": "sebastian@phpunit.de" } ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "time": "2013-08-02 07:42:54" + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "time": "2017-03-04T06:30:41+00:00" }, { - "name": "phpunit/php-token-stream", - "version": "1.4.1", + "name": "sebastian/comparator", + "version": "1.2.4", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "eab81d02569310739373308137284e0158424330" + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/eab81d02569310739373308137284e0158424330", - "reference": "eab81d02569310739373308137284e0158424330", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", "shasum": "" }, "require": { - "ext-tokenizer": "*", - "php": ">=5.3.3" + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2 || ~2.0" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -829,63 +2050,56 @@ "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": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", "keywords": [ - "tokenizer" + "comparator", + "compare", + "equality" ], - "time": "2015-04-08 04:46:07" + "time": "2017-01-29T09:50:25+00:00" }, { - "name": "phpunit/phpunit", - "version": "4.6.6", + "name": "sebastian/diff", + "version": "1.4.3", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "3afe303d873a4d64c62ef84de491b97b006fbdac" + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3afe303d873a4d64c62ef84de491b97b006fbdac", - "reference": "3afe303d873a4d64c62ef84de491b97b006fbdac", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=5.3.3", - "phpspec/prophecy": "~1.3,>=1.3.1", - "phpunit/php-code-coverage": "~2.0,>=2.0.11", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "~1.0", - "phpunit/phpunit-mock-objects": "~2.3", - "sebastian/comparator": "~1.1", - "sebastian/diff": "~1.2", - "sebastian/environment": "~1.2", - "sebastian/exporter": "~1.2", - "sebastian/global-state": "~1.0", - "sebastian/version": "~1.0", - "symfony/yaml": "~2.1|~3.0" + "php": "^5.3.3 || ^7.0" }, - "suggest": { - "phpunit/php-invoker": "~1.1" + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" }, - "bin": [ - "phpunit" - ], "type": "library", "extra": { "branch-alias": { - "dev-master": "4.6.x-dev" + "dev-master": "1.4-dev" } }, "autoload": { @@ -898,50 +2112,46 @@ "BSD-3-Clause" ], "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "email": "sebastian@phpunit.de" } ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", "keywords": [ - "phpunit", - "testing", - "xunit" + "diff" ], - "time": "2015-04-29 15:18:52" + "time": "2017-05-22T07:24:03+00:00" }, { - "name": "phpunit/phpunit-mock-objects", - "version": "2.3.1", + "name": "sebastian/environment", + "version": "2.0.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "74ffb87f527f24616f72460e54b595f508dccb5c" + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/74ffb87f527f24616f72460e54b595f508dccb5c", - "reference": "74ffb87f527f24616f72460e54b595f508dccb5c", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", "shasum": "" }, "require": { - "doctrine/instantiator": "~1.0,>=1.0.2", - "php": ">=5.3.3", - "phpunit/php-text-template": "~1.2" + "php": "^5.6 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "suggest": { - "ext-soap": "*" + "phpunit/phpunit": "^5.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.3.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -956,150 +2166,161 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "email": "sebastian@phpunit.de" } ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", "keywords": [ - "mock", - "xunit" + "Xdebug", + "environment", + "hhvm" ], - "time": "2015-04-02 05:36:41" + "time": "2016-11-26T07:53:53+00:00" }, { - "name": "psr/log", - "version": "1.0.0", + "name": "sebastian/exporter", + "version": "2.0.0", "source": { "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", - "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", "shasum": "" }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~2.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "~4.4" + }, "type": "library", - "autoload": { - "psr-0": { - "Psr\\Log\\": "" + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" } }, + "autoload": { + "classmap": [ + "src/" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "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": "Common interface for logging libraries", + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", "keywords": [ - "log", - "psr", - "psr-3" + "export", + "exporter" ], - "time": "2012-12-21 11:40:51" + "time": "2016-11-19T08:54:04+00:00" }, { - "name": "satooshi/php-coveralls", - "version": "v0.6.1", + "name": "sebastian/global-state", + "version": "1.1.1", "source": { "type": "git", - "url": "https://github.com/satooshi/php-coveralls.git", - "reference": "dd0df95bd37a7cf5c5c50304dfe260ffe4b50760" + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/satooshi/php-coveralls/zipball/dd0df95bd37a7cf5c5c50304dfe260ffe4b50760", - "reference": "dd0df95bd37a7cf5c5c50304dfe260ffe4b50760", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", "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" + "php": ">=5.3.3" }, "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" + "phpunit/phpunit": "~4.2" + }, + "suggest": { + "ext-uopz": "*" }, - "bin": [ - "composer/bin/coveralls" - ], "type": "library", - "autoload": { - "psr-0": { - "Contrib\\Component": "src/", - "Contrib\\Bundle": "src/" + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" } }, + "autoload": { + "classmap": [ + "src/" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Kitamura Satoshi", - "email": "with.no.parachute@gmail.com", - "homepage": "https://www.facebook.com/satooshi.jp" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" } ], - "description": "PHP client library for Coveralls API", - "homepage": "https://github.com/satooshi/php-coveralls", + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", "keywords": [ - "ci", - "coverage", - "github", - "test" + "global state" ], - "time": "2013-05-04 08:07:33" + "time": "2015-10-12T03:26:01+00:00" }, { - "name": "sebastian/comparator", - "version": "1.1.1", + "name": "sebastian/object-enumerator", + "version": "2.0.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "1dd8869519a225f7f2b9eb663e225298fade819e" + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1dd8869519a225f7f2b9eb663e225298fade819e", - "reference": "1dd8869519a225f7f2b9eb663e225298fade819e", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2" + "php": ">=5.6", + "sebastian/recursion-context": "~2.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "~5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -1112,56 +2333,39 @@ "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" + "email": "sebastian@phpunit.de" + } ], - "time": "2015-01-29 16:28:08" + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2017-02-18T15:18:39+00:00" }, { - "name": "sebastian/diff", - "version": "1.3.0", + "name": "sebastian/recursion-context", + "version": "2.0.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3" + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/863df9687835c62aa423a22412d26fa2ebde3fd3", - "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", "shasum": "" }, "require": { "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -1175,45 +2379,43 @@ ], "authors": [ { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" } ], - "description": "Diff implementation", - "homepage": "http://www.github.com/sebastianbergmann/diff", - "keywords": [ - "diff" - ], - "time": "2015-02-22 15:13:53" + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2016-11-19T07:33:16+00:00" }, { - "name": "sebastian/environment", - "version": "1.2.2", + "name": "sebastian/resource-operations", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "5a8c7d31914337b69923db26c4221b81ff5a196e" + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5a8c7d31914337b69923db26c4221b81ff5a196e", - "reference": "5a8c7d31914337b69923db26c4221b81ff5a196e", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", "shasum": "" }, "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" + "php": ">=5.6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { @@ -1231,40 +2433,31 @@ "email": "sebastian@phpunit.de" } ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "time": "2015-01-01 10:01:08" + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2015-07-28T20:34:47+00:00" }, { - "name": "sebastian/exporter", - "version": "1.2.0", + "name": "sebastian/version", + "version": "2.0.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "84839970d05254c73cde183a721c7af13aede943" + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/84839970d05254c73cde183a721c7af13aede943", - "reference": "84839970d05254c73cde183a721c7af13aede943", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" + "php": ">=5.6" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -1277,206 +2470,239 @@ "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" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "time": "2015-01-27 07:23:06" + "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": "sebastian/global-state", - "version": "1.0.0", + "name": "symfony/console", + "version": "v5.0.5", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01" + "url": "https://github.com/symfony/console.git", + "reference": "d29e2d36941de13600c399e393a60b8cfe59ac49" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/c7428acdb62ece0a45e6306f1ae85e1c05b09c01", - "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01", + "url": "https://api.github.com/repos/symfony/console/zipball/d29e2d36941de13600c399e393a60b8cfe59ac49", + "reference": "d29e2d36941de13600c399e393a60b8cfe59ac49", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.2.5", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.8", + "symfony/service-contracts": "^1.1|^2" + }, + "conflict": { + "symfony/dependency-injection": "<4.4", + "symfony/event-dispatcher": "<4.4", + "symfony/lock": "<4.4", + "symfony/process": "<4.4" + }, + "provide": { + "psr/log-implementation": "1.0" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "psr/log": "~1.0", + "symfony/config": "^4.4|^5.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/event-dispatcher": "^4.4|^5.0", + "symfony/lock": "^4.4|^5.0", + "symfony/process": "^4.4|^5.0", + "symfony/var-dumper": "^4.4|^5.0" }, "suggest": { - "ext-uopz": "*" + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "5.0-dev" } }, "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "time": "2014-10-06 09:23:50" + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2020-02-24T15:05:31+00:00" }, { - "name": "sebastian/recursion-context", - "version": "1.0.0", + "name": "symfony/polyfill-mbstring", + "version": "v1.14.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "3989662bbb30a29d20d9faa04a846af79b276252" + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "34094cfa9abe1f0f14f48f490772db7a775559f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/3989662bbb30a29d20d9faa04a846af79b276252", - "reference": "3989662bbb30a29d20d9faa04a846af79b276252", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/34094cfa9abe1f0f14f48f490772db7a775559f2", + "reference": "34094cfa9abe1f0f14f48f490772db7a775559f2", "shasum": "" }, "require": { "php": ">=5.3.3" }, - "require-dev": { - "phpunit/phpunit": "~4.4" + "suggest": { + "ext-mbstring": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.14-dev" } }, "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { - "name": "Adam Harvey", - "email": "aharvey@php.net" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2015-01-24 09:48:32" + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2020-01-13T11:15:53+00:00" }, { - "name": "sebastian/version", - "version": "1.0.5", + "name": "symfony/polyfill-php73", + "version": "v1.14.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "ab931d46cd0d3204a91e1b9a40c4bc13032b58e4" + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "5e66a0fa1070bf46bec4bea7962d285108edd675" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/ab931d46cd0d3204a91e1b9a40c4bc13032b58e4", - "reference": "ab931d46cd0d3204a91e1b9a40c4bc13032b58e4", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/5e66a0fa1070bf46bec4bea7962d285108edd675", + "reference": "5e66a0fa1070bf46bec4bea7962d285108edd675", "shasum": "" }, + "require": { + "php": ">=5.3.3" + }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.14-dev" + } + }, "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "files": [ + "bootstrap.php" + ], "classmap": [ - "src/" + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "time": "2015-02-24 06:35:25" + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2020-01-13T11:15:53+00:00" }, { - "name": "symfony/config", - "version": "v2.6.7", - "target-dir": "Symfony/Component/Config", + "name": "symfony/process", + "version": "v5.0.5", "source": { "type": "git", - "url": "https://github.com/symfony/Config.git", - "reference": "b6fddb4aa2daaa2b06f0040071ac131b4a1ecf25" + "url": "https://github.com/symfony/process.git", + "reference": "fd4a86dd7e36437f2fc080d8c42c7415d828a0a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Config/zipball/b6fddb4aa2daaa2b06f0040071ac131b4a1ecf25", - "reference": "b6fddb4aa2daaa2b06f0040071ac131b4a1ecf25", + "url": "https://api.github.com/repos/symfony/process/zipball/fd4a86dd7e36437f2fc080d8c42c7415d828a0a8", + "reference": "fd4a86dd7e36437f2fc080d8c42c7415d828a0a8", "shasum": "" }, "require": { - "php": ">=5.3.3", - "symfony/filesystem": "~2.3" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" + "php": "^7.2.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.6-dev" + "dev-master": "5.0-dev" } }, "autoload": { - "psr-0": { - "Symfony\\Component\\Config\\": "" - } + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1492,48 +2718,40 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Config Component", + "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2015-05-02 15:18:45" + "time": "2020-02-08T17:00:58+00:00" }, { - "name": "symfony/console", - "version": "v2.6.7", - "target-dir": "Symfony/Component/Console", + "name": "symfony/service-contracts", + "version": "v2.0.1", "source": { "type": "git", - "url": "https://github.com/symfony/Console.git", - "reference": "ebc5679854aa24ed7d65062e9e3ab0b18a917272" + "url": "https://github.com/symfony/service-contracts.git", + "reference": "144c5e51266b281231e947b51223ba14acf1a749" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Console/zipball/ebc5679854aa24ed7d65062e9e3ab0b18a917272", - "reference": "ebc5679854aa24ed7d65062e9e3ab0b18a917272", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/144c5e51266b281231e947b51223ba14acf1a749", + "reference": "144c5e51266b281231e947b51223ba14acf1a749", "shasum": "" }, "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.1", - "symfony/phpunit-bridge": "~2.7", - "symfony/process": "~2.1" + "php": "^7.2.5", + "psr/container": "^1.0" }, "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/process": "" + "symfony/service-implementation": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.6-dev" + "dev-master": "2.0-dev" } }, "autoload": { - "psr-0": { - "Symfony\\Component\\Console\\": "" + "psr-4": { + "Symfony\\Contracts\\Service\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -1542,58 +2760,84 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Console Component", + "description": "Generic abstractions related to writing services", "homepage": "https://symfony.com", - "time": "2015-05-02 15:18:45" + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "time": "2019-11-18T17:27:11+00:00" }, { - "name": "symfony/event-dispatcher", - "version": "v2.6.7", - "target-dir": "Symfony/Component/EventDispatcher", + "name": "symfony/translation", + "version": "v5.0.5", "source": { "type": "git", - "url": "https://github.com/symfony/EventDispatcher.git", - "reference": "672593bc4b0043a0acf91903bb75a1c82d8f2e02" + "url": "https://github.com/symfony/translation.git", + "reference": "e9b93f42a1fd6aec6a0872d59ee5c8219a7d584b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/672593bc4b0043a0acf91903bb75a1c82d8f2e02", - "reference": "672593bc4b0043a0acf91903bb75a1c82d8f2e02", + "url": "https://api.github.com/repos/symfony/translation/zipball/e9b93f42a1fd6aec6a0872d59ee5c8219a7d584b", + "reference": "e9b93f42a1fd6aec6a0872d59ee5c8219a7d584b", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.2.5", + "symfony/polyfill-mbstring": "~1.0", + "symfony/translation-contracts": "^2" + }, + "conflict": { + "symfony/config": "<4.4", + "symfony/dependency-injection": "<5.0", + "symfony/http-kernel": "<5.0", + "symfony/twig-bundle": "<5.0", + "symfony/yaml": "<4.4" + }, + "provide": { + "symfony/translation-implementation": "2.0" }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~2.0,>=2.0.5", - "symfony/dependency-injection": "~2.6", - "symfony/expression-language": "~2.6", - "symfony/phpunit-bridge": "~2.7", - "symfony/stopwatch": "~2.3" + "symfony/config": "^4.4|^5.0", + "symfony/console": "^4.4|^5.0", + "symfony/dependency-injection": "^5.0", + "symfony/finder": "^4.4|^5.0", + "symfony/http-kernel": "^5.0", + "symfony/intl": "^4.4|^5.0", + "symfony/service-contracts": "^1.1.2|^2", + "symfony/yaml": "^4.4|^5.0" }, "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" + "psr/log-implementation": "To use logging capability in translator", + "symfony/config": "", + "symfony/yaml": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.6-dev" + "dev-master": "5.0-dev" } }, "autoload": { - "psr-0": { - "Symfony\\Component\\EventDispatcher\\": "" - } + "psr-4": { + "Symfony\\Component\\Translation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1609,40 +2853,39 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony EventDispatcher Component", + "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2015-05-02 15:18:45" + "time": "2020-02-04T07:41:34+00:00" }, { - "name": "symfony/filesystem", - "version": "v2.6.7", - "target-dir": "Symfony/Component/Filesystem", + "name": "symfony/translation-contracts", + "version": "v2.0.1", "source": { "type": "git", - "url": "https://github.com/symfony/Filesystem.git", - "reference": "f73904bd2dae525c42ea1f0340c7c98480ecacde" + "url": "https://github.com/symfony/translation-contracts.git", + "reference": "8cc682ac458d75557203b2f2f14b0b92e1c744ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Filesystem/zipball/f73904bd2dae525c42ea1f0340c7c98480ecacde", - "reference": "f73904bd2dae525c42ea1f0340c7c98480ecacde", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/8cc682ac458d75557203b2f2f14b0b92e1c744ed", + "reference": "8cc682ac458d75557203b2f2f14b0b92e1c744ed", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.2.5" }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7" + "suggest": { + "symfony/translation-implementation": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.6-dev" + "dev-master": "2.0-dev" } }, "autoload": { - "psr-0": { - "Symfony\\Component\\Filesystem\\": "" + "psr-4": { + "Symfony\\Contracts\\Translation\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -1651,48 +2894,103 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Filesystem Component", + "description": "Generic abstractions related to translation", "homepage": "https://symfony.com", - "time": "2015-05-08 00:09:07" + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "time": "2019-11-18T17:27:11+00:00" }, { - "name": "symfony/stopwatch", - "version": "v2.6.7", - "target-dir": "Symfony/Component/Stopwatch", + "name": "voku/portable-ascii", + "version": "1.4.9", "source": { "type": "git", - "url": "https://github.com/symfony/Stopwatch.git", - "reference": "b470f87c69837cb71115f1fa720388bb19b63635" + "url": "https://github.com/voku/portable-ascii.git", + "reference": "9fd2b224c71448b5f84aef9d499a1428d79776a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Stopwatch/zipball/b470f87c69837cb71115f1fa720388bb19b63635", - "reference": "b470f87c69837cb71115f1fa720388bb19b63635", + "url": "https://api.github.com/repos/voku/portable-ascii/zipball/9fd2b224c71448b5f84aef9d499a1428d79776a2", + "reference": "9fd2b224c71448b5f84aef9d499a1428d79776a2", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.0.0" }, "require-dev": { - "symfony/phpunit-bridge": "~2.7" + "phpunit/phpunit": "~6.0 || ~7.0" + }, + "suggest": { + "ext-intl": "Use Intl for transliterator_transliterate() support" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.6-dev" + "autoload": { + "psr-4": { + "voku\\": "src/voku/", + "voku\\tests\\": "tests/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Lars Moelleken", + "homepage": "http://www.moelleken.org/" } + ], + "description": "Portable ASCII library - performance optimized (ascii) string functions for php.", + "homepage": "https://github.com/voku/portable-ascii", + "keywords": [ + "ascii", + "clean", + "php" + ], + "time": "2020-03-06T02:47:42+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.7.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "aed98a490f9a8f78468232db345ab9cf606cf598" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/aed98a490f9a8f78468232db345ab9cf606cf598", + "reference": "aed98a490f9a8f78468232db345ab9cf606cf598", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0", + "symfony/polyfill-ctype": "^1.8" }, + "conflict": { + "vimeo/psalm": "<3.6.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36 || ^7.5.13" + }, + "type": "library", "autoload": { - "psr-0": { - "Symfony\\Component\\Stopwatch\\": "" + "psr-4": { + "Webmozart\\Assert\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1701,17 +2999,17 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" } ], - "description": "Symfony Stopwatch Component", - "homepage": "https://symfony.com", - "time": "2015-05-02 15:18:45" + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2020-02-14T12:15:55+00:00" } ], "aliases": [], @@ -1720,7 +3018,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=5.2.0" + "php": ">=5.3.0" }, "platform-dev": [] } diff --git a/examples/JSON.php b/examples/JSON.php index cd28220..c58f2d6 100644 --- a/examples/JSON.php +++ b/examples/JSON.php @@ -19,4 +19,4 @@ echo "
";
 print_r($parsed);
-echo "
"; \ No newline at end of file +echo ""; diff --git a/examples/MSGPack.php b/examples/MSGPack.php new file mode 100644 index 0000000..c58f2d6 --- /dev/null +++ b/examples/MSGPack.php @@ -0,0 +1,22 @@ +JSON Example"; +$parsed = $parser->json(' + { + "message": { + "to": "Jack Smith", + "from": "Jane Doe", + "subject": "Hello World", + "body": "Hello, whats going on..." + } + }'); + +echo "
";
+print_r($parsed);
+echo "
"; diff --git a/examples/QueryString.php b/examples/QueryString.php index 326a57a..fae5a4f 100644 --- a/examples/QueryString.php +++ b/examples/QueryString.php @@ -12,4 +12,3 @@ echo "
";
 print_r($parsed);
 echo "
"; - diff --git a/examples/Serial.php b/examples/Serial.php index d149c9c..1c3ddfa 100644 --- a/examples/Serial.php +++ b/examples/Serial.php @@ -11,4 +11,4 @@ echo "
";
 print_r($parsed);
-echo "
"; \ No newline at end of file +echo ""; diff --git a/examples/XML.php b/examples/XML.php index 010d80e..aac8c8c 100644 --- a/examples/XML.php +++ b/examples/XML.php @@ -3,6 +3,7 @@ require "../vendor/autoload.php"; use Nathanmac\Utilities\Parser\Parser; + $parser = new Parser(); echo "

XML Example

"; @@ -18,4 +19,4 @@ echo "
";
 print_r($parsed);
-echo "
"; \ No newline at end of file +echo ""; diff --git a/examples/YAML.php b/examples/YAML.php index 53b8305..9f15175 100644 --- a/examples/YAML.php +++ b/examples/YAML.php @@ -18,4 +18,3 @@ echo "
";
 print_r($parsed);
 echo "
"; - diff --git a/phpunit.xml b/phpunit.xml deleted file mode 100644 index b93b56e..0000000 --- a/phpunit.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - ./tests/ - - - - - vendor/* - - - - - - - - diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 0000000..c806687 --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,22 @@ + + + + + ./tests/ + + + + + src/ + + + diff --git a/src/Exceptions/ParserException.php b/src/Exceptions/ParserException.php index c5201b1..31cdad9 100644 --- a/src/Exceptions/ParserException.php +++ b/src/Exceptions/ParserException.php @@ -1,4 +1,6 @@ - * @license https://github.com/nathanmac/Parser/blob/master/LICENSE.md MIT */ -class ParserException extends Exception {} +class ParserException extends Exception +{ +} diff --git a/src/Facades/Parser.php b/src/Facades/Parser.php index 7906321..43d49ed 100644 --- a/src/Facades/Parser.php +++ b/src/Facades/Parser.php @@ -1,4 +1,6 @@ - * @license https://github.com/nathanmac/Parser/blob/master/LICENSE.md MIT + * + * @method static array payload(string $format = '') Parse the HTTP payload data, autodetect format and return all data in array. Override the format by providing a content type. + * + * @method static array xml(string $payload) XML to Array + * @method static array json(string $payload) JSON to Array + * @method static array yaml(string $payload) YAML to Array + * @method static array querystr(string $payload) Query String to Array + * @method static array serialize(string $payload) Serialized Object to Array + * @method static array bson(string $payload) BSON to Array + * @method static array msgpack(string $payload) MSGPack to Array + * + * @method static array all() Alias to the payload function. + * @method static array get(string $key = null, string $default = null) Retrieve an payload item from the payload data, return default item if item not found. + * @method static array has(string|array $keys) Determine if the payload contains a non-empty value for a given key. + * @method static array only(string|array $keys) Get a subset of the items from the payload data. + * @method static array except(string|array $keys) Get all of the input except for a specified array of items. */ -class Parser extends Facade { - +class Parser extends Facade +{ /** * Get the registered name of the component. * * @return string */ protected static function getFacadeAccessor() { return 'Parser'; } - } diff --git a/src/Formats/BSON.php b/src/Formats/BSON.php index 46bab24..493decd 100644 --- a/src/Formats/BSON.php +++ b/src/Formats/BSON.php @@ -1,4 +1,6 @@ - * @license https://github.com/nathanmac/Parser/blob/master/LICENSE.md MIT */ -class BSON implements FormatInterface { - +class BSON implements FormatInterface +{ /** * Parse Payload Data * * @param string $payload * - * @return array - * * @throws ParserException + * + * @return array */ public function parse($payload) { - if (function_exists('bson_decode')) { - if ($payload) { - $bson = bson_decode(trim($payload)); - if (!$bson) - throw new ParserException('Failed To Parse BSON'); - return $bson; + if (function_exists('MongoDB\BSON\toPHP') && ! function_exists('bson_decode')) { + require_once(__DIR__ . '/BSONPolyfill.php'); //@codeCoverageIgnore + } elseif ( ! (function_exists('bson_decode') || function_exists('MongoDB\BSON\toPHP'))) { + throw new ParserException('Failed To Parse BSON - Supporting Library Not Available'); // @codeCoverageIgnore + } + + if ($payload) { + $prevHandler = set_error_handler(function ($errno, $errstr, $errfile, $errline, $errcontext) { + throw new \Exception($errstr); // @codeCoverageIgnore + }); + + try { + $bson = bson_decode(trim($payload, " \t\n\r\x0b")); // Don't trim \0, as it has valid meaning in BSON + if ( ! $bson) { + throw new \Exception('Unknown error'); // @codeCoverageIgnore + } + } catch (\Exception $e) { + set_error_handler($prevHandler); + throw new ParserException('Failed To Parse BSON - ' . $e->getMessage()); } - return array(); - } else { - throw new ParserException('Failed To Parse BSON - Supporting Library Not Available'); + + set_error_handler($prevHandler); + + return $bson; } - } + return []; + } } diff --git a/src/Formats/BSONPolyfill.php b/src/Formats/BSONPolyfill.php new file mode 100644 index 0000000..e936b49 --- /dev/null +++ b/src/Formats/BSONPolyfill.php @@ -0,0 +1,8 @@ + 'array', 'document' => 'array']); + } +} diff --git a/src/Formats/FormatInterface.php b/src/Formats/FormatInterface.php index bb5b439..09c750e 100644 --- a/src/Formats/FormatInterface.php +++ b/src/Formats/FormatInterface.php @@ -1,4 +1,6 @@ - * @license https://github.com/nathanmac/Parser/blob/master/LICENSE.md MIT */ -interface FormatInterface { - +interface FormatInterface +{ /** * Parse Payload Data * * @param string $payload + * + * @throws ParserException + * * @return array */ public function parse($payload); - } diff --git a/src/Formats/JSON.php b/src/Formats/JSON.php index bc0802a..97759b5 100644 --- a/src/Formats/JSON.php +++ b/src/Formats/JSON.php @@ -1,4 +1,6 @@ - * @license https://github.com/nathanmac/Parser/blob/master/LICENSE.md MIT */ -class JSON implements FormatInterface { - +class JSON implements FormatInterface +{ /** * Parse Payload Data * * @param string $payload * + * @throws ParserException * @return array * - * @throws ParserException */ public function parse($payload) { if ($payload) { $json = json_decode(trim($payload), true); - if (!$json) + if ( ! $json) { throw new ParserException('Failed To Parse JSON'); + } return $json; } - return array(); - } + return []; + } } diff --git a/src/Formats/MSGPack.php b/src/Formats/MSGPack.php new file mode 100644 index 0000000..77fe212 --- /dev/null +++ b/src/Formats/MSGPack.php @@ -0,0 +1,52 @@ + + * @license https://github.com/nathanmac/Parser/blob/master/LICENSE.md MIT + */ +class MSGPack implements FormatInterface +{ + /** + * Parse Payload Data + * + * @param string $payload + * + * @throws ParserException + * + * @return array + */ + public function parse($payload) + { + if (function_exists('msgpack_unpack')) { + if ($payload) { + $prevHandler = set_error_handler(function ($errno, $errstr, $errfile, $errline, $errcontext) { + throw new \Exception($errstr); // @codeCoverageIgnore + }); + + try { + $msg = msgpack_unpack(trim($payload)); + if ( ! $msg) { + throw new \Exception('Unknown error'); // @codeCoverageIgnore + } + } catch (\Exception $e) { + set_error_handler($prevHandler); + throw new ParserException('Failed To Parse MSGPack - ' . $e->getMessage()); + } + + set_error_handler($prevHandler); + + return $msg; + } + return []; + } + + throw new ParserException('Failed To Parse MSGPack - Supporting Library Not Available'); // @codeCoverageIgnore + } +} diff --git a/src/Formats/QueryStr.php b/src/Formats/QueryStr.php index 0b78760..2ea288a 100644 --- a/src/Formats/QueryStr.php +++ b/src/Formats/QueryStr.php @@ -1,4 +1,6 @@ - * @license https://github.com/nathanmac/Parser/blob/master/LICENSE.md MIT */ -class QueryStr implements FormatInterface { - +class QueryStr implements FormatInterface +{ /** * Parse Payload Data * @@ -18,12 +20,11 @@ class QueryStr implements FormatInterface { */ public function parse($payload) { - if ($payload) - { + if ($payload) { parse_str(trim($payload), $querystr); return $querystr; } - return array(); - } + return []; + } } diff --git a/src/Formats/Serialize.php b/src/Formats/Serialize.php index 5185c13..bfed0b8 100644 --- a/src/Formats/Serialize.php +++ b/src/Formats/Serialize.php @@ -1,4 +1,6 @@ - * @license https://github.com/nathanmac/Parser/blob/master/LICENSE.md MIT */ -class Serialize implements FormatInterface { - +class Serialize implements FormatInterface +{ /** * Parse Payload Data * * @param string $payload * + * @throws ParserException * @return array * - * @throws ParserException */ public function parse($payload) { - if ($payload) - { + if ($payload) { try { return unserialize(trim($payload)); } catch (\Exception $ex) { throw new ParserException('Failed To Parse Serialized Data'); } } - return array(); - } + return []; + } } diff --git a/src/Formats/XML.php b/src/Formats/XML.php index 35037b8..541cb14 100644 --- a/src/Formats/XML.php +++ b/src/Formats/XML.php @@ -1,4 +1,6 @@ - * @license https://github.com/nathanmac/Parser/blob/master/LICENSE.md MIT */ -class XML implements FormatInterface { - +class XML implements FormatInterface +{ /** * Parse Payload Data * * @param string $payload * + * @throws ParserException * @return array * - * @throws ParserException */ public function parse($payload) { - if ($payload) - { + if ($payload) { try { - $xml = simplexml_load_string($payload, 'SimpleXMLElement', LIBXML_NOCDATA); - return json_decode(json_encode((array) $xml), 1); // Work around to accept xml input + $xml = simplexml_load_string($payload, 'SimpleXMLElement', (LIBXML_VERSION >= 20700) ? (LIBXML_PARSEHUGE | LIBXML_NOCDATA) : LIBXML_NOCDATA); + $ns = ['' => null] + $xml->getDocNamespaces(true); + return $this->recursive_parse($xml, $ns); } catch (\Exception $ex) { throw new ParserException('Failed To Parse XML'); } } - return array(); + + return []; } + protected function recursive_parse($xml, $ns) + { + $xml_string = (string)$xml; + + if ($xml->count() == 0 and $xml_string != '') { + if (count($xml->attributes()) == 0) { + if (trim($xml_string) == '') { + $result = null; + } else { + $result = $xml_string; + } + } else { + $result = array('#text' => $xml_string); + } + } else { + $result = null; + } + + foreach ($ns as $nsName => $nsUri) { + foreach ($xml->attributes($nsUri) as $attName => $attValue) { + if (!empty($nsName)) { + $attName = "{$nsName}:{$attName}"; + } + + $result["@{$attName}"] = (string)$attValue; + } + + foreach ($xml->children($nsUri) as $childName => $child) { + if (!empty($nsName)) { + $childName = "{$nsName}:{$childName}"; + } + + $child = $this->recursive_parse($child, $ns); + + if (is_array($result) and array_key_exists($childName, $result)) { + if (is_array($result[$childName]) and is_numeric(key($result[$childName]))) { + $result[$childName][] = $child; + } else { + $temp = $result[$childName]; + $result[$childName] = [$temp, $child]; + } + } else { + $result[$childName] = $child; + } + } + } + + return $result; + } } diff --git a/src/Formats/YAML.php b/src/Formats/YAML.php index 35d5f5e..3340274 100644 --- a/src/Formats/YAML.php +++ b/src/Formats/YAML.php @@ -1,6 +1,9 @@ - * @license https://github.com/nathanmac/Parser/blob/master/LICENSE.md MIT */ -class YAML implements FormatInterface { - +class YAML implements FormatInterface +{ /** * Parse Payload Data * * @param string $payload * + * @throws ParserException * @return array * - * @throws ParserException */ public function parse($payload) { - if ($payload) - { + if ($payload) { try { - return \Symfony\Component\Yaml\Yaml::parse(trim(preg_replace('/\t+/', '', $payload))); + $flags = (defined('Symfony\Component\Yaml\Yaml::PARSE_DATETIME')) ? (SFYaml::PARSE_EXCEPTION_ON_INVALID_TYPE | SFYaml::PARSE_DATETIME) : true; + return SFYaml::parse(trim(preg_replace('/\t+/', '', $payload)), $flags); } catch (\Exception $ex) { throw new ParserException('Failed To Parse YAML'); } } - return array(); - } + return []; + } } diff --git a/src/Parser.php b/src/Parser.php index 43c5af5..a2c3858 100644 --- a/src/Parser.php +++ b/src/Parser.php @@ -1,8 +1,11 @@ - 'xml', - 'text/xml' => 'xml', + 'application/xml' => 'Nathanmac\Utilities\Parser\Formats\XML', + 'text/xml' => 'Nathanmac\Utilities\Parser\Formats\XML', + 'xml' => 'Nathanmac\Utilities\Parser\Formats\XML', // JSON - 'application/json' => 'json', - 'application/x-javascript' => 'json', - 'text/javascript' => 'json', - 'text/x-javascript' => 'json', - 'text/x-json' => 'json', + 'application/json' => 'Nathanmac\Utilities\Parser\Formats\JSON', + 'application/x-javascript' => 'Nathanmac\Utilities\Parser\Formats\JSON', + 'text/javascript' => 'Nathanmac\Utilities\Parser\Formats\JSON', + 'text/x-javascript' => 'Nathanmac\Utilities\Parser\Formats\JSON', + 'text/x-json' => 'Nathanmac\Utilities\Parser\Formats\JSON', + 'json' => 'Nathanmac\Utilities\Parser\Formats\JSON', // BSON - 'application/bson' => 'bson', + 'application/bson' => 'Nathanmac\Utilities\Parser\Formats\BSON', + 'bson' => 'Nathanmac\Utilities\Parser\Formats\BSON', // YAML - 'text/yaml' => 'yaml', - 'text/x-yaml' => 'yaml', - 'application/yaml' => 'yaml', - 'application/x-yaml' => 'yaml', + 'text/yaml' => 'Nathanmac\Utilities\Parser\Formats\YAML', + 'text/x-yaml' => 'Nathanmac\Utilities\Parser\Formats\YAML', + 'application/yaml' => 'Nathanmac\Utilities\Parser\Formats\YAML', + 'application/x-yaml' => 'Nathanmac\Utilities\Parser\Formats\YAML', + 'yaml' => 'Nathanmac\Utilities\Parser\Formats\YAML', + // MSGPACK + 'application/msgpack' => 'Nathanmac\Utilities\Parser\Formats\MSGPack', + 'application/x-msgpack' => 'Nathanmac\Utilities\Parser\Formats\MSGPack', + 'msgpack' => 'Nathanmac\Utilities\Parser\Formats\MSGPack', // MISC - 'application/vnd.php.serialized' => 'serialize', - 'application/x-www-form-urlencoded' => 'querystr' - ); + 'application/vnd.php.serialized' => 'Nathanmac\Utilities\Parser\Formats\Serialize', + 'serialize' => 'Nathanmac\Utilities\Parser\Formats\Serialize', + 'application/x-www-form-urlencoded' => 'Nathanmac\Utilities\Parser\Formats\QueryStr', + 'querystr' => 'Nathanmac\Utilities\Parser\Formats\QueryStr', + ]; /* ------------ Access Methods/Helpers ------------ */ @@ -60,7 +73,7 @@ public function only($keys) { $keys = is_array($keys) ? $keys : func_get_args(); - $results = array(); + $results = []; foreach ($keys as $key) { $results = array_merge_recursive($results, $this->buildArray(explode('.', $key), $this->get($key))); } @@ -99,10 +112,10 @@ public function has($keys) $results = $this->payload(); - foreach ($keys as $value) - { - if ($this->hasValueAtKey($value, $results) === false) + foreach ($keys as $value) { + if ($this->hasValueAtKey($value, $results) === false) { return false; + } } return true; } @@ -123,6 +136,37 @@ public function get($key = null, $default = null) return $default; } + /** + * Mask input data with a given mapping. + * + * @param array $mask + * + * @return array + */ + public function mask(array $mask) + { + $keys = []; + foreach ($mask as $key => $value) { + $keys[] = $key . (is_array($value) ? $this->processMask($value) : ''); + } + + return $this->only($keys); + } + + /** + * Recursive processor for processing user masks. + * + * @param array $mask + * + * @return string + */ + private function processMask($mask) + { + foreach ($mask as $key => $value) { + return '.' . $key . (is_array($value) ? $this->processMask($value) : ''); + } + } + /** * Parse the HTTP payload data, autodetect format and return all data in array. * Override the format by providing a content type. @@ -133,10 +177,8 @@ public function get($key = null, $default = null) */ public function payload($format = '') { - if (!empty($format)) - if (isset($this->supported_formats[$format])) - return $this->{$this->supported_formats[$format]}($this->getPayload()); - return $this->{$this->getFormat()}($this->getPayload()); + $class = $this->getFormatClass($format); + return $this->parse($this->getPayload(), new $class); } /** @@ -152,27 +194,55 @@ public function all() /** * Autodetect the payload data type using content-type value. * - * @return string Return the short format code (xml, json, ...). + * @return string Return the name of the formatter class. */ - public function getFormat() + public function getFormatClass($format = '') { - if (isset($_SERVER['CONTENT_TYPE'])) - { - if (isset($this->supported_formats[$_SERVER['CONTENT_TYPE']])) - return $this->supported_formats[$_SERVER['CONTENT_TYPE']]; + if ( ! empty($format)) { + return $this->processContentType($format); + } + + if (isset($_SERVER['CONTENT_TYPE'])) { + $type = $this->processContentType($_SERVER['CONTENT_TYPE']); + if ($type !== false) { + return $type; + } + } + + if (isset($_SERVER['HTTP_CONTENT_TYPE'])) { + $type = $this->processContentType($_SERVER['HTTP_CONTENT_TYPE']); + if ($type !== false) { + return $type; + } } - if (isset($_SERVER['HTTP_CONTENT_TYPE'])) - { - if (isset($this->supported_formats[$_SERVER['HTTP_CONTENT_TYPE']])) - return $this->supported_formats[$_SERVER['HTTP_CONTENT_TYPE']]; + + return 'Nathanmac\Utilities\Parser\Formats\JSON'; + } + + /** + * Process the content-type values + * + * @param string $contentType Content-Type raw string + * + * @return bool|string + */ + private function processContentType($contentType) + { + foreach (explode(';', $contentType) as $type) { + $type = strtolower(trim($type)); + if (isset($this->supported_formats[$type])) { + return $this->supported_formats[$type]; + } } - return 'json'; + return false; } /** * Return the payload data from the HTTP post request. * + * @codeCoverageIgnore + * * @return string */ protected function getPayload() @@ -193,6 +263,32 @@ public function parse($payload, FormatInterface $format) return $format->parse($payload); } + /* ------------ Format Registration Methods ------------ */ + + /** + * Register Format Class. + * + * @param $format + * @param $class + * + * @throws InvalidArgumentException + * + * @return self + */ + public function registerFormat($format, $class) + { + if ( ! class_exists($class)) { + throw new \InvalidArgumentException("Parser formatter class {$class} not found."); + } + if ( ! is_a($class, 'Nathanmac\Utilities\Parser\Formats\FormatInterface', true)) { + throw new \InvalidArgumentException('Parser formatters must implement the Nathanmac\Utilities\Parser\Formats\FormatInterface interface.'); + } + + $this->supported_formats[$format] = $class; + + return $this; + } + /* ------------ Helper Methods ------------ */ /** @@ -200,9 +296,9 @@ public function parse($payload, FormatInterface $format) * * @param $payload * - * @return array - * * @throws Exceptions\ParserException + * + * @return array */ public function xml($payload) { @@ -214,9 +310,8 @@ public function xml($payload) * * @param $payload * - * @return array - * * @throws Exceptions\ParserException + * @return array */ public function json($payload) { @@ -228,9 +323,9 @@ public function json($payload) * * @param $payload * - * @return array - * * @throws Exceptions\ParserException + * + * @return array */ public function bson($payload) { @@ -242,9 +337,9 @@ public function bson($payload) * * @param $payload * - * @return array - * * @throws Exceptions\ParserException + * + * @return array */ public function serialize($payload) { @@ -268,15 +363,29 @@ public function querystr($payload) * * @param $payload * - * @return array - * * @throws Exceptions\ParserException + * + * @return array */ public function yaml($payload) { return $this->parse($payload, new Yaml()); } + /** + * MSGPack parser, helper function. + * + * @param $payload + * + * @throws Exceptions\ParserException + * + * @return array + */ + public function msgpack($payload) + { + return $this->parse($payload, new MSGPack()); + } + /* ------------ Construction Methods ------------ */ /** @@ -290,29 +399,29 @@ private function getValueAtKey($key, $data) { $keys = explode('.', $key); - while (count($keys) > 1) - { + while (count($keys) > 1) { $key = array_shift($keys); // Wildcard Key - if (preg_match($this->wildcards, $key) && is_array($data) && !empty($data)) { + if (preg_match($this->wildcards, $key) && is_array($data) && ! empty($data)) { // Shift the first item of the array if (preg_match('/^:(index|item)\[\d+\]$/', $key)) { for ($x = substr($key, 7, -1); $x >= 0; $x--) { - if (empty($data)) + if (empty($data)) { return false; + } $item = array_shift($data); } - } else if ($key == ':last') { + } elseif ($key == ':last') { $item = array_pop($data); } else { $item = array_shift($data); } $data =& $item; - } else { - if (!isset($data[$key]) || !is_array($data[$key])) + if ( ! isset($data[$key]) || ! is_array($data[$key])) { return false; + } $data =& $data[$key]; } @@ -323,12 +432,13 @@ private function getValueAtKey($key, $data) if (preg_match($this->wildcards, $key)) { if (preg_match('/^:(index|item)\[\d+\]$/', $key)) { for ($x = substr($key, 7, -1); $x >= 0; $x--) { - if (empty($data)) + if (empty($data)) { return false; + } $item = array_shift($data); } return $item; - } else if ($key == ':last') { + } elseif ($key == ':last') { return array_pop($data); } return array_shift($data); // First Found @@ -347,35 +457,37 @@ private function hasValueAtKey($key, $data) { $keys = explode('.', $key); - while (count($keys) > 0) - { + while (count($keys) > 0) { $key = array_shift($keys); // Wildcard Key - if (preg_match($this->wildcards, $key) && is_array($data) && !empty($data)) { + if (preg_match($this->wildcards, $key) && is_array($data) && ! empty($data)) { // Shift the first item of the array if (preg_match('/^:(index|item)\[\d+\]$/', $key)) { for ($x = substr($key, 7, -1); $x >= 0; $x--) { - if (empty($data)) + if (empty($data)) { return false; + } $item = array_shift($data); } - } else if ($key == ':last') { + } elseif ($key == ':last') { $item = array_pop($data); } else { $item = array_shift($data); } $data =& $item; - } else { - if (!isset($data[$key])) + if ( ! isset($data[$key])) { return false; + } - if (is_bool($data[$key])) + if (is_bool($data[$key])) { return true; + } - if ($data[$key] === '') + if ($data[$key] === '') { return false; + } $data =& $data[$key]; } @@ -392,10 +504,9 @@ private function hasValueAtKey($key, $data) */ private function buildArray($route, $data = null) { - $key = array_pop($route); - $data = array($key => $data); - if (count($route) == 0) - { + $key = array_pop($route); + $data = [$key => $data]; + if (count($route) == 0) { return $data; } return $this->buildArray($route, $data); @@ -411,12 +522,10 @@ private function removeValue(&$array, $key) { $keys = explode('.', $key); - while (count($keys) > 1) - { + while (count($keys) > 1) { $key = array_shift($keys); - if ( ! isset($array[$key]) || ! is_array($array[$key])) - { + if ( ! isset($array[$key]) || ! is_array($array[$key])) { return; } diff --git a/src/ParserServiceProvider.php b/src/ParserServiceProvider.php index 36383a3..ed1812b 100644 --- a/src/ParserServiceProvider.php +++ b/src/ParserServiceProvider.php @@ -1,4 +1,6 @@ - * @license https://github.com/nathanmac/Parser/blob/master/LICENSE.md MIT */ -class ParserServiceProvider extends ServiceProvider { - +class ParserServiceProvider extends ServiceProvider +{ /** * Indicates if loading of the provider is deferred. * @@ -25,7 +27,7 @@ class ParserServiceProvider extends ServiceProvider { */ public function register() { - $this->app->bind('Parser', function($app) { + $this->app->bind('Parser', function ($app) { return new Parser; }); } @@ -37,7 +39,6 @@ public function register() */ public function provides() { - return array('Parser'); + return ['Parser']; } - } diff --git a/tests/BSONTest.php b/tests/BSONTest.php index 92ffc74..a078aae 100644 --- a/tests/BSONTest.php +++ b/tests/BSONTest.php @@ -1,24 +1,23 @@ 123, 'message' => 'hello world'); + $expected = ['status' => 123, 'message' => 'hello world']; + + if (function_exists('bson_encode')) { $payload = bson_encode($expected); + } elseif (function_exists('MongoDB\BSON\fromPHP')) { + $payload = \MongoDB\BSON\fromPHP($expected); + } + if (function_exists('bson_decode') || function_exists('MongoDB\BSON\toPHP')) { $parser = new Parser(); $this->assertEquals($expected, $parser->bson($payload)); } @@ -27,27 +26,27 @@ public function parser_validates_bson_data() /** @test */ public function parser_empty_bson_data() { - if (function_exists('bson_decode')) { + if (function_exists('bson_decode') || function_exists('MongoDB\BSON\toPHP')) { $parser = new Parser(); - $this->assertEquals(array(), $parser->bson("")); + $this->assertEquals([], $parser->bson("")); } } /** @test */ public function throw_an_exception_when_bson_library_not_loaded() { - if (! function_exists('bson_decode')) { + if ( ! (function_exists('bson_decode') || function_exists('MongoDB\BSON\toPHP'))) { $this->setExpectedException('Exception', 'Failed To Parse BSON - Supporting Library Not Available'); $parser = new Parser(); - $this->assertEquals(array(), $parser->bson("")); + $this->assertEquals([], $parser->bson("")); } } /** @test */ public function throws_an_exception_when_parsed_bson_bad_data() { - if (! function_exists('bson_decode')) { + if (function_exists('bson_decode') || function_exists('MongoDB\BSON\toPHP')) { $parser = new Parser(); $this->setExpectedException('Exception', 'Failed To Parse BSON'); $parser->bson('as|df>ASFBw924hg2='); @@ -58,7 +57,10 @@ public function throws_an_exception_when_parsed_bson_bad_data() public function format_detection_bson() { $parser = new Parser(); + $_SERVER['HTTP_CONTENT_TYPE'] = "application/bson"; - $this->assertEquals('bson', $parser->getFormat()); + $this->assertEquals('Nathanmac\Utilities\Parser\Formats\BSON', $parser->getFormatClass()); + + unset($_SERVER['HTTP_CONTENT_TYPE']); } } diff --git a/tests/CustomFormatter.php b/tests/CustomFormatter.php new file mode 100644 index 0000000..b67966a --- /dev/null +++ b/tests/CustomFormatter.php @@ -0,0 +1,29 @@ +shouldDeferMissing() ->shouldAllowMockingProtectedMethods(); - $parser->shouldReceive('getFormat') + $parser->shouldReceive('getFormatClass') ->twice() - ->andReturn('json'); + ->andReturn('Nathanmac\Utilities\Parser\Formats\JSON'); $parser->shouldReceive('getPayload') ->once() ->andReturn('{"status":123, "message":"hello world"}'); - $this->assertEquals('json', $parser->getFormat()); - $this->assertEquals(array('status' => 123, 'message' => 'hello world'), $parser->payload()); + $this->assertEquals('Nathanmac\Utilities\Parser\Formats\JSON', $parser->getFormatClass()); + $this->assertEquals(['status' => 123, 'message' => 'hello world'], $parser->payload()); } /** @test */ public function parser_validates_json_data() { $parser = new Parser(); - $this->assertEquals(array('status' => 123, 'message' => 'hello world'), $parser->json('{"status":123, "message":"hello world"}')); + $this->assertEquals(['status' => 123, 'message' => 'hello world'], $parser->json('{"status":123, "message":"hello world"}')); } /** @test */ public function parser_empty_json_data() { $parser = new Parser(); - $this->assertEquals(array(), $parser->json("")); + $this->assertEquals([], $parser->json("")); } /** @test */ @@ -59,18 +62,20 @@ public function format_detection_json() $parser = new Parser(); $_SERVER['HTTP_CONTENT_TYPE'] = "application/json"; - $this->assertEquals('json', $parser->getFormat()); + $this->assertEquals('Nathanmac\Utilities\Parser\Formats\JSON', $parser->getFormatClass()); $_SERVER['HTTP_CONTENT_TYPE'] = "application/x-javascript"; - $this->assertEquals('json', $parser->getFormat()); + $this->assertEquals('Nathanmac\Utilities\Parser\Formats\JSON', $parser->getFormatClass()); $_SERVER['HTTP_CONTENT_TYPE'] = "text/javascript"; - $this->assertEquals('json', $parser->getFormat()); + $this->assertEquals('Nathanmac\Utilities\Parser\Formats\JSON', $parser->getFormatClass()); $_SERVER['HTTP_CONTENT_TYPE'] = "text/x-javascript"; - $this->assertEquals('json', $parser->getFormat()); + $this->assertEquals('Nathanmac\Utilities\Parser\Formats\JSON', $parser->getFormatClass()); $_SERVER['HTTP_CONTENT_TYPE'] = "text/x-json"; - $this->assertEquals('json', $parser->getFormat()); + $this->assertEquals('Nathanmac\Utilities\Parser\Formats\JSON', $parser->getFormatClass()); + + unset($_SERVER['HTTP_CONTENT_TYPE']); } } diff --git a/tests/MSGPackTest.php b/tests/MSGPackTest.php new file mode 100644 index 0000000..6678413 --- /dev/null +++ b/tests/MSGPackTest.php @@ -0,0 +1,64 @@ + 123, 'message' => 'hello world']; + $payload = msgpack_pack($expected); + + $parser = new Parser(); + $this->assertEquals($expected, $parser->msgpack($payload)); + } + } + + /** @test */ + public function parser_empty_msgpack_data() + { + if (function_exists('msgpack_unpack')) { + $parser = new Parser(); + $this->assertEquals([], $parser->msgpack("")); + } + } + + /** @test */ + public function throw_an_exception_when_msgpack_library_not_loaded() + { + if ( ! function_exists('msgpack_unpack')) { + $this->setExpectedException('Exception', 'Failed To Parse MSGPack - Supporting Library Not Available'); + + $parser = new Parser(); + $this->assertEquals([], $parser->msgpack("")); + } + } + + /** @test */ + public function throws_an_exception_when_parsed_msgpack_bad_data() + { + if (function_exists('msgpack_unpack')) { + $parser = new Parser(); + $this->setExpectedException('Exception', 'Failed To Parse MSGPack'); + $parser->msgpack('as|df>ASFBw924hg2='); + } + } + + /** @test */ + public function format_detection_msgpack() + { + $parser = new Parser(); + + $_SERVER['HTTP_CONTENT_TYPE'] = "application/msgpack"; + $this->assertEquals('Nathanmac\Utilities\Parser\Formats\MSGPack', $parser->getFormatClass()); + + $_SERVER['HTTP_CONTENT_TYPE'] = "application/x-msgpack"; + $this->assertEquals('Nathanmac\Utilities\Parser\Formats\MSGPack', $parser->getFormatClass()); + + unset($_SERVER['HTTP_CONTENT_TYPE']); + } +} diff --git a/tests/ParserTest.php b/tests/ParserTest.php index 88186a6..d44f0b0 100644 --- a/tests/ParserTest.php +++ b/tests/ParserTest.php @@ -1,18 +1,35 @@ shouldDeferMissing() + ->shouldAllowMockingProtectedMethods(); + + $parser->shouldReceive('getPayload') + ->andReturn('{"message": {"title": "Hello World", "body": "Some message content"}, "comments": [{ "title": "hello", "message": "hello world", "tags": ["one", "two"]}, {"title": "world", "message": "hello world", "tags": ["red", "green"]}]}'); + + $this->assertEquals(["message" => ["title" => "Hello World"]], $parser->mask(['message' => ['title' => '*']])); + $this->assertEquals(["comments" => [["title" => "hello", "message" => "hello world", "tags" => ["one", "two"]], ["title" => "world", "message" => "hello world", "tags" => ["red", "green"]]]], $parser->mask(['comments' => '*'])); + $this->assertEquals(['posts' => null], $parser->mask(['posts' => '*'])); + } + /** @test */ public function wildcards_with_simple_structure_json() { @@ -36,7 +53,7 @@ public function wildcards_with_simple_structure_json() $this->assertEquals("Hello this is a sample message", $parser->get('email.message.:first')); $this->assertEquals("jane.doe@example.com", $parser->get('email.*')); $this->assertEquals("jane.doe@example.com", $parser->get('email.:first')); - $this->assertEquals(array('body' => 'Hello this is a sample message'), $parser->get('email.:last')); + $this->assertEquals(['body' => 'Hello this is a sample message'], $parser->get('email.:last')); $this->assertEquals("jane.doe@example.com", $parser->get('email.:index[0]')); $this->assertEquals("john.doe@example.com", $parser->get('email.:index[1]')); } @@ -62,12 +79,12 @@ public function wildcards_with_array_structure_json() $this->assertEquals('hello', $parser->get('comments.*.title')); $this->assertFalse($parser->has('comments.:index[99]')); $this->assertFalse($parser->has('comments.:index[99].title')); - $this->assertEquals(array('title' => 'hello', 'message' => 'hello world'), $parser->get('comments.*')); - $this->assertEquals(array('title' => 'hello', 'message' => 'hello world'), $parser->get('comments.%')); - $this->assertEquals(array('title' => 'hello', 'message' => 'hello world'), $parser->get('comments.:first')); - $this->assertEquals(array('title' => 'world', 'message' => 'world hello'), $parser->get('comments.:last')); - $this->assertEquals(array('title' => 'hello', 'message' => 'hello world'), $parser->get('comments.:index[0]')); - $this->assertEquals(array('title' => 'world', 'message' => 'world hello'), $parser->get('comments.:index[1]')); + $this->assertEquals(['title' => 'hello', 'message' => 'hello world'], $parser->get('comments.*')); + $this->assertEquals(['title' => 'hello', 'message' => 'hello world'], $parser->get('comments.%')); + $this->assertEquals(['title' => 'hello', 'message' => 'hello world'], $parser->get('comments.:first')); + $this->assertEquals(['title' => 'world', 'message' => 'world hello'], $parser->get('comments.:last')); + $this->assertEquals(['title' => 'hello', 'message' => 'hello world'], $parser->get('comments.:index[0]')); + $this->assertEquals(['title' => 'world', 'message' => 'world hello'], $parser->get('comments.:index[1]')); } /** @test */ @@ -81,7 +98,7 @@ public function array_structured_getPayload_json() ->once() ->andReturn('{"comments": [{ "title": "hello", "message": "hello world"}, {"title": "world", "message": "hello world"}]}'); - $this->assertEquals(array("comments" => array(array("title" => "hello", "message" => "hello world"), array("title" => "world", "message" => "hello world"))), $parser->payload()); + $this->assertEquals(["comments" => [["title" => "hello", "message" => "hello world"], ["title" => "world", "message" => "hello world"]]], $parser->payload()); } /** @test */ @@ -95,7 +112,7 @@ public function alias_all_check() ->once() ->andReturn('{"status":123, "message":"hello world"}'); - $this->assertEquals(array('status' => 123, 'message' => 'hello world'), $parser->all()); + $this->assertEquals(['status' => 123, 'message' => 'hello world'], $parser->all()); } /** @test */ @@ -113,11 +130,11 @@ public function return_value_for_multi_level_key() $this->assertEquals('example@example.com', $parser->get('note.headers.to')); $this->assertTrue($parser->has('note.headers.to')); - $this->assertEquals(array('id' => 123, 'note' => array('headers' => array('from' => 'example@example.com'), 'body' => 'Hello World')), $parser->except('note.headers.to')); - $this->assertEquals(array('id' => 123, 'note' => array('headers' => array('to' => 'example@example.com', 'from' => 'example@example.com'))), $parser->except('note.body')); + $this->assertEquals(['id' => 123, 'note' => ['headers' => ['from' => 'example@example.com'], 'body' => 'Hello World']], $parser->except('note.headers.to')); + $this->assertEquals(['id' => 123, 'note' => ['headers' => ['to' => 'example@example.com', 'from' => 'example@example.com']]], $parser->except('note.body')); - $this->assertEquals(array('note' => array('headers' => array('to' => 'example@example.com', 'from' => 'example@example.com'))), $parser->only('note.headers.to', 'note.headers.from')); - $this->assertEquals(array('id' => 123, 'status' => null, 'note' => array('body' => 'Hello World')), $parser->only('note.body', 'id', 'status')); + $this->assertEquals(['note' => ['headers' => ['to' => 'example@example.com', 'from' => 'example@example.com']]], $parser->only('note.headers.to', 'note.headers.from')); + $this->assertEquals(['id' => 123, 'status' => null, 'note' => ['body' => 'Hello World']], $parser->only('note.body', 'id', 'status')); } /** @test */ @@ -162,7 +179,7 @@ public function only_return_selected_fields() $parser->shouldReceive('getPayload') ->andReturn('{"status":123, "message":"hello world"}'); - $this->assertEquals(array('status' => 123), $parser->only('status')); + $this->assertEquals(['status' => 123], $parser->only('status')); } /** @test */ @@ -176,8 +193,8 @@ public function except_do_not_return_selected_fields() ->twice() ->andReturn('{"status":123, "message":"hello world"}'); - $this->assertEquals(array('status' => 123), $parser->except('message')); - $this->assertEquals(array('status' => 123, 'message' => 'hello world'), $parser->except('message.tags')); + $this->assertEquals(['status' => 123], $parser->except('message')); + $this->assertEquals(['status' => 123, 'message' => 'hello world'], $parser->except('message.tags')); } /** @test */ @@ -186,10 +203,10 @@ public function format_detection_defaults_to_json() $parser = new Parser(); $_SERVER['HTTP_CONTENT_TYPE'] = "somerandomstuff"; - $this->assertEquals('json', $parser->getFormat()); + $this->assertEquals('Nathanmac\Utilities\Parser\Formats\JSON', $parser->getFormatClass()); $_SERVER['CONTENT_TYPE'] = "somerandomstuff"; - $this->assertEquals('json', $parser->getFormat()); + $this->assertEquals('Nathanmac\Utilities\Parser\Formats\JSON', $parser->getFormatClass()); } /** @test */ @@ -199,15 +216,30 @@ public function throw_an_exception_when_parsed_auto_detect_mismatch_content_type ->shouldDeferMissing() ->shouldAllowMockingProtectedMethods(); - $parser->shouldReceive('getFormat') + $parser->shouldReceive('getFormatClass') ->once() - ->andReturn('serialize'); + ->andReturn('Nathanmac\Utilities\Parser\Formats\Serialize'); $parser->shouldReceive('getPayload') ->once() ->andReturn("123hello world"); $this->setExpectedException('Exception', 'Failed To Parse Serialized Data'); - $this->assertEquals(array('status' => 123, 'message' => 'hello world'), $parser->payload()); + $this->assertEquals(['status' => 123, 'message' => 'hello world'], $parser->payload()); + } + + /** @test */ + public function can_register_format_classes() + { + // For some reason this won't autoload... + require_once(__DIR__ . '/CustomFormatter.php'); + + $parser = new Parser(); + + $_SERVER['CONTENT_TYPE'] = "application/x-custom-format"; + $this->assertEquals('Nathanmac\Utilities\Parser\Formats\JSON', $parser->getFormatClass()); + + $parser->registerFormat('application/x-custom-format', 'Nathanmac\Utilities\Parser\Tests\CustomFormatter'); + $this->assertEquals('Nathanmac\Utilities\Parser\Tests\CustomFormatter', $parser->getFormatClass()); } } diff --git a/tests/QueryStrTest.php b/tests/QueryStrTest.php index 4e3dd89..aca88b5 100644 --- a/tests/QueryStrTest.php +++ b/tests/QueryStrTest.php @@ -1,12 +1,15 @@ shouldDeferMissing() ->shouldAllowMockingProtectedMethods(); - $parser->shouldReceive('getFormat') + $parser->shouldReceive('getFormatClass') ->once() - ->andReturn('querystr'); + ->andReturn('Nathanmac\Utilities\Parser\Formats\QueryStr'); $parser->shouldReceive('getPayload') ->once() ->andReturn('status=123&message=hello world'); - $this->assertEquals(array('status' => 123, 'message' => 'hello world'), $parser->payload()); + $this->assertEquals(['status' => 123, 'message' => 'hello world'], $parser->payload()); } /** @test */ public function parser_validates_query_string_data() { $parser = new Parser(); - $this->assertEquals(array('status' => 123, 'message' => 'hello world'), $parser->querystr('status=123&message=hello world')); + $this->assertEquals(['status' => 123, 'message' => 'hello world'], $parser->querystr('status=123&message=hello world')); } /** @test */ public function parser_empty_query_string_data() { $parser = new Parser(); - $this->assertEquals(array(), $parser->querystr("")); + $this->assertEquals([], $parser->querystr("")); } /** @test */ public function format_detection_query_string() { $parser = new Parser(); + $_SERVER['HTTP_CONTENT_TYPE'] = "application/x-www-form-urlencoded"; - $this->assertEquals('querystr', $parser->getFormat()); + $this->assertEquals('Nathanmac\Utilities\Parser\Formats\QueryStr', $parser->getFormatClass()); + + unset($_SERVER['HTTP_CONTENT_TYPE']); } } diff --git a/tests/SerializeTest.php b/tests/SerializeTest.php index 8a5ed04..3a7229a 100644 --- a/tests/SerializeTest.php +++ b/tests/SerializeTest.php @@ -1,12 +1,15 @@ shouldDeferMissing() ->shouldAllowMockingProtectedMethods(); - $parser->shouldReceive('getFormat') + $parser->shouldReceive('getFormatClass') ->once() - ->andReturn('serialize'); + ->andReturn('Nathanmac\Utilities\Parser\Formats\Serialize'); $parser->shouldReceive('getPayload') ->once() ->andReturn('a:2:{s:6:"status";i:123;s:7:"message";s:11:"hello world";}'); - $this->assertEquals(array('status' => 123, 'message' => 'hello world'), $parser->payload()); + $this->assertEquals(['status' => 123, 'message' => 'hello world'], $parser->payload()); } /** @test */ public function parser_validates_serialized_data() { $parser = new Parser(); - $this->assertEquals(array('status' => 123, 'message' => 'hello world'), $parser->serialize('a:2:{s:6:"status";i:123;s:7:"message";s:11:"hello world";}')); + $this->assertEquals(['status' => 123, 'message' => 'hello world'], $parser->serialize('a:2:{s:6:"status";i:123;s:7:"message";s:11:"hello world";}')); } /** @test */ public function parser_empty_serialized_data() { $parser = new Parser(); - $this->assertEquals(array(), $parser->serialize("")); + $this->assertEquals([], $parser->serialize("")); } /** @test */ @@ -56,7 +59,10 @@ public function throws_an_exception_when_parsed_serialized_bad_data() public function format_detection_serialized() { $parser = new Parser(); + $_SERVER['HTTP_CONTENT_TYPE'] = "application/vnd.php.serialized"; - $this->assertEquals('serialize', $parser->getFormat()); + $this->assertEquals('Nathanmac\Utilities\Parser\Formats\Serialize', $parser->getFormatClass()); + + unset($_SERVER['HTTP_CONTENT_TYPE']); } } diff --git a/tests/XMLTest.php b/tests/XMLTest.php index e7b9791..13a2ed3 100644 --- a/tests/XMLTest.php +++ b/tests/XMLTest.php @@ -1,17 +1,34 @@ shouldDeferMissing() + ->shouldAllowMockingProtectedMethods(); + + $parser->shouldReceive('getPayload') + ->once() + ->andReturn('hello worldworld'); + + $this->assertEquals(["comments" => [["title" => null, "message" => "hello world"], ["title" => "world", "message" => null]]], $parser->payload('application/xml')); + } + /** @test */ public function array_structured_getPayload_xml() { @@ -23,7 +40,7 @@ public function array_structured_getPayload_xml() ->once() ->andReturn('hellohello worldworldhello world'); - $this->assertEquals(array("comments" => array(array("title" => "hello", "message" => "hello world"), array("title" => "world", "message" => "hello world"))), $parser->payload('application/xml')); + $this->assertEquals(["comments" => [["title" => "hello", "message" => "hello world"], ["title" => "world", "message" => "hello world"]]], $parser->payload('application/xml')); } /** @test */ @@ -33,16 +50,17 @@ public function parse_auto_detect_xml_data() ->shouldDeferMissing() ->shouldAllowMockingProtectedMethods(); - $parser->shouldReceive('getFormat') + $parser->shouldReceive('getFormatClass') ->once() - ->andReturn('xml'); + ->andReturn('Nathanmac\Utilities\Parser\Formats\XML'); $parser->shouldReceive('getPayload') ->once() ->andReturn("123hello world"); - $this->assertEquals(array('status' => 123, 'message' => 'hello world'), $parser->payload()); + $this->assertEquals(['status' => 123, 'message' => 'hello world'], $parser->payload()); } + /** @test */ public function parse_auto_detect_xml_data_define_content_type_as_param() { @@ -54,21 +72,42 @@ public function parse_auto_detect_xml_data_define_content_type_as_param() ->once() ->andReturn("123hello world"); - $this->assertEquals(array('status' => 123, 'message' => 'hello world'), $parser->payload('application/xml')); + $this->assertEquals(['status' => 123, 'message' => 'hello world'], $parser->payload('application/xml')); } /** @test */ public function parser_validates_xml_data() { $parser = new Parser(); - $this->assertEquals(array('status' => 123, 'message' => 'hello world'), $parser->xml("123hello world")); + $this->assertEquals(['status' => 123, 'message' => 'hello world'], $parser->xml("123hello world")); + } + + /** @test */ + public function parser_validates_xml_data_with_attribute() + { + $parser = new Parser(); + $this->assertEquals(['status' => 123, 'message' => 'hello world', '@name' => 'root'], $parser->xml("123hello world")); + } + + /** @test */ + public function parser_validates_xml_data_with_namespace() + { + $parser = new Parser(); + $this->assertEquals(['status' => 123, 'ns:message' => 'hello world'], $parser->xml("123hello world")); + } + + /** @test */ + public function parser_validates_xml_data_with_attribute_and_namespace() + { + $parser = new Parser(); + $this->assertEquals(['status' => 123, 'ns:message' => 'hello world', '@name' => 'root'], $parser->xml("123hello world")); } /** @test */ public function parser_empty_xml_data() { $parser = new Parser(); - $this->assertEquals(array(), $parser->xml("")); + $this->assertEquals([], $parser->xml("")); } /** @test */ @@ -85,10 +124,84 @@ public function format_detection_xml() $parser = new Parser(); $_SERVER['HTTP_CONTENT_TYPE'] = "application/xml"; - $this->assertEquals('xml', $parser->getFormat()); + $this->assertEquals('Nathanmac\Utilities\Parser\Formats\XML', $parser->getFormatClass()); + + $_SERVER['HTTP_CONTENT_TYPE'] = "application/xml; charset=utf8"; + $this->assertEquals('Nathanmac\Utilities\Parser\Formats\XML', $parser->getFormatClass()); + + $_SERVER['HTTP_CONTENT_TYPE'] = "charset=utf8; application/xml"; + $this->assertEquals('Nathanmac\Utilities\Parser\Formats\XML', $parser->getFormatClass()); + + $_SERVER['HTTP_CONTENT_TYPE'] = "APPLICATION/XML"; + $this->assertEquals('Nathanmac\Utilities\Parser\Formats\XML', $parser->getFormatClass()); $_SERVER['HTTP_CONTENT_TYPE'] = "text/xml"; - $this->assertEquals('xml', $parser->getFormat()); + $this->assertEquals('Nathanmac\Utilities\Parser\Formats\XML', $parser->getFormatClass()); + + unset($_SERVER['HTTP_CONTENT_TYPE']); + } + + /** @test */ + public function parser_validates_xml_with_spaces_and_new_lines() + { + $parser = new Parser(); + $this->assertEquals(['status' => 123, 'message' => 'hello world', '@name' => 'root'], $parser->xml(" \n 123 hello world")); + } + + /** @test */ + public function parser_validates_xml_with_attributes() + { + $parser = new Parser(); + $this->assertEquals(['@name' => 'root', '@status' => 'active', '#text' => 'some value'], $parser->xml("some value")); + } + + /** @test */ + public function parser_validates_complex_xml_tree() + { + $xml = ' + + + Author #1 + Book #1 + + + Author #2 + Book #2 + + + Author #1 + Book #3 + + '; + $parser = new Parser(); + $this->assertEquals( + ['Book' => [ + ['@id' => '2', 'Author' => ['@id' => 18, '#text' => 'Author #1'], 'Title' => 'Book #1'], + ['@id' => '3', 'Author' => ['@id' => 180, '#text' => 'Author #2'], 'Title' => 'Book #2'], + ['@id' => '4', 'Author' => ['@id' => 18, '#text' => 'Author #1'], 'Title' => 'Book #3'], + ],], + $parser->xml($xml) + ); + } + + /** @test */ + public function parser_validates_xml_data_with_empty_values() + { + $parser = new Parser(); + $this->assertEquals(['@name' => 'root', 'd' => [null, '1', '2']], $parser->xml("12")); + } + + /** @test */ + public function parser_validates_xml_data_with_many_empty_values() + { + $parser = new Parser(); + $this->assertEquals(['@name' => 'root', 'd' => [null, null, '2', null]], $parser->xml("2")); } -} + /** @test */ + public function parser_validates_xml_empty_values_with_spaces() + { + $parser = new Parser(); + $this->assertEquals(['@name' => 'root', 'test' => [null, ' x ', null]], $parser->xml(" \n\n\n \n x ")); + } +} diff --git a/tests/YamlTest.php b/tests/YamlTest.php index d31770b..1785988 100644 --- a/tests/YamlTest.php +++ b/tests/YamlTest.php @@ -1,12 +1,15 @@ shouldDeferMissing() ->shouldAllowMockingProtectedMethods(); - $parser->shouldReceive('getFormat') + $parser->shouldReceive('getFormatClass') ->once() - ->andReturn('yaml'); + ->andReturn('Nathanmac\Utilities\Parser\Formats\YAML'); $parser->shouldReceive('getPayload') ->once() @@ -29,14 +32,14 @@ public function parse_auto_detect_serialized_data() status: 123 message: "hello world"'); - $this->assertEquals(array('status' => 123, 'message' => 'hello world'), $parser->payload()); + $this->assertEquals(['status' => 123, 'message' => 'hello world'], $parser->payload()); } /** @test */ public function parser_validates_yaml_data() { $parser = new Parser(); - $this->assertEquals(array('status' => 123, 'message' => 'hello world'), $parser->yaml('--- + $this->assertEquals(['status' => 123, 'message' => 'hello world'], $parser->yaml('--- status: 123 message: "hello world"')); } @@ -45,7 +48,7 @@ public function parser_validates_yaml_data() public function parser_empty_yaml_data() { $parser = new Parser(); - $this->assertEquals(array(), $parser->yaml("")); + $this->assertEquals([], $parser->yaml("")); } /** @test */ @@ -63,15 +66,17 @@ public function format_detection_yaml() $parser = new Parser(); $_SERVER['HTTP_CONTENT_TYPE'] = "text/yaml"; - $this->assertEquals('yaml', $parser->getFormat()); + $this->assertEquals('Nathanmac\Utilities\Parser\Formats\YAML', $parser->getFormatClass()); $_SERVER['HTTP_CONTENT_TYPE'] = "text/x-yaml"; - $this->assertEquals('yaml', $parser->getFormat()); + $this->assertEquals('Nathanmac\Utilities\Parser\Formats\YAML', $parser->getFormatClass()); $_SERVER['HTTP_CONTENT_TYPE'] = "application/yaml"; - $this->assertEquals('yaml', $parser->getFormat()); + $this->assertEquals('Nathanmac\Utilities\Parser\Formats\YAML', $parser->getFormatClass()); $_SERVER['HTTP_CONTENT_TYPE'] = "application/x-yaml"; - $this->assertEquals('yaml', $parser->getFormat()); + $this->assertEquals('Nathanmac\Utilities\Parser\Formats\YAML', $parser->getFormatClass()); + + unset($_SERVER['HTTP_CONTENT_TYPE']); } }