diff --git a/.coveralls.yml b/.coveralls.yml index 53bda82..bc71b62 100644 --- a/.coveralls.yml +++ b/.coveralls.yml @@ -1,3 +1,2 @@ coverage_clover: clover.xml json_path: coveralls-upload.json -src_dir: src diff --git a/.gitattributes b/.gitattributes index ea5703b..16d8d29 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,8 +1,10 @@ -/test export-ignore -/vendor export-ignore -.coveralls.yml export-ignore -.gitattributes export-ignore -.gitignore export-ignore -.travis.yml export-ignore -phpcs.xml export-ignore -phpunit.xml.dist export-ignore +/.coveralls.yml export-ignore +/.gitattributes export-ignore +/.gitignore export-ignore +/.travis.yml export-ignore +/composer.lock export-ignore +/docs/ export-ignore +/mkdocs.yml export-ignore +/phpcs.xml export-ignore +/phpunit.xml.dist export-ignore +/test/ export-ignore diff --git a/.gitignore b/.gitignore index d41a109..245087a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,17 +1,7 @@ -.buildpath -.DS_Store -.idea -.project -.settings/ -.*.sw* -.*.un~ -nbproject -doc/html/ -tmp/ -vendor/ -zf-mkdoc-theme/ - -clover.xml -composer.lock -coveralls-upload.json -phpunit.xml +/clover.xml +/coveralls-upload.json +/docs/html/ +/phpunit.xml +/vendor/ +/zf-mkdoc-theme.tgz +/zf-mkdoc-theme/ diff --git a/.travis.yml b/.travis.yml index f0725a0..c5c0e62 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,63 +1,83 @@ -sudo: false - language: php -branches: - except: - - /^release-.*$/ - - /^ghgfk-.*$/ - cache: directories: - $HOME/.composer/cache - - $HOME/.local - - zf-mkdoc-theme env: global: - - SITE_URL=https://zendframework.github.io/zend-json-server - - GH_USER_NAME="Matthew Weier O'Phinney" - - GH_USER_EMAIL=matthew@weierophinney.net - - GH_REF=github.com/zendframework/zend-json-server.git - - secure: "HY4Zd9s8DQ1Qp2Ru2RwnTY67CxQ0ckdpBlt02QXvIKh8HMjwb5EochsQv0uj1Q2c5WigBLIHKN3Tv4WoCkSncDBsPR242vC02X9v78ZOZRirsicw/PES4cQ67/qT+biFXeM3wW9ME4DbSAcV5esL934wN99fCfNoPGkCLpL7LoNFUKf7medLJ72xulNP7mXpQOQCPBuB9ZixtItCO/DW9XouZ32ckoPjJiM6FSPszVbMyItK2+rNWjQ9BsxIGQsdPoX+jths8oHrTJJ5jabFNh527Az+n3kPhHLXy1CpU8CMSXSXEFOLxeJfMgVw4XbsKFarKqVcRvsSVPo4M6NFHUNX7SmT9p0DxfMDbc2avhp8CfSuvn675wKLwg3P2htwB41eB6XkOwwE0PTcsDBCbk0Y2JHyEp5KTTbwUSSUNU3ISpGUO+KBU82dyeiTb/YPBmA5yFE9UgxGDcI7UqReqQNamNFkI2ns4OjCwIH0X1fzIb2OAA7wvOGKib9N/FP9dz+gXJ59cH0YRAeA4Kob0N3WqjMHF4noiBCkGiCUIUHr2Bi9ceZnf4qDEKxbp3MFN7nKdfgiJQ1aU9ZLvjqhYCsW/8mx+7KNtjRF5tUtMQDrsJXt34pIoPmj0IudJQQx98xAPpWpZx7Czbrd53dkwEzqdcTHDMS3bfuqIKcrp60=" + - COMPOSER_ARGS="--no-interaction" + - COVERAGE_DEPS="php-coveralls/php-coveralls" matrix: - fast_finish: true include: - - php: 5.5 + - php: 5.6 env: - - DEPLOY_DOCS="$(if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then echo -n 'true' ; else echo -n 'false' ; fi)" - - PATH="$HOME/.local/bin:$PATH" + - DEPS=lowest - php: 5.6 env: - - EXECUTE_TEST_COVERALLS=true + - DEPS=locked + - LEGACY_DEPS="phpunit/phpunit zendframework/zend-code" + - php: 5.6 + env: + - DEPS=latest - php: 7 env: - - EXECUTE_CS_CHECK=true - - php: hhvm - allow_failures: - - php: hhvm - -notifications: - irc: "irc.freenode.org#zftalk.dev" - email: false + - DEPS=lowest + - php: 7 + env: + - DEPS=locked + - LEGACY_DEPS="phpunit/phpunit zendframework/zend-code" + - php: 7 + env: + - DEPS=latest + - php: 7.1 + env: + - DEPS=lowest + - php: 7.1 + env: + - DEPS=locked + - CS_CHECK=true + - TEST_COVERAGE=true + - php: 7.1 + env: + - DEPS=latest + - php: 7.2 + env: + - DEPS=lowest + - php: 7.2 + env: + - DEPS=locked + - php: 7.2 + env: + - DEPS=latest + - php: 7.3 + env: + - DEPS=lowest + - php: 7.3 + env: + - DEPS=locked + - php: 7.3 + env: + - DEPS=latest before_install: - - if [[ $EXECUTE_TEST_COVERALLS != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi - - travis_retry composer self-update - - if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then composer require --dev --no-update satooshi/php-coveralls ; fi + - if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi install: - - travis_retry composer install --no-interaction --ignore-platform-reqs + - travis_retry composer install $COMPOSER_ARGS --ignore-platform-reqs + - if [[ $LEGACY_DEPS != '' ]]; then travis_retry composer update $COMPOSER_ARGS --with-dependencies $LEGACY_DEPS ; fi + - if [[ $DEPS == 'latest' ]]; then travis_retry composer update $COMPOSER_ARGS ; fi + - if [[ $DEPS == 'lowest' ]]; then travis_retry composer update --prefer-lowest --prefer-stable $COMPOSER_ARGS ; fi + - if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry composer require --dev $COMPOSER_ARGS $COVERAGE_DEPS ; fi + - stty cols 120 && composer show script: - - if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then composer test-coverage ; fi - - if [[ $EXECUTE_TEST_COVERALLS != 'true' ]]; then composer test ; fi - - if [[ $EXECUTE_CS_CHECK == 'true' ]]; then composer cs-check ; fi - - if [[ $DEPLOY_DOCS == "true" && "$TRAVIS_TEST_RESULT" == "0" ]]; then wget -O theme-installer.sh "https://raw.githubusercontent.com/zendframework/zf-mkdoc-theme/master/theme-installer.sh" ; chmod 755 theme-installer.sh ; ./theme-installer.sh ; fi - -after_success: - - if [[ $DEPLOY_DOCS == "true" ]]; then echo "Preparing to build and deploy documentation" ; ./zf-mkdoc-theme/deploy.sh ; echo "Completed deploying documentation" ; fi + - if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage ; else composer test ; fi + - if [[ $CS_CHECK == 'true' ]]; then composer cs-check ; fi after_script: - - if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then composer upload-coverage ; fi + - if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry php vendor/bin/php-coveralls -v ; fi + +notifications: + email: false diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ebe0dd..444d391 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,12 +2,16 @@ All notable changes to this project will be documented in this file, in reverse chronological order by release. -## 3.0.1 - TBD +## 3.2.1 - TBD ### Added - Nothing. +### Changed + +- Nothing. + ### Deprecated - Nothing. @@ -20,6 +24,62 @@ All notable changes to this project will be documented in this file, in reverse - Nothing. +## 3.2.0 - 2019-10-17 + +### Added + +- [#14](https://github.com/zendframework/zend-json-server/pull/14) adds support for PHP 7.3. + +### Changed + +- Nothing. + +### Deprecated + +- Nothing. + +### Removed + +- [#14](https://github.com/zendframework/zend-json-server/pull/14) removes support for zend-stdlib v2 releases. + +### Fixed + +- Nothing. + +## 3.1.0 - 2018-04-25 + +### Added + +- [#13](https://github.com/zendframework/zend-json-server/pull/13) adds support for PHP 7.1 and 7.2. + +### Changed + +- [#6](https://github.com/zendframework/zend-json-server/pull/6) updates the default `Accept` and `Content-Type` header values issued + by the `Client` to `application/json-rpc`, which is more correct per the JSON-RPC spec. + +### Deprecated + +- Nothing. + +### Removed + +- [#13](https://github.com/zendframework/zend-json-server/pull/13) removes support for PHP 5.5. + +- [#13](https://github.com/zendframework/zend-json-server/pull/13) removes support for HHVM. + +### Fixed + +- [#6](https://github.com/zendframework/zend-json-server/pull/6) fixes how the `Client` handles the `Accept` and `Content-Type` headers, + honoring those already present in the request, and providing defaults if not. + +- [#4](https://github.com/zendframework/zend-json-server/pull/4) provides a fix to how parameters are validated, ensuring default values + are provided when known (and only when named parameters are provided), and an error + is raised when not enough parameters are provided. + +- [#2](https://github.com/zendframework/zend-json-server/pull/2) fixes an issue with how the `Response::setOptions()` method would handle a + key of `0`; previously, it would (incorrectly) set the JSON-RPC version of the response; + now it does not. + ## 3.0.0 - 2015-03-31 First release as a standalone component. Previous releases were as part of diff --git a/LICENSE.md b/LICENSE.md index dbb1b49..d44ab5d 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,16 +1,15 @@ -Copyright (c) 2005-2015, Zend Technologies USA, Inc. - +Copyright (c) 2005-2018, Zend Technologies USA, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -- Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. +- Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. -- Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. +- Redistributions in binary form must reproduce the above copyright notice, this + list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. - Neither the name of Zend Technologies USA, Inc. nor the names of its contributors may be used to endorse or promote products derived from this diff --git a/README.md b/README.md index 078fc91..2b4647c 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,13 @@ # zend-json-server +> ## Repository abandoned 2019-12-31 +> +> This repository has moved to [laminas/laminas-json-server](https://github.com/laminas/laminas-json-server). + [![Build Status](https://secure.travis-ci.org/zendframework/zend-json-server.svg?branch=master)](https://secure.travis-ci.org/zendframework/zend-json-server) -[![Coverage Status](https://coveralls.io/repos/zendframework/zend-json-server/badge.svg?branch=master)](https://coveralls.io/r/zendframework/zend-json-server?branch=master) +[![Coverage Status](https://coveralls.io/repos/github/zendframework/zend-json-server/badge.svg?branch=master)](https://coveralls.io/github/zendframework/zend-json-server?branch=master) Provides a JSON-RPC server implementation. - File issues at https://github.com/zendframework/zend-json-server/issues -- Documentation is at http://framework.zend.com/manual/current/en/index.html#zend-json-server +- Documentation is at https://docs.zendframework.com/zend-json-server/ diff --git a/composer.json b/composer.json index 6e72e7a..9d99e7b 100644 --- a/composer.json +++ b/composer.json @@ -3,50 +3,63 @@ "description": "Zend Json-Server is a JSON-RPC server implementation.", "license": "BSD-3-Clause", "keywords": [ - "zf2", + "zf", + "zendframework", "json", "server", "json-server" ], - "homepage": "https://github.com/zendframework/zend-json-server", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev", - "dev-develop": "3.1-dev" - } + "support": { + "docs": "https://docs.zendframework.com/zend-json-server/", + "issues": "https://github.com/zendframework/zend-json-server/issues", + "source": "https://github.com/zendframework/zend-json-server", + "rss": "https://github.com/zendframework/zend-json-server/releases.atom", + "chat": "https://zendframework-slack.herokuapp.com", + "forum": "https://discourse.zendframework.com/c/questions/components" }, "require": { - "php": "^5.5 || ^7.0", + "php": "^5.6 || ^7.0", + "zendframework/zend-http": "^2.7", "zendframework/zend-json": "^2.6.1 || ^3.0", - "zendframework/zend-http": "^2.5.4", - "zendframework/zend-server": "^2.6.1" + "zendframework/zend-server": "^2.7" }, "require-dev": { - "squizlabs/php_codesniffer": "^2.3", - "phpunit/PHPUnit": "~4.0" + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", + "zendframework/zend-coding-standard": "~1.0.0" }, "autoload": { "psr-4": { "Zend\\Json\\Server\\": "src/" } }, + "conflict": { + "zendframework/zend-stdlib": "<3.2.1" + }, "autoload-dev": { - "psr-4": { - "ZendTest\\Json\\Server\\": "test/" - }, "files": [ "test/TestAsset/FooFunc.php" - ] + ], + "psr-4": { + "ZendTest\\Json\\Server\\": "test/" + } + }, + "config": { + "sort-packages": true + }, + "extra": { + "branch-alias": { + "dev-master": "3.2.x-dev", + "dev-develop": "3.3.x-dev" + } }, "scripts": { "check": [ "@cs-check", "@test" ], - "upload-coverage": "coveralls", "cs-check": "phpcs", - "cs-fix": "phpcbf fix -v", - "test": "phpunit", - "test-coverage": "phpunit --coverage-clover clover.xml" + "cs-fix": "phpcbf", + "test": "phpunit --colors=always", + "test-coverage": "phpunit --colors=always --coverage-clover clover.xml" } } diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..df0d787 --- /dev/null +++ b/composer.lock @@ -0,0 +1,2170 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "f08a2a3612d4f1870b4275a6300c7f09", + "packages": [ + { + "name": "container-interop/container-interop", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/container-interop/container-interop.git", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/container-interop/container-interop/zipball/79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "reference": "79cbf1341c22ec75643d841642dd5d6acd83bdb8", + "shasum": "" + }, + "require": { + "psr/container": "^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Interop\\Container\\": "src/Interop/Container/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", + "homepage": "https://github.com/container-interop/container-interop", + "time": "2017-02-14T19:40:03+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": "zendframework/zend-code", + "version": "3.3.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-code.git", + "reference": "6b1059db5b368db769e4392c6cb6cc139e56640d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-code/zipball/6b1059db5b368db769e4392c6cb6cc139e56640d", + "reference": "6b1059db5b368db769e4392c6cb6cc139e56640d", + "shasum": "" + }, + "require": { + "php": "^7.1", + "zendframework/zend-eventmanager": "^2.6 || ^3.0" + }, + "require-dev": { + "doctrine/annotations": "~1.0", + "ext-phar": "*", + "phpunit/phpunit": "^6.2.3", + "zendframework/zend-coding-standard": "^1.0.0", + "zendframework/zend-stdlib": "^2.7 || ^3.0" + }, + "suggest": { + "doctrine/annotations": "Doctrine\\Common\\Annotations >=1.0 for annotation features", + "zendframework/zend-stdlib": "Zend\\Stdlib component" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev", + "dev-develop": "3.3-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Code\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides facilities to generate arbitrary code using an object oriented interface", + "homepage": "https://github.com/zendframework/zend-code", + "keywords": [ + "code", + "zf2" + ], + "time": "2017-10-20T15:21:32+00:00" + }, + { + "name": "zendframework/zend-escaper", + "version": "2.5.2", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-escaper.git", + "reference": "2dcd14b61a72d8b8e27d579c6344e12c26141d4e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-escaper/zipball/2dcd14b61a72d8b8e27d579c6344e12c26141d4e", + "reference": "2dcd14b61a72d8b8e27d579c6344e12c26141d4e", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5-dev", + "dev-develop": "2.6-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Escaper\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "homepage": "https://github.com/zendframework/zend-escaper", + "keywords": [ + "escaper", + "zf2" + ], + "time": "2016-06-30T19:48:38+00:00" + }, + { + "name": "zendframework/zend-eventmanager", + "version": "3.2.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-eventmanager.git", + "reference": "9d72db10ceb6e42fb92350c0cb54460da61bd79c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/9d72db10ceb6e42fb92350c0cb54460da61bd79c", + "reference": "9d72db10ceb6e42fb92350c0cb54460da61bd79c", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "athletic/athletic": "^0.1", + "container-interop/container-interop": "^1.1.0", + "phpunit/phpunit": "^6.0.7 || ^5.7.14", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-stdlib": "^2.7.3 || ^3.0" + }, + "suggest": { + "container-interop/container-interop": "^1.1.0, to use the lazy listeners feature", + "zendframework/zend-stdlib": "^2.7.3 || ^3.0, to use the FilterChain feature" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev", + "dev-develop": "3.3-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\EventManager\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Trigger and listen to events within a PHP application", + "homepage": "https://github.com/zendframework/zend-eventmanager", + "keywords": [ + "event", + "eventmanager", + "events", + "zf2" + ], + "time": "2017-07-11T19:17:22+00:00" + }, + { + "name": "zendframework/zend-http", + "version": "2.7.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-http.git", + "reference": "78aa510c0ea64bfb2aa234f50c4f232c9531acfa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-http/zipball/78aa510c0ea64bfb2aa234f50c4f232c9531acfa", + "reference": "78aa510c0ea64bfb2aa234f50c4f232c9531acfa", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0", + "zendframework/zend-loader": "^2.5.1", + "zendframework/zend-stdlib": "^3.1 || ^2.7.7", + "zendframework/zend-uri": "^2.5.2", + "zendframework/zend-validator": "^2.10.1" + }, + "require-dev": { + "phpunit/phpunit": "^6.4.1 || ^5.7.15", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-config": "^3.1 || ^2.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev", + "dev-develop": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Http\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides an easy interface for performing Hyper-Text Transfer Protocol (HTTP) requests", + "homepage": "https://github.com/zendframework/zend-http", + "keywords": [ + "ZendFramework", + "http", + "http client", + "zend", + "zf" + ], + "time": "2017-10-13T12:06:24+00:00" + }, + { + "name": "zendframework/zend-json", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-json.git", + "reference": "f42a1588e75c2a3e338cd94c37906231e616daab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-json/zipball/f42a1588e75c2a3e338cd94c37906231e616daab", + "reference": "f42a1588e75c2a3e338cd94c37906231e616daab", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "^2.3", + "zendframework/zend-stdlib": "^2.7 || ^3.0" + }, + "suggest": { + "zendframework/zend-json-server": "For implementing JSON-RPC servers", + "zendframework/zend-xml2json": "For converting XML documents to JSON" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev", + "dev-develop": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Json\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides convenience methods for serializing native PHP to JSON and decoding JSON to native PHP", + "homepage": "https://github.com/zendframework/zend-json", + "keywords": [ + "json", + "zf2" + ], + "time": "2016-04-01T02:34:00+00:00" + }, + { + "name": "zendframework/zend-loader", + "version": "2.5.1", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-loader.git", + "reference": "c5fd2f071bde071f4363def7dea8dec7393e135c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-loader/zipball/c5fd2f071bde071f4363def7dea8dec7393e135c", + "reference": "c5fd2f071bde071f4363def7dea8dec7393e135c", + "shasum": "" + }, + "require": { + "php": ">=5.3.23" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5-dev", + "dev-develop": "2.6-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Loader\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "homepage": "https://github.com/zendframework/zend-loader", + "keywords": [ + "loader", + "zf2" + ], + "time": "2015-06-03T14:05:47+00:00" + }, + { + "name": "zendframework/zend-server", + "version": "2.7.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-server.git", + "reference": "7cb617ca3e9b24579f544a244ee79ae61f480914" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-server/zipball/7cb617ca3e9b24579f544a244ee79ae61f480914", + "reference": "7cb617ca3e9b24579f544a244ee79ae61f480914", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0", + "zendframework/zend-code": "^2.5 || ^3.0", + "zendframework/zend-stdlib": "^2.5 || ^3.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8", + "squizlabs/php_codesniffer": "^2.3.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev", + "dev-develop": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Server\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "homepage": "https://github.com/zendframework/zend-server", + "keywords": [ + "server", + "zf2" + ], + "time": "2016-06-20T22:27:55+00:00" + }, + { + "name": "zendframework/zend-stdlib", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-stdlib.git", + "reference": "66536006722aff9e62d1b331025089b7ec71c065" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/66536006722aff9e62d1b331025089b7ec71c065", + "reference": "66536006722aff9e62d1b331025089b7ec71c065", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpbench/phpbench": "^0.13", + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", + "zendframework/zend-coding-standard": "~1.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2.x-dev", + "dev-develop": "3.3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Stdlib\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "SPL extensions, array utilities, error handlers, and more", + "keywords": [ + "ZendFramework", + "stdlib", + "zf" + ], + "time": "2018-08-28T21:34:05+00:00" + }, + { + "name": "zendframework/zend-uri", + "version": "2.5.2", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-uri.git", + "reference": "0bf717a239432b1a1675ae314f7c4acd742749ed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-uri/zipball/0bf717a239432b1a1675ae314f7c4acd742749ed", + "reference": "0bf717a239432b1a1675ae314f7c4acd742749ed", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "zendframework/zend-escaper": "^2.5", + "zendframework/zend-validator": "^2.5" + }, + "require-dev": { + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.5-dev", + "dev-develop": "2.6-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Uri\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "a component that aids in manipulating and validating ยป Uniform Resource Identifiers (URIs)", + "homepage": "https://github.com/zendframework/zend-uri", + "keywords": [ + "uri", + "zf2" + ], + "time": "2016-02-17T22:38:51+00:00" + }, + { + "name": "zendframework/zend-validator", + "version": "2.10.1", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-validator.git", + "reference": "010084ddbd33299bf51ea6f0e07f8f4e8bd832a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-validator/zipball/010084ddbd33299bf51ea6f0e07f8f4e8bd832a8", + "reference": "010084ddbd33299bf51ea6f0e07f8f4e8bd832a8", + "shasum": "" + }, + "require": { + "container-interop/container-interop": "^1.1", + "php": "^5.6 || ^7.0", + "zendframework/zend-stdlib": "^2.7.6 || ^3.1" + }, + "require-dev": { + "phpunit/phpunit": "^6.0.8 || ^5.7.15", + "zendframework/zend-cache": "^2.6.1", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-config": "^2.6", + "zendframework/zend-db": "^2.7", + "zendframework/zend-filter": "^2.6", + "zendframework/zend-http": "^2.5.4", + "zendframework/zend-i18n": "^2.6", + "zendframework/zend-math": "^2.6", + "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3", + "zendframework/zend-session": "^2.8", + "zendframework/zend-uri": "^2.5" + }, + "suggest": { + "zendframework/zend-db": "Zend\\Db component, required by the (No)RecordExists validator", + "zendframework/zend-filter": "Zend\\Filter component, required by the Digits validator", + "zendframework/zend-i18n": "Zend\\I18n component to allow translation of validation error messages", + "zendframework/zend-i18n-resources": "Translations of validator messages", + "zendframework/zend-math": "Zend\\Math component, required by the Csrf validator", + "zendframework/zend-servicemanager": "Zend\\ServiceManager component to allow using the ValidatorPluginManager and validator chains", + "zendframework/zend-session": "Zend\\Session component, ^2.8; required by the Csrf validator", + "zendframework/zend-uri": "Zend\\Uri component, required by the Uri and Sitemap\\Loc validators" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.10-dev", + "dev-develop": "2.11-dev" + }, + "zf": { + "component": "Zend\\Validator", + "config-provider": "Zend\\Validator\\ConfigProvider" + } + }, + "autoload": { + "psr-4": { + "Zend\\Validator\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides a set of commonly needed validators", + "homepage": "https://github.com/zendframework/zend-validator", + "keywords": [ + "validator", + "zf2" + ], + "time": "2017-08-22T14:19:23+00:00" + } + ], + "packages-dev": [ + { + "name": "doctrine/instantiator", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "^6.2.3", + "squizlabs/php_codesniffer": "^3.0.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/doctrine/instantiator", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2017-07-22T11:58:36+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.7.0", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^4.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "time": "2017-10-19T19:58:43+00:00" + }, + { + "name": "phar-io/manifest", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "phar-io/version": "^1.0.1", + "php": "^5.6 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "time": "2017-03-05T18:14:27+00:00" + }, + { + "name": "phar-io/version", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "time": "2017-03-05T17:38:23+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2017-09-11T18:02:19+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "4.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08", + "shasum": "" + }, + "require": { + "php": "^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "doctrine/instantiator": "~1.0.5", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.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": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2017-11-30T07:14:17+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.4.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "time": "2017-07-14T14:27:02+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.7.5", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/dfd6be44111a7c41c2e884a336cc4f461b3b2401", + "reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "sebastian/comparator": "^1.1|^2.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.7.x-dev" + } + }, + "autoload": { + "psr-0": { + "Prophecy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "time": "2018-02-19T10:16:54+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "6.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "774a82c0c5da4c1c7701790c262035d235ab7856" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/774a82c0c5da4c1c7701790c262035d235ab7856", + "reference": "774a82c0c5da4c1c7701790c262035d235ab7856", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^7.1", + "phpunit/php-file-iterator": "^1.4.2", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-token-stream": "^3.0", + "sebastian/code-unit-reverse-lookup": "^1.0.1", + "sebastian/environment": "^3.1", + "sebastian/version": "^2.0.1", + "theseer/tokenizer": "^1.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.0" + }, + "suggest": { + "ext-xdebug": "^2.6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2018-04-06T15:39:20+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": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "8b8454ea6958c3dee38453d3bd571e023108c91f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/8b8454ea6958c3dee38453d3bd571e023108c91f", + "reference": "8b8454ea6958c3dee38453d3bd571e023108c91f", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2018-02-01T13:07:23+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "21ad88bbba7c3d93530d93994e0a33cd45f02ace" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/21ad88bbba7c3d93530d93994e0a33cd45f02ace", + "reference": "21ad88bbba7c3d93530d93994e0a33cd45f02ace", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2018-02-01T13:16:43+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "7.1.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "6a17c170fb92845896e1b3b00fcb462cd4b3c017" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/6a17c170fb92845896e1b3b00fcb462cd4b3c017", + "reference": "6a17c170fb92845896e1b3b00fcb462cd4b3c017", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "^1.6.1", + "phar-io/manifest": "^1.0.1", + "phar-io/version": "^1.0", + "php": "^7.1", + "phpspec/prophecy": "^1.7", + "phpunit/php-code-coverage": "^6.0.1", + "phpunit/php-file-iterator": "^1.4.3", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-timer": "^2.0", + "phpunit/phpunit-mock-objects": "^6.1", + "sebastian/comparator": "^2.1", + "sebastian/diff": "^3.0", + "sebastian/environment": "^3.1", + "sebastian/exporter": "^3.1", + "sebastian/global-state": "^2.0", + "sebastian/object-enumerator": "^3.0.3", + "sebastian/resource-operations": "^1.0", + "sebastian/version": "^2.0.1" + }, + "require-dev": { + "ext-pdo": "*" + }, + "suggest": { + "ext-xdebug": "*", + "phpunit/php-invoker": "^2.0" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "7.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2018-04-10T11:40:22+00:00" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "6.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "70c740bde8fd9ea9ea295be1cd875dd7b267e157" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/70c740bde8fd9ea9ea295be1cd875dd7b267e157", + "reference": "70c740bde8fd9ea9ea295be1cd875dd7b267e157", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.5", + "php": "^7.1", + "phpunit/php-text-template": "^1.2.1", + "sebastian/exporter": "^3.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.0" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2018-04-11T04:50:36+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "time": "2017-03-04T06:30:41+00:00" + }, + { + "name": "sebastian/comparator", + "version": "2.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/34369daee48eafb2651bea869b4b15d75ccc35f9", + "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/diff": "^2.0 || ^3.0", + "sebastian/exporter": "^3.1" + }, + "require-dev": { + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2018-02-01T13:46:46+00:00" + }, + { + "name": "sebastian/diff", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "e09160918c66281713f1c324c1f4c4c3037ba1e8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/e09160918c66281713f1c324c1f4c4c3037ba1e8", + "reference": "e09160918c66281713f1c324c1f4c4c3037ba1e8", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.0", + "symfony/process": "^2 || ^3.3 || ^4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "time": "2018-02-01T13:45:15+00:00" + }, + { + "name": "sebastian/environment", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2017-07-01T08:51:00+00:00" + }, + { + "name": "sebastian/exporter", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/recursion-context": "^3.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "time": "2017-04-03T13:19:02+00:00" + }, + { + "name": "sebastian/global-state", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2017-04-27T15:39:26+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2017-08-03T12:35:26+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "773f97c67f28de00d397be301821b06708fca0be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", + "reference": "773f97c67f28de00d397be301821b06708fca0be", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "time": "2017-03-29T09:07:27+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2017-03-03T06:23:57+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2015-07-28T20:34:47+00:00" + }, + { + "name": "sebastian/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "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": "squizlabs/php_codesniffer", + "version": "2.9.1", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/dcbed1074f8244661eecddfc2a675430d8d33f62", + "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "bin": [ + "scripts/phpcs", + "scripts/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "classmap": [ + "CodeSniffer.php", + "CodeSniffer/CLI.php", + "CodeSniffer/Exception.php", + "CodeSniffer/File.php", + "CodeSniffer/Fixer.php", + "CodeSniffer/Report.php", + "CodeSniffer/Reporting.php", + "CodeSniffer/Sniff.php", + "CodeSniffer/Tokens.php", + "CodeSniffer/Reports/", + "CodeSniffer/Tokenizers/", + "CodeSniffer/DocGenerators/", + "CodeSniffer/Standards/AbstractPatternSniff.php", + "CodeSniffer/Standards/AbstractScopeSniff.php", + "CodeSniffer/Standards/AbstractVariableSniff.php", + "CodeSniffer/Standards/IncorrectPatternException.php", + "CodeSniffer/Standards/Generic/Sniffs/", + "CodeSniffer/Standards/MySource/Sniffs/", + "CodeSniffer/Standards/PEAR/Sniffs/", + "CodeSniffer/Standards/PSR1/Sniffs/", + "CodeSniffer/Standards/PSR2/Sniffs/", + "CodeSniffer/Standards/Squiz/Sniffs/", + "CodeSniffer/Standards/Zend/Sniffs/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "http://www.squizlabs.com/php-codesniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2017-05-22T02:43:20+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "time": "2017-04-07T12:08:54+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "0df1908962e7a3071564e857d86874dad1ef204a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", + "reference": "0df1908962e7a3071564e857d86874dad1ef204a", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2018-01-29T19:49:41+00:00" + }, + { + "name": "zendframework/zend-coding-standard", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-coding-standard.git", + "reference": "893316d2904e93f1c74c1384b6d7d57778299cb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-coding-standard/zipball/893316d2904e93f1c74c1384b6d7d57778299cb6", + "reference": "893316d2904e93f1c74c1384b6d7d57778299cb6", + "shasum": "" + }, + "require": { + "squizlabs/php_codesniffer": "^2.7" + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Zend Framework coding standard", + "keywords": [ + "Coding Standard", + "zf" + ], + "time": "2016-11-09T21:30:43+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": "^5.6 || ^7.0" + }, + "platform-dev": [] +} diff --git a/CONDUCT.md b/docs/CODE_OF_CONDUCT.md similarity index 96% rename from CONDUCT.md rename to docs/CODE_OF_CONDUCT.md index c663d2b..02fafcd 100644 --- a/CONDUCT.md +++ b/docs/CODE_OF_CONDUCT.md @@ -1,6 +1,6 @@ # Contributor Code of Conduct -The Zend Framework project adheres to [The Code Manifesto](http://codemanifesto.com) +This project adheres to [The Code Manifesto](http://codemanifesto.com) as its guidelines for contributor interactions. ## The Code Manifesto diff --git a/CONTRIBUTING.md b/docs/CONTRIBUTING.md similarity index 52% rename from CONTRIBUTING.md rename to docs/CONTRIBUTING.md index 44ae18e..df0f831 100644 --- a/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -2,73 +2,43 @@ ## RESOURCES -If you wish to contribute to Zend Framework, please be sure to +If you wish to contribute to this project, please be sure to read/subscribe to the following resources: - - [Coding Standards](https://github.com/zendframework/zf2/wiki/Coding-Standards) - - [Contributor's Guide](http://framework.zend.com/participate/contributor-guide) - - ZF Contributor's mailing list: - Archives: http://zend-framework-community.634137.n4.nabble.com/ZF-Contributor-f680267.html - Subscribe: zf-contributors-subscribe@lists.zend.com - - ZF Contributor's IRC channel: - #zftalk.dev on Freenode.net + - [Coding Standards](https://github.com/zendframework/zend-coding-standard) + - [Forums](https://discourse.zendframework.com/c/contributors) + - [Chat](https://zendframework-slack.herokuapp.com) + - [Code of Conduct](CODE_OF_CONDUCT.md) -If you are working on new features or refactoring [create a proposal](https://github.com/zendframework/zend-json-server/issues/new). - -## Reporting Potential Security Issues - -If you have encountered a potential security vulnerability, please **DO NOT** report it on the public -issue tracker: send it to us at [zf-security@zend.com](mailto:zf-security@zend.com) instead. -We will work with you to verify the vulnerability and patch it as soon as possible. - -When reporting issues, please provide the following information: - -- Component(s) affected -- A description indicating how to reproduce the issue -- A summary of the security vulnerability and impact - -We request that you contact us via the email address above and give the project -contributors a chance to resolve the vulnerability and issue a new release prior -to any public exposure; this helps protect users and provides them with a chance -to upgrade and/or update in order to protect their applications. - -For sensitive email communications, please use [our PGP key](http://framework.zend.com/zf-security-pgp-key.asc). +If you are working on new features or refactoring +[create a proposal](https://github.com/zendframework/zend-json-server/issues/new). ## RUNNING TESTS -> ### Note: testing versions prior to 2.4 -> -> This component originates with Zend Framework 2. During the lifetime of ZF2, -> testing infrastructure migrated from PHPUnit 3 to PHPUnit 4. In most cases, no -> changes were necessary. However, due to the migration, tests may not run on -> versions < 2.4. As such, you may need to change the PHPUnit dependency if -> attempting a fix on such a version. - To run tests: - Clone the repository: ```console - $ git clone git@github.com:zendframework/zend-json-server.git - $ cd + $ git clone git://github.com/zendframework/zend-json-server.git + $ cd zend-json-server ``` - Install dependencies via composer: ```console - $ curl -sS https://getcomposer.org/installer | php -- - $ ./composer.phar install + $ composer install ``` - If you don't have `curl` installed, you can also download `composer.phar` from https://getcomposer.org/ + If you don't have `composer` installed, please download it from https://getcomposer.org/download/ -- Run the tests via `phpunit` and the provided PHPUnit config, like in this example: +- Run the tests using the "test" command shipped in the `composer.json`: ```console - $ ./vendor/bin/phpunit + $ composer test ``` -You can turn on conditional tests with the phpunit.xml file. +You can turn on conditional tests with the `phpunit.xml` file. To do so: - Copy `phpunit.xml.dist` file to `phpunit.xml` @@ -77,24 +47,22 @@ To do so: ## Running Coding Standards Checks -This component uses [php-cs-fixer](http://cs.sensiolabs.org/) for coding -standards checks, and provides configuration for our selected checks. -`php-cs-fixer` is installed by default via Composer. +First, ensure you've installed dependencies via composer, per the previous +section on running tests. -To run checks only: +To run CS checks only: ```console -$ ./vendor/bin/php-cs-fixer fix . -v --diff --dry-run --config-file=.php_cs +$ composer cs-check ``` -To have `php-cs-fixer` attempt to fix problems for you, omit the `--dry-run` -flag: +To attempt to automatically fix common CS issues: ```console -$ ./vendor/bin/php-cs-fixer fix . -v --diff --config-file=.php_cs +$ composer cs-fix ``` -If you allow php-cs-fixer to fix CS issues, please re-run the tests to ensure +If the above fixes any CS issues, please re-run the tests to ensure they pass, and make sure you add and commit the changes after verification. ## Recommended Workflow for Contributions @@ -103,12 +71,12 @@ Your first step is to establish a public repository from which we can pull your work into the master repository. We recommend using [GitHub](https://github.com), as that is where the component is already hosted. -1. Setup a [GitHub account](http://github.com/), if you haven't yet -2. Fork the repository (http://github.com/zendframework/zend-json-server) +1. Setup a [GitHub account](https://github.com/), if you haven't yet +2. Fork the repository (https://github.com/zendframework/zend-json-server) 3. Clone the canonical repository locally and enter it. ```console - $ git clone git://github.com:zendframework/zend-json-server.git + $ git clone git://github.com/zendframework/zend-json-server.git $ cd zend-json-server ``` @@ -188,15 +156,7 @@ To send a pull request, you have two options. If using GitHub, you can do the pull request from there. Navigate to your repository, select the branch you just created, and then select the "Pull Request" button in the upper right. Select the user/organization -"zendframework" as the recipient. - -If using your own repository - or even if using GitHub - you can use `git -format-patch` to create a patchset for us to apply; in fact, this is -**recommended** for security-related patches. If you use `format-patch`, please -send the patches as attachments to: - -- zf-devteam@zend.com for patches without security implications -- zf-security@zend.com for security patches +"zendframework" (or whatever the upstream organization is) as the recipient. #### What branch to issue the pull request against? @@ -227,8 +187,3 @@ repository, we suggest doing some cleanup of these branches. ```console $ git push {username} : ``` - - -## Conduct - -Please see our [CONDUCT.md](CONDUCT.md) to understand expected behavior when interacting with others in the project. diff --git a/docs/ISSUE_TEMPLATE.md b/docs/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..a16797d --- /dev/null +++ b/docs/ISSUE_TEMPLATE.md @@ -0,0 +1,19 @@ + - [ ] I was not able to find an [open](https://github.com/zendframework/zend-json-server/issues?q=is%3Aopen) or [closed](https://github.com/zendframework/zend-json-server/issues?q=is%3Aclosed) issue matching what I'm seeing. + - [ ] This is not a question. (Questions should be asked on [chat](https://zendframework.slack.com/) ([Signup here](https://zendframework-slack.herokuapp.com/)) or our [forums](https://discourse.zendframework.com/).) + +Provide a narrative description of what you are trying to accomplish. + +### Code to reproduce the issue + + + +```php +``` + +### Expected results + + + +### Actual results + + diff --git a/docs/PULL_REQUEST_TEMPLATE.md b/docs/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..f00d90c --- /dev/null +++ b/docs/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,25 @@ +Provide a narrative description of what you are trying to accomplish: + +- [ ] Are you fixing a bug? + - [ ] Detail how the bug is invoked currently. + - [ ] Detail the original, incorrect behavior. + - [ ] Detail the new, expected behavior. + - [ ] Base your feature on the `master` branch, and submit against that branch. + - [ ] Add a regression test that demonstrates the bug, and proves the fix. + - [ ] Add a `CHANGELOG.md` entry for the fix. + +- [ ] Are you creating a new feature? + - [ ] Why is the new feature needed? What purpose does it serve? + - [ ] How will users use the new feature? + - [ ] Base your feature on the `develop` branch, and submit against that branch. + - [ ] Add only one feature per pull request; split multiple features over multiple pull requests + - [ ] Add tests for the new feature. + - [ ] Add documentation for the new feature. + - [ ] Add a `CHANGELOG.md` entry for the new feature. + +- [ ] Is this related to quality assurance? + + +- [ ] Is this related to documentation? + + diff --git a/docs/SUPPORT.md b/docs/SUPPORT.md new file mode 100644 index 0000000..8734faa --- /dev/null +++ b/docs/SUPPORT.md @@ -0,0 +1,25 @@ +# Getting Support + +Zend Framework offers three support channels: + +- For real-time questions, use our + [chat](https://zendframework-slack.herokuapp.com) +- For detailed questions (e.g., those requiring examples) use our + [forums](https://discourse.zendframework.com/c/questions/components) +- To report issues, use this repository's + [issue tracker](https://github.com/zendframework/zend-json-server/issues/new) + +**DO NOT** use the issue tracker to ask questions; use chat or the forums for +that. Questions posed to the issue tracker will be closed. + +When reporting an issue, please include the following details: + +- A narrative description of what you are trying to accomplish. +- The minimum code necessary to reproduce the issue. +- The expected results of exercising that code. +- The actual results received. + +We may ask for additional details: what version of the library you are using, +and what PHP version was used to reproduce the issue. + +You may also submit a failing test case as a pull request. diff --git a/doc/book/error.md b/docs/book/error.md similarity index 100% rename from doc/book/error.md rename to docs/book/error.md diff --git a/doc/book/index.html b/docs/book/index.html similarity index 97% rename from doc/book/index.html rename to docs/book/index.html index da1a2ab..710a735 100644 --- a/doc/book/index.html +++ b/docs/book/index.html @@ -1,7 +1,7 @@

zend-json-server

- +

JSON-RPC implementation for PHP.

$ composer require zendframework/zend-json-server
diff --git a/doc/book/index.md b/docs/book/index.md similarity index 100% rename from doc/book/index.md rename to docs/book/index.md diff --git a/doc/book/intro.md b/docs/book/intro.md similarity index 92% rename from doc/book/intro.md rename to docs/book/intro.md index d20ed7d..233aa93 100644 --- a/doc/book/intro.md +++ b/docs/book/intro.md @@ -16,7 +16,7 @@ situation, you will simply: - Attach one or more functions and/or classes/objects to the server object. - `handle()` the request. -zend-json-server utilizes [Zend\Server\Reflection](http://framework.zend.com/manual/current/en/modules/zend.server.reflection.html) +zend-json-server utilizes [Zend\Server\Reflection](https://docs.zendframework.com/zend-server/reflection/) to perform reflection on any attached classes or functions, and uses that information to build both the SMD and enforce method call signatures. As such, it is imperative that any attached functions and/or class methods have full diff --git a/doc/book/request.md b/docs/book/request.md similarity index 100% rename from doc/book/request.md rename to docs/book/request.md diff --git a/doc/book/response.md b/docs/book/response.md similarity index 100% rename from doc/book/response.md rename to docs/book/response.md diff --git a/doc/book/server.md b/docs/book/server.md similarity index 100% rename from doc/book/server.md rename to docs/book/server.md diff --git a/doc/book/smd.md b/docs/book/smd.md similarity index 100% rename from doc/book/smd.md rename to docs/book/smd.md diff --git a/doc/book/usage.md b/docs/book/usage.md similarity index 100% rename from doc/book/usage.md rename to docs/book/usage.md diff --git a/doc/bookdown.json b/docs/bookdown.json similarity index 100% rename from doc/bookdown.json rename to docs/bookdown.json diff --git a/mkdocs.yml b/mkdocs.yml index f87c9cf..a37386c 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,5 +1,5 @@ -docs_dir: doc/book -site_dir: doc/html +docs_dir: docs/book +site_dir: docs/html pages: - index.md - Intro: intro.md @@ -13,4 +13,4 @@ pages: site_name: zend-json-server site_description: Zend\Json\Server repo_url: 'https://github.com/zendframework/zend-json-server' -copyright: 'Copyright (c) 2016 Zend Technologies USA Inc.' +copyright: 'Copyright (c) 2005-2018 Zend Technologies USA Inc.' diff --git a/phpcs.xml b/phpcs.xml index e994eae..c48d19c 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -1,19 +1,6 @@ - Zend Framework coding standard - - - - - - - - - - - - - + src diff --git a/phpunit.xml.dist b/phpunit.xml.dist index fa74714..b4e59f1 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,34 +1,17 @@ - ./test/ + ./test - - - disable - - - - + ./src - - - - - - - - diff --git a/src/Client.php b/src/Client.php index 02f9ebd..18bde43 100644 --- a/src/Client.php +++ b/src/Client.php @@ -1,8 +1,8 @@ httpClient->setUri($this->serverAddress); } + // Set default Accept and Content-Type headers unless already set. $headers = $httpRequest->getHeaders(); - $headers->addHeaders([ - 'Content-Type' => 'application/json', - 'Accept' => 'application/json', - ]); + $headersToAdd = []; + if (! $headers->has('Content-Type')) { + $headersToAdd['Content-Type'] = 'application/json-rpc'; + } + if (! $headers->has('Accept')) { + $headersToAdd['Accept'] = 'application/json-rpc'; + } + $headers->addHeaders($headersToAdd); if (! $headers->get('User-Agent')) { $headers->addHeaderLine('User-Agent', 'Zend_Json_Server_Client'); diff --git a/src/Response.php b/src/Response.php index f8b9ff8..0a3d978 100644 --- a/src/Response.php +++ b/src/Response.php @@ -74,7 +74,7 @@ public function setOptions(array $options) continue; } - if ($key == 'jsonrpc') { + if ('jsonrpc' === $key) { $this->setVersion($value); continue; } diff --git a/src/Server.php b/src/Server.php index dbd6a70..42f3854 100644 --- a/src/Server.php +++ b/src/Server.php @@ -1,7 +1,7 @@ fault('Method not found', Error::ERROR_INVALID_METHOD); } - $params = $request->getParams(); - $invokable = $this->table->getMethod($method); - $serviceMap = $this->getServiceMap(); - $service = $serviceMap->getService($method); - $serviceParams = $service->getParams(); + $invokable = $this->table->getMethod($method); + $serviceMap = $this->getServiceMap(); + $service = $serviceMap->getService($method); + $params = $this->validateAndPrepareParams( + $request->getParams(), + $service->getParams(), + $invokable + ); - if (count($params) < count($serviceParams)) { - $params = $this->getDefaultParams($params, $serviceParams); + if ($params instanceof Error) { + return $params; } - // Make sure named parameters are passed in correct order. - if (is_string(key($params))) { - $callback = $invokable->getCallback(); - if ('function' == $callback->getType()) { - $reflection = new ReflectionFunction($callback->getFunction()); - } else { - $reflection = new ReflectionMethod( - $callback->getClass(), - $callback->getMethod() - ); - } + try { + $result = $this->_dispatch($invokable, $params); + } catch (PhpException $e) { + return $this->fault($e->getMessage(), $e->getCode(), $e); + } - $orderedParams = []; - foreach ($reflection->getParameters() as $refParam) { - if (array_key_exists($refParam->getName(), $params)) { - $orderedParams[$refParam->getName()] = $params[$refParam->getName()]; - continue; - } + $this->getResponse()->setResult($result); + } - if ($refParam->isOptional()) { - $orderedParams[$refParam->getName()] = null; - continue; - } + /** + * @param array $requestedParams + * @param array $serviceParams + * @param Method\Definition $invokable + * @return array|Error Array of parameters to use when calling the requested + * method on success, Error if there is a mismatch between request + * parameters and the method signature. + */ + private function validateAndPrepareParams( + array $requestedParams, + array $serviceParams, + Method\Definition $invokable + ) { + return is_string(key($requestedParams)) + ? $this->validateAndPrepareNamedParams($requestedParams, $serviceParams, $invokable) + : $this->validateAndPrepareOrderedParams($requestedParams, $serviceParams); + } - return $this->fault('Invalid params', Error::ERROR_INVALID_PARAMS); + /** + * Ensures named parameters are passed in the correct order. + * + * @param array $requestedParams + * @param array $serviceParams + * @param Method\Definition $invokable + * @return array|Error Array of parameters to use when calling the requested + * method on success, Error if any named request parameters do not match + * those of the method requested. + */ + private function validateAndPrepareNamedParams( + array $requestedParams, + array $serviceParams, + Method\Definition $invokable + ) { + if (count($requestedParams) < count($serviceParams)) { + $requestedParams = $this->getDefaultParams($requestedParams, $serviceParams); + } + + $callback = $invokable->getCallback(); + $reflection = 'function' == $callback->getType() + ? new ReflectionFunction($callback->getFunction()) + : new ReflectionMethod($callback->getClass(), $callback->getMethod()); + + $orderedParams = []; + foreach ($reflection->getParameters() as $refParam) { + if (array_key_exists($refParam->getName(), $requestedParams)) { + $orderedParams[$refParam->getName()] = $requestedParams[$refParam->getName()]; + continue; + } + + if ($refParam->isOptional()) { + $orderedParams[$refParam->getName()] = null; + continue; } - $params = $orderedParams; + return $this->fault('Invalid params', Error::ERROR_INVALID_PARAMS); } - try { - $result = $this->_dispatch($invokable, $params); - } catch (PhpException $e) { - return $this->fault($e->getMessage(), $e->getCode(), $e); + return $orderedParams; + } + + /** + * @param array $requestedParams + * @param array $serviceParams + * @return array|Error Array of parameters to use when calling the requested + * method on success, Error if the number of request parameters does not + * match the number of parameters required by the requested method. + */ + private function validateAndPrepareOrderedParams(array $requestedParams, array $serviceParams) + { + $requiredParamsCount = array_reduce($serviceParams, function ($count, $param) { + $count += $param['optional'] ? 0 : 1; + return $count; + }, 0); + + if (count($requestedParams) < $requiredParamsCount) { + return $this->fault('Invalid params', Error::ERROR_INVALID_PARAMS); } - $this->getResponse()->setResult($result); + return $requestedParams; } } diff --git a/test/CacheTest.php b/test/CacheTest.php index 316acee..84ddd48 100644 --- a/test/CacheTest.php +++ b/test/CacheTest.php @@ -7,7 +7,7 @@ namespace ZendTest\Json\Server; -use PHPUnit_Framework_TestCase as TestCase; +use PHPUnit\Framework\TestCase; use Zend\Json\Server; class CacheTest extends TestCase @@ -25,7 +25,7 @@ public function setUp() $this->cacheFile = tempnam(sys_get_temp_dir(), 'zjs'); // if (!is_writeable(__DIR__)) { - if (!is_writeable($this->cacheFile)) { + if (! is_writable($this->cacheFile)) { $this->markTestSkipped('Cannot write test caches due to permissions'); } diff --git a/test/ClientTest.php b/test/ClientTest.php index 64e3106..10a66d3 100644 --- a/test/ClientTest.php +++ b/test/ClientTest.php @@ -1,17 +1,19 @@ makeHttpResponseFrom($body, $status, $message); $this->httpAdapter->setResponse($response); - $this->setExpectedException('Zend\\Json\\Server\\Exception\\HttpException', $message, $status); + $this->expectException(Exception\HttpException::class); + $this->expectExceptionMessage($message); + $this->expectExceptionCode($status); $this->jsonClient->call('foo'); } @@ -158,7 +162,9 @@ public function testRpcMethodCallThrowsOnJsonRpcFault() $response = $this->makeHttpResponseFrom($json); $this->httpAdapter->setResponse($response); - $this->setExpectedException('Zend\\Json\\Server\\Exception\\ErrorException', $message, $code); + $this->expectException(Exception\ErrorException::class); + $this->expectExceptionMessage($message); + $this->expectExceptionCode($code); $this->jsonClient->call('foo'); } @@ -222,7 +228,7 @@ public function testScalarServerResponseThrowsException() { $response = $this->makeHttpResponseFrom('false'); $this->httpAdapter->setResponse($response); - $this->setExpectedException('Zend\Json\Server\Exception\ExceptionInterface'); + $this->expectException(Exception\ExceptionInterface::class); $this->jsonClient->call('foo'); } @@ -233,6 +239,41 @@ public function setServerResponseTo($nativeVars) $this->httpAdapter->setResponse($response); } + public function testClientShouldSetDefaultAcceptAndContentTypeHeadersOnRequest() + { + $request = new Request(); + $response = new HttpResponse(); + $response->setContent(\Zend\Json\Json::encode(['test' => 'test'])); + $testAdapter = new TestAdapter(); + $testAdapter->setResponse($response); + $jsonClient = new Client('http://foo'); + $jsonClient->getHttpClient()->setAdapter($testAdapter); + $jsonClient->doRequest($request); + $this->assertSame('application/json-rpc', $jsonClient->getHttpClient()->getHeader('Content-Type')); + $this->assertSame('application/json-rpc', $jsonClient->getHttpClient()->getHeader('Accept')); + } + + public function testClientShouldNotOverwriteAcceptAndContentTypeHeadersIfAlreadyPresentInRequest() + { + $request = new Request(); + $response = new HttpResponse(); + $response->setContent(\Zend\Json\Json::encode(['test' => 'test'])); + $testAdapter = new TestAdapter(); + $testAdapter->setResponse($response); + + $httpClient = new HttpClient(); + $httpClient->setHeaders([ + 'Content-Type' => 'application/jsonrequest', + 'Accept' => 'application/jsonrequest', + ]); + + $jsonClient = new Client('http://foo', $httpClient); + $jsonClient->getHttpClient()->setAdapter($testAdapter); + $jsonClient->doRequest($request); + $this->assertSame('application/jsonrequest', $jsonClient->getHttpClient()->getHeader('Content-Type')); + $this->assertSame('application/jsonrequest', $jsonClient->getHttpClient()->getHeader('Accept')); + } + public function getServerResponseFor($nativeVars) { $response = new Response(); @@ -245,11 +286,12 @@ public function getServerResponseFor($nativeVars) public function makeHttpResponseFrom($data, $status = 200, $message = 'OK') { - $headers = ["HTTP/1.1 $status $message", - "Status: $status", - 'Content-Type: application/json', - 'Content-Length: ' . strlen($data) - ]; + $headers = [ + "HTTP/1.1 $status $message", + "Status: $status", + 'Content-Type: application/json', + 'Content-Length: ' . strlen($data), + ]; return implode("\r\n", $headers) . "\r\n\r\n$data\r\n\r\n"; } diff --git a/test/ErrorTest.php b/test/ErrorTest.php index 330a8c6..5424a32 100644 --- a/test/ErrorTest.php +++ b/test/ErrorTest.php @@ -7,9 +7,9 @@ namespace ZendTest\Json\Server; -use PHPUnit_Framework_TestCase as TestCase; -use Zend\Json\Server; +use PHPUnit\Framework\TestCase; use Zend\Json; +use Zend\Json\Server; class ErrorTest extends TestCase { diff --git a/test/RequestTest.php b/test/RequestTest.php index 065e424..2583dd4 100644 --- a/test/RequestTest.php +++ b/test/RequestTest.php @@ -7,7 +7,7 @@ namespace ZendTest\Json\Server; -use PHPUnit_Framework_TestCase as TestCase; +use PHPUnit\Framework\TestCase; use Zend\Json\Json; use Zend\Json\Server\Request; @@ -34,7 +34,7 @@ public function testShouldBeAbleToAddAParamAsValueOnly() { $this->request->addParam('foo'); $params = $this->request->getParams(); - $this->assertEquals(1, count($params)); + $this->assertCount(1, $params); $test = array_shift($params); $this->assertEquals('foo', $test); } @@ -43,7 +43,7 @@ public function testShouldBeAbleToAddAParamAsKeyValuePair() { $this->request->addParam('bar', 'foo'); $params = $this->request->getParams(); - $this->assertEquals(1, count($params)); + $this->assertCount(1, $params); $this->assertArrayHasKey('foo', $params); $this->assertEquals('bar', $params['foo']); } @@ -56,7 +56,7 @@ public function testInvalidKeysShouldBeIgnored() $this->assertNull($this->request->getParam('foo')); $params = $this->request->getParams(); ++$count; - $this->assertEquals($count, count($params)); + $this->assertCount($count, $params); } } diff --git a/test/ResponseTest.php b/test/ResponseTest.php index 271816f..9ac90a2 100644 --- a/test/ResponseTest.php +++ b/test/ResponseTest.php @@ -7,11 +7,11 @@ namespace ZendTest\Json\Server; -use PHPUnit_Framework_TestCase as TestCase; +use PHPUnit\Framework\TestCase; +use Zend\Json\Json; use Zend\Json\Server\Error; use Zend\Json\Server\Exception\RuntimeException; use Zend\Json\Server\Response; -use Zend\Json\Json; class ResponseTest extends TestCase { @@ -177,7 +177,7 @@ public function testCastToStringShouldCastToJSON() */ public function testLoadingScalarJSONResponseShouldThrowException($json) { - $this->setExpectedException(RuntimeException::class); + $this->expectException(RuntimeException::class); $this->response->loadJson($json); } @@ -197,7 +197,18 @@ public function getOptions() 'four', true, ], - 'id' => 'foobar' + 'id' => 'foobar', ]; } + + /** + * @see https://github.com/zendframework/zend-json-server/pull/2 + */ + public function testValueOfZeroForOptionsKeyShouldNotBeInterpretedAsVersionKey() + { + $this->response->setOptions([ + 0 => '2.0', + ]); + $this->assertNull($this->response->getVersion()); + } } diff --git a/test/ServerTest.php b/test/ServerTest.php index b28a1c2..fd8f275 100644 --- a/test/ServerTest.php +++ b/test/ServerTest.php @@ -1,19 +1,18 @@ assertEquals('two', $result[1]); $this->assertEquals(3, $result[2]); } + + public function testResponseShouldBeInvalidWhenRequestHasLessRequiredParametersPassedWithoutKeys() + { + $server = $this->server; + $server->setClass(TestAsset\FooParameters::class); + $server->setReturnResponse(true); + $request = $server->getRequest(); + $request->setMethod('bar') + ->setParams([true]); + $server->handle(); + + $response = $server->getResponse(); + $this->assertEquals($response->getError()->getCode(), Error::ERROR_INVALID_PARAMS); + } + + public function testResponseShouldBeInvalidWhenRequestHasLessRequiredParametersPassedWithoutKeys1() + { + $server = $this->server; + $server->setClass(TestAsset\FooParameters::class); + $server->setReturnResponse(true); + $request = $server->getRequest(); + $request->setMethod('baz') + ->setParams([true]); + $server->handle(); + $response = $server->getResponse(); + $this->assertNotEmpty($response->getError()); + $this->assertEquals($response->getError()->getCode(), Error::ERROR_INVALID_PARAMS); + } } diff --git a/test/Smd/ServiceTest.php b/test/Smd/ServiceTest.php index 14b8c32..23e9140 100644 --- a/test/Smd/ServiceTest.php +++ b/test/Smd/ServiceTest.php @@ -7,12 +7,11 @@ namespace ZendTest\Json\Server\Smd; -use PHPUnit_Framework_TestCase as TestCase; +use PHPUnit\Framework\TestCase; use stdClass; use Zend\Json\Server\Exception; use Zend\Json\Server\Smd; use Zend\Json\Server\Smd\Service; -use Zend\Json\Server; class ServiceTest extends TestCase { @@ -29,19 +28,22 @@ public function setUp() public function testConstructorShouldThrowExceptionWhenNoNameSetWhenNullProvided() { - $this->setExpectedException(Exception\InvalidArgumentException::class, 'requires a name'); - $service = new Service(null); + $this->expectException(Exception\InvalidArgumentException::class); + $this->expectExceptionMessage('requires a name'); + new Service(null); } public function testConstructorShouldThrowExceptionWhenNoNameSetWhenArrayProvided() { - $this->setExpectedException(Exception\InvalidArgumentException::class, 'requires a name'); - $service = new Service(null); + $this->expectException(Exception\InvalidArgumentException::class); + $this->expectExceptionMessage('requires a name'); + new Service(null); } public function testSettingNameShouldThrowExceptionWhenContainingInvalidFormatStartingWithInt() { - $this->setExpectedException(Exception\InvalidArgumentException::class, 'Invalid name'); + $this->expectException(Exception\InvalidArgumentException::class); + $this->expectExceptionMessage('Invalid name'); $this->service->setName('0ab-?'); } @@ -53,7 +55,8 @@ public function testSettingNameShouldNotThrowExceptionWhenContainingValidFormatS public function testSettingNameShouldThrowExceptionWhenContainingInvalidFormatStartingWithRpc() { - $this->setExpectedException(Exception\InvalidArgumentException::class, 'Invalid name'); + $this->expectException(Exception\InvalidArgumentException::class); + $this->expectExceptionMessage('Invalid name'); $this->service->setName('rpc.Foo'); } @@ -92,13 +95,15 @@ public function testTransportShouldDefaultToPost() public function testSettingTransportThrowsExceptionWhenSetToGet() { - $this->setExpectedException(Exception\InvalidArgumentException::class, 'Invalid transport'); + $this->expectException(Exception\InvalidArgumentException::class); + $this->expectExceptionMessage('Invalid transport'); $this->service->setTransport('GET'); } public function testSettingTransportThrowsExceptionWhenSetToRest() { - $this->setExpectedException(Exception\InvalidArgumentException::class, 'Invalid transport'); + $this->expectException(Exception\InvalidArgumentException::class); + $this->expectExceptionMessage('Invalid transport'); $this->service->setTransport('REST'); } @@ -159,7 +164,7 @@ public function testShouldBeAbleToAddParamsByTypeOnly() { $this->service->addParam('integer'); $params = $this->service->getParams(); - $this->assertEquals(1, count($params)); + $this->assertCount(1, $params); $param = array_shift($params); $this->assertEquals('integer', $param['type']); } @@ -177,7 +182,8 @@ public function testParamsShouldAcceptArrayOfTypes() public function testInvalidParamTypeShouldThrowException() { - $this->setExpectedException(Exception\InvalidArgumentException::class, 'Invalid param type'); + $this->expectException(Exception\InvalidArgumentException::class); + $this->expectExceptionMessage('Invalid param type'); $this->service->addParam(new stdClass); } @@ -188,7 +194,7 @@ public function testShouldBeAbleToOrderParams() ->addParam('boolean', [], 3); $params = $this->service->getParams(); - $this->assertEquals(3, count($params)); + $this->assertCount(3, $params); $param = array_shift($params); $this->assertEquals('string', $param['type'], var_export($params, 1)); @@ -226,7 +232,7 @@ public function testShouldBeAbleToAddMultipleParamsAtOnce() ]); $params = $this->service->getParams(); - $this->assertEquals(3, count($params)); + $this->assertCount(3, $params); $param = array_shift($params); $this->assertEquals('string', $param['type']); $this->assertEquals('foo', $param['name']); @@ -242,7 +248,7 @@ public function testSetparamsShouldOverwriteExistingParams() { $this->testShouldBeAbleToAddMultipleParamsAtOnce(); $params = $this->service->getParams(); - $this->assertEquals(3, count($params)); + $this->assertCount(3, $params); $this->service->setParams([ ['type' => 'string'], @@ -250,7 +256,7 @@ public function testSetparamsShouldOverwriteExistingParams() ]); $test = $this->service->getParams(); $this->assertNotEquals($params, $test); - $this->assertEquals(2, count($test)); + $this->assertCount(2, $test); } public function testReturnShouldBeNullByDefault() @@ -275,7 +281,8 @@ public function testReturnAccessorsShouldAllowArrayOfTypes() public function testInvalidReturnTypeShouldThrowException() { - $this->setExpectedException(Exception\InvalidArgumentException::class, 'Invalid param type'); + $this->expectException(Exception\InvalidArgumentException::class); + $this->expectExceptionMessage('Invalid param type'); $this->service->setReturn(new stdClass); } @@ -320,7 +327,7 @@ public function validateSmdArray(array $smd) $this->assertArrayHasKey('parameters', $smd); $params = $smd['parameters']; - $this->assertEquals(3, count($params)); + $this->assertCount(3, $params); $param = array_shift($params); $this->assertEquals('boolean', $param['type']); $param = array_shift($params); diff --git a/test/SmdTest.php b/test/SmdTest.php index 39b343f..6ed5586 100644 --- a/test/SmdTest.php +++ b/test/SmdTest.php @@ -7,11 +7,11 @@ namespace ZendTest\Json\Server; -use PHPUnit_Framework_TestCase as TestCase; -use Zend\Json\Server\Smd; +use PHPUnit\Framework\TestCase; +use Zend\Json; use Zend\Json\Server\Exception\InvalidArgumentException; use Zend\Json\Server\Exception\RuntimeException; -use Zend\Json; +use Zend\Json\Server\Smd; class SmdTest extends TestCase { @@ -287,7 +287,7 @@ public function testShouldBeAbleToCastToDojoArray() $this->assertEquals('.1', $smd['SMDVersion']); $this->assertEquals('JSON-RPC', $smd['serviceType']); $methods = $smd['methods']; - $this->assertEquals(2, count($methods)); + $this->assertCount(2, $methods); $foo = array_shift($methods); $this->assertArrayHasKey('name', $foo); @@ -296,7 +296,7 @@ public function testShouldBeAbleToCastToDojoArray() $this->assertEquals('foo', $foo['name']); $this->assertEquals($this->smd->getTarget(), $foo['serviceURL']); $this->assertInternalType('array', $foo['parameters']); - $this->assertEquals(1, count($foo['parameters'])); + $this->assertCount(1, $foo['parameters']); $bar = array_shift($methods); $this->assertArrayHasKey('name', $bar); @@ -305,7 +305,7 @@ public function testShouldBeAbleToCastToDojoArray() $this->assertEquals('bar', $bar['name']); $this->assertEquals($this->smd->getTarget(), $bar['serviceURL']); $this->assertInternalType('array', $bar['parameters']); - $this->assertEquals(1, count($bar['parameters'])); + $this->assertCount(1, $bar['parameters']); } public function testShouldBeAbleToRenderAsJSON() @@ -346,7 +346,7 @@ public function getOptions() ], 'return' => 'string', ], - ] + ], ]; } @@ -369,7 +369,7 @@ public function validateServiceArray(array $smd, array $options) $this->assertEquals($this->smd->getEnvelope(), $smd['envelope']); $this->assertEquals($this->smd->getContentType(), $smd['contentType']); $services = $smd['services']; - $this->assertEquals(2, count($services)); + $this->assertCount(2, $services); $this->assertArrayHasKey('foo', $services); $this->assertArrayHasKey('bar', $services); } diff --git a/test/TestAsset/FooParameters.php b/test/TestAsset/FooParameters.php new file mode 100644 index 0000000..cab4e6f --- /dev/null +++ b/test/TestAsset/FooParameters.php @@ -0,0 +1,39 @@ +