From 06517f154c5ff274e5f9832f182fc7b798642dd5 Mon Sep 17 00:00:00 2001 From: Petr Hejna Date: Mon, 1 Oct 2018 14:58:29 +0200 Subject: [PATCH 1/4] update libraries, mark it as php7.1 dependent --- .gitignore | 1 - composer.json | 8 +- composer.lock | 2814 ------------------------------------------------- 3 files changed, 4 insertions(+), 2819 deletions(-) delete mode 100644 composer.lock diff --git a/.gitignore b/.gitignore index 987e2a2..22d0d82 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -composer.lock vendor diff --git a/composer.json b/composer.json index 1a71dda..6d09b4e 100644 --- a/composer.json +++ b/composer.json @@ -12,17 +12,17 @@ } }, "require": { - "php": ">=5.6", + "php": ">=7.1", "nette/neon": "^2.4", "slim/slim": "^3.9", "nette/utils": "^2.5", "nette/di": "^2.4" }, "require-dev": { - "phpunit/phpunit": "^5.7", + "phpunit/phpunit": "^7", "roave/security-advisories": "dev-master", - "phpstan/phpstan": "^0.9.2", - "mockery/mockery": "^1.0" + "phpstan/phpstan": "^0.10", + "mockery/mockery": "dev-master" }, "scripts": { "test": "vendor/bin/phpunit tests", diff --git a/composer.lock b/composer.lock deleted file mode 100644 index bfcbc8d..0000000 --- a/composer.lock +++ /dev/null @@ -1,2814 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", - "This file is @generated automatically" - ], - "content-hash": "c4903de52a8662fbc2bdbe5b0e680c3e", - "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": "nette/di", - "version": "v2.4.10", - "source": { - "type": "git", - "url": "https://github.com/nette/di.git", - "reference": "a4b3be935b755f23aebea1ce33d7e3c832cdff98" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/di/zipball/a4b3be935b755f23aebea1ce33d7e3c832cdff98", - "reference": "a4b3be935b755f23aebea1ce33d7e3c832cdff98", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "nette/neon": "^2.3.3 || ~3.0.0", - "nette/php-generator": "^2.6.1 || ~3.0.0", - "nette/utils": "^2.4.3 || ~3.0.0", - "php": ">=5.6.0" - }, - "conflict": { - "nette/bootstrap": "<2.4", - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "^2.0", - "tracy/tracy": "^2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "πŸ’Ž Nette Dependency Injection Container: Flexible, compiled and full-featured DIC with perfectly usable autowiring and support for all new PHP 7.1 features.", - "homepage": "https://nette.org", - "keywords": [ - "compiled", - "di", - "dic", - "factory", - "ioc", - "nette", - "static" - ], - "time": "2017-08-31T22:42:00+00:00" - }, - { - "name": "nette/neon", - "version": "v2.4.2", - "source": { - "type": "git", - "url": "https://github.com/nette/neon.git", - "reference": "9eacd50553b26b53a3977bfb2fea2166d4331622" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/neon/zipball/9eacd50553b26b53a3977bfb2fea2166d4331622", - "reference": "9eacd50553b26b53a3977bfb2fea2166d4331622", - "shasum": "" - }, - "require": { - "ext-iconv": "*", - "ext-json": "*", - "php": ">=5.6.0" - }, - "require-dev": { - "nette/tester": "~2.0", - "tracy/tracy": "^2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "Nette NEON: parser & generator for Nette Object Notation", - "homepage": "http://ne-on.org", - "time": "2017-07-11T18:29:08+00:00" - }, - { - "name": "nette/php-generator", - "version": "v3.0.2", - "source": { - "type": "git", - "url": "https://github.com/nette/php-generator.git", - "reference": "1652635d312a8db4291b16f3ebf87cb1a15a6257" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/php-generator/zipball/1652635d312a8db4291b16f3ebf87cb1a15a6257", - "reference": "1652635d312a8db4291b16f3ebf87cb1a15a6257", - "shasum": "" - }, - "require": { - "nette/utils": "^2.4.2 || ~3.0.0", - "php": ">=7.0" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "^2.0", - "tracy/tracy": "^2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "🐘 Nette PHP Generator: generates neat PHP code for you. Supports new PHP 7.2 features.", - "homepage": "https://nette.org", - "keywords": [ - "code", - "nette", - "php", - "scaffolding" - ], - "time": "2017-09-26T11:19:32+00:00" - }, - { - "name": "nette/utils", - "version": "v2.5.1", - "source": { - "type": "git", - "url": "https://github.com/nette/utils.git", - "reference": "8a85ce76298c8a8941f912b8fa3ee93ca17d2ebc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/utils/zipball/8a85ce76298c8a8941f912b8fa3ee93ca17d2ebc", - "reference": "8a85ce76298c8a8941f912b8fa3ee93ca17d2ebc", - "shasum": "" - }, - "require": { - "php": ">=5.6.0" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "~2.0", - "tracy/tracy": "^2.3" - }, - "suggest": { - "ext-gd": "to use Image", - "ext-iconv": "to use Strings::webalize() and toAscii()", - "ext-intl": "for script transliteration in Strings::webalize() and toAscii()", - "ext-json": "to use Nette\\Utils\\Json", - "ext-mbstring": "to use Strings::lower() etc...", - "ext-xml": "to use Strings::length() etc. when mbstring is not available" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.5-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ], - "files": [ - "src/loader.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "πŸ›  Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.", - "homepage": "https://nette.org", - "keywords": [ - "array", - "core", - "datetime", - "images", - "json", - "nette", - "paginator", - "password", - "slugify", - "string", - "unicode", - "utf-8", - "utility", - "validation" - ], - "time": "2018-02-19T14:42:42+00:00" - }, - { - "name": "nikic/fast-route", - "version": "v1.3.0", - "source": { - "type": "git", - "url": "https://github.com/nikic/FastRoute.git", - "reference": "181d480e08d9476e61381e04a71b34dc0432e812" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/FastRoute/zipball/181d480e08d9476e61381e04a71b34dc0432e812", - "reference": "181d480e08d9476e61381e04a71b34dc0432e812", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35|~5.7" - }, - "type": "library", - "autoload": { - "psr-4": { - "FastRoute\\": "src/" - }, - "files": [ - "src/functions.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nikita Popov", - "email": "nikic@php.net" - } - ], - "description": "Fast request router for PHP", - "keywords": [ - "router", - "routing" - ], - "time": "2018-02-13T20:26:39+00:00" - }, - { - "name": "pimple/pimple", - "version": "v3.2.3", - "source": { - "type": "git", - "url": "https://github.com/silexphp/Pimple.git", - "reference": "9e403941ef9d65d20cba7d54e29fe906db42cf32" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/silexphp/Pimple/zipball/9e403941ef9d65d20cba7d54e29fe906db42cf32", - "reference": "9e403941ef9d65d20cba7d54e29fe906db42cf32", - "shasum": "" - }, - "require": { - "php": ">=5.3.0", - "psr/container": "^1.0" - }, - "require-dev": { - "symfony/phpunit-bridge": "^3.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2.x-dev" - } - }, - "autoload": { - "psr-0": { - "Pimple": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Pimple, a simple Dependency Injection Container", - "homepage": "http://pimple.sensiolabs.org", - "keywords": [ - "container", - "dependency injection" - ], - "time": "2018-01-21T07:42:36+00:00" - }, - { - "name": "psr/container", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "time": "2017-02-14T16:28:37+00:00" - }, - { - "name": "psr/http-message", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "time": "2016-08-06T14:39:51+00:00" - }, - { - "name": "slim/slim", - "version": "3.9.2", - "source": { - "type": "git", - "url": "https://github.com/slimphp/Slim.git", - "reference": "4086d0106cf5a7135c69fce4161fe355a8feb118" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/slimphp/Slim/zipball/4086d0106cf5a7135c69fce4161fe355a8feb118", - "reference": "4086d0106cf5a7135c69fce4161fe355a8feb118", - "shasum": "" - }, - "require": { - "container-interop/container-interop": "^1.2", - "nikic/fast-route": "^1.0", - "php": ">=5.5.0", - "pimple/pimple": "^3.0", - "psr/container": "^1.0", - "psr/http-message": "^1.0" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0", - "squizlabs/php_codesniffer": "^2.5" - }, - "type": "library", - "autoload": { - "psr-4": { - "Slim\\": "Slim" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Rob Allen", - "email": "rob@akrabat.com", - "homepage": "http://akrabat.com" - }, - { - "name": "Josh Lockhart", - "email": "hello@joshlockhart.com", - "homepage": "https://joshlockhart.com" - }, - { - "name": "Gabriel Manricks", - "email": "gmanricks@me.com", - "homepage": "http://gabrielmanricks.com" - }, - { - "name": "Andrew Smith", - "email": "a.smith@silentworks.co.uk", - "homepage": "http://silentworks.co.uk" - } - ], - "description": "Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs", - "homepage": "https://slimframework.com", - "keywords": [ - "api", - "framework", - "micro", - "router" - ], - "time": "2017-11-26T19:13:09+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": "hamcrest/hamcrest-php", - "version": "v2.0.0", - "source": { - "type": "git", - "url": "https://github.com/hamcrest/hamcrest-php.git", - "reference": "776503d3a8e85d4f9a1148614f95b7a608b046ad" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/776503d3a8e85d4f9a1148614f95b7a608b046ad", - "reference": "776503d3a8e85d4f9a1148614f95b7a608b046ad", - "shasum": "" - }, - "require": { - "php": "^5.3|^7.0" - }, - "replace": { - "cordoval/hamcrest-php": "*", - "davedevelopment/hamcrest-php": "*", - "kodova/hamcrest-php": "*" - }, - "require-dev": { - "phpunit/php-file-iterator": "1.3.3", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "hamcrest" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD" - ], - "description": "This is the PHP port of Hamcrest Matchers", - "keywords": [ - "test" - ], - "time": "2016-01-20T08:20:44+00:00" - }, - { - "name": "jean85/pretty-package-versions", - "version": "1.1", - "source": { - "type": "git", - "url": "https://github.com/Jean85/pretty-package-versions.git", - "reference": "d457344b6a035ef99236bdda4729ad7eeb233f54" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/d457344b6a035ef99236bdda4729ad7eeb233f54", - "reference": "d457344b6a035ef99236bdda4729ad7eeb233f54", - "shasum": "" - }, - "require": { - "ocramius/package-versions": "^1.2.0", - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Jean85\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Alessandro Lai", - "email": "alessandro.lai85@gmail.com" - } - ], - "description": "A wrapper for ocramius/pretty-package-versions to get pretty versions strings", - "keywords": [ - "composer", - "package", - "release", - "versions" - ], - "time": "2018-01-21T13:54:22+00:00" - }, - { - "name": "mockery/mockery", - "version": "1.0", - "source": { - "type": "git", - "url": "https://github.com/mockery/mockery.git", - "reference": "1bac8c362b12f522fdd1f1fa3556284c91affa38" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/1bac8c362b12f522fdd1f1fa3556284c91affa38", - "reference": "1bac8c362b12f522fdd1f1fa3556284c91affa38", - "shasum": "" - }, - "require": { - "hamcrest/hamcrest-php": "~2.0", - "lib-pcre": ">=7.0", - "php": ">=5.6.0" - }, - "require-dev": { - "phpunit/phpunit": "~5.7|~6.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "Mockery": "library/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "PΓ‘draic Brady", - "email": "padraic.brady@gmail.com", - "homepage": "http://blog.astrumfutura.com" - }, - { - "name": "Dave Marshall", - "email": "dave.marshall@atstsolutions.co.uk", - "homepage": "http://davedevelopment.co.uk" - } - ], - "description": "Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succinct API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL). Designed as a drop in alternative to PHPUnit's phpunit-mock-objects library, Mockery is easy to integrate with PHPUnit and can operate alongside phpunit-mock-objects without the World ending.", - "homepage": "http://github.com/mockery/mockery", - "keywords": [ - "BDD", - "TDD", - "library", - "mock", - "mock objects", - "mockery", - "stub", - "test", - "test double", - "testing" - ], - "time": "2017-10-06T16:20:43+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": "nette/bootstrap", - "version": "v2.4.5", - "source": { - "type": "git", - "url": "https://github.com/nette/bootstrap.git", - "reference": "804925787764d708a7782ea0d9382a310bb21968" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/bootstrap/zipball/804925787764d708a7782ea0d9382a310bb21968", - "reference": "804925787764d708a7782ea0d9382a310bb21968", - "shasum": "" - }, - "require": { - "nette/di": "~2.4.7", - "nette/utils": "~2.4", - "php": ">=5.6.0" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "latte/latte": "~2.2", - "nette/application": "~2.3", - "nette/caching": "~2.3", - "nette/database": "~2.3", - "nette/forms": "~2.3", - "nette/http": "~2.4.0", - "nette/mail": "~2.3", - "nette/robot-loader": "^2.4.2 || ^3.0", - "nette/safe-stream": "~2.2", - "nette/security": "~2.3", - "nette/tester": "~2.0", - "tracy/tracy": "^2.4.1" - }, - "suggest": { - "nette/robot-loader": "to use Configurator::createRobotLoader()", - "tracy/tracy": "to use Configurator::enableTracy()" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "πŸ…± Nette Bootstrap: the simple way to configure and bootstrap your Nette application.", - "homepage": "https://nette.org", - "keywords": [ - "bootstrapping", - "configurator", - "nette" - ], - "time": "2017-08-20T17:36:59+00:00" - }, - { - "name": "nette/finder", - "version": "v2.4.1", - "source": { - "type": "git", - "url": "https://github.com/nette/finder.git", - "reference": "4d43a66d072c57d585bf08a3ef68d3587f7e9547" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/finder/zipball/4d43a66d072c57d585bf08a3ef68d3587f7e9547", - "reference": "4d43a66d072c57d585bf08a3ef68d3587f7e9547", - "shasum": "" - }, - "require": { - "nette/utils": "^2.4 || ~3.0.0", - "php": ">=5.6.0" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "^2.0", - "tracy/tracy": "^2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "Nette Finder: Files Searching", - "homepage": "https://nette.org", - "time": "2017-07-10T23:47:08+00:00" - }, - { - "name": "nette/robot-loader", - "version": "v3.0.3", - "source": { - "type": "git", - "url": "https://github.com/nette/robot-loader.git", - "reference": "92d4b40b49d5e2d9e37fc736bbcebe6da55fa44a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/robot-loader/zipball/92d4b40b49d5e2d9e37fc736bbcebe6da55fa44a", - "reference": "92d4b40b49d5e2d9e37fc736bbcebe6da55fa44a", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "nette/finder": "^2.3 || ^3.0", - "nette/utils": "^2.4 || ^3.0", - "php": ">=5.6.0" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "^2.0", - "tracy/tracy": "^2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "πŸ€ Nette RobotLoader: high performance and comfortable autoloader that will search and autoload classes within your application.", - "homepage": "https://nette.org", - "keywords": [ - "autoload", - "class", - "interface", - "nette", - "trait" - ], - "time": "2017-09-26T13:42:21+00:00" - }, - { - "name": "nikic/php-parser", - "version": "v3.1.5", - "source": { - "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/bb87e28e7d7b8d9a7fda231d37457c9210faf6ce", - "reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.5" - }, - "require-dev": { - "phpunit/phpunit": "~4.0|~5.0" - }, - "bin": [ - "bin/php-parse" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "psr-4": { - "PhpParser\\": "lib/PhpParser" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nikita Popov" - } - ], - "description": "A PHP parser written in PHP", - "keywords": [ - "parser", - "php" - ], - "time": "2018-02-28T20:30:58+00:00" - }, - { - "name": "ocramius/package-versions", - "version": "1.3.0", - "source": { - "type": "git", - "url": "https://github.com/Ocramius/PackageVersions.git", - "reference": "4489d5002c49d55576fa0ba786f42dbb009be46f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/4489d5002c49d55576fa0ba786f42dbb009be46f", - "reference": "4489d5002c49d55576fa0ba786f42dbb009be46f", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.0.0", - "php": "^7.1.0" - }, - "require-dev": { - "composer/composer": "^1.6.3", - "ext-zip": "*", - "infection/infection": "^0.7.1", - "phpunit/phpunit": "^7.0.0" - }, - "type": "composer-plugin", - "extra": { - "class": "PackageVersions\\Installer", - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "PackageVersions\\": "src/PackageVersions" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com" - } - ], - "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", - "time": "2018-02-05T13:05:30+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": "phpstan/phpdoc-parser", - "version": "0.2", - "source": { - "type": "git", - "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "02f909f134fe06f0cd4790d8627ee24efbe84d6a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/02f909f134fe06f0cd4790d8627ee24efbe84d6a", - "reference": "02f909f134fe06f0cd4790d8627ee24efbe84d6a", - "shasum": "" - }, - "require": { - "php": "~7.0" - }, - "require-dev": { - "consistence/coding-standard": "^2.0.0", - "jakub-onderka/php-parallel-lint": "^0.9.2", - "phing/phing": "^2.16.0", - "phpstan/phpstan": "^0.9", - "phpunit/phpunit": "^6.3", - "slevomat/coding-standard": "^3.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.1-dev" - } - }, - "autoload": { - "psr-4": { - "PHPStan\\PhpDocParser\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "PHPDoc parser with support for nullable, intersection and generic types", - "time": "2018-01-13T18:19:41+00:00" - }, - { - "name": "phpstan/phpstan", - "version": "0.9.2", - "source": { - "type": "git", - "url": "https://github.com/phpstan/phpstan.git", - "reference": "e59541bcc7cac9b35ca54db6365bf377baf4a488" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e59541bcc7cac9b35ca54db6365bf377baf4a488", - "reference": "e59541bcc7cac9b35ca54db6365bf377baf4a488", - "shasum": "" - }, - "require": { - "jean85/pretty-package-versions": "^1.0.3", - "nette/bootstrap": "^2.4 || ^3.0", - "nette/di": "^2.4.7 || ^3.0", - "nette/robot-loader": "^3.0.1", - "nette/utils": "^2.4.5 || ^3.0", - "nikic/php-parser": "^3.1", - "php": "~7.0", - "phpstan/phpdoc-parser": "^0.2", - "symfony/console": "~3.2 || ~4.0", - "symfony/finder": "~3.2 || ~4.0" - }, - "require-dev": { - "consistence/coding-standard": "2.2.1", - "ext-gd": "*", - "ext-intl": "*", - "ext-mysqli": "*", - "jakub-onderka/php-parallel-lint": "^0.9.2", - "phing/phing": "^2.16.0", - "phpstan/phpstan-php-parser": "^0.9", - "phpstan/phpstan-phpunit": "^0.9.3", - "phpstan/phpstan-strict-rules": "^0.9", - "phpunit/phpunit": "^6.5.4", - "slevomat/coding-standard": "4.0.0" - }, - "bin": [ - "bin/phpstan" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.9-dev" - } - }, - "autoload": { - "psr-4": { - "PHPStan\\": [ - "src/", - "build/PHPStan" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "PHPStan - PHP Static Analysis Tool", - "time": "2018-01-28T13:22:19+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "4.0.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-xmlwriter": "*", - "php": "^5.6 || ^7.0", - "phpunit/php-file-iterator": "^1.3", - "phpunit/php-text-template": "^1.2", - "phpunit/php-token-stream": "^1.4.2 || ^2.0", - "sebastian/code-unit-reverse-lookup": "^1.0", - "sebastian/environment": "^1.3.2 || ^2.0", - "sebastian/version": "^1.0 || ^2.0" - }, - "require-dev": { - "ext-xdebug": "^2.1.4", - "phpunit/phpunit": "^5.7" - }, - "suggest": { - "ext-xdebug": "^2.5.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "time": "2017-04-02T07:44:40+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "1.4.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "time": "2017-11-27T13:52:08+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "time": "2015-06-21T13:50:34+00:00" - }, - { - "name": "phpunit/php-timer", - "version": "1.0.9", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "time": "2017-02-26T11:10:40+00:00" - }, - { - "name": "phpunit/php-token-stream", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "791198a2c6254db10131eecfe8c06670700904db" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", - "reference": "791198a2c6254db10131eecfe8c06670700904db", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.2.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "time": "2017-11-27T05:48:46+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "5.7.27", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", - "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "myclabs/deep-copy": "~1.3", - "php": "^5.6 || ^7.0", - "phpspec/prophecy": "^1.6.2", - "phpunit/php-code-coverage": "^4.0.4", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "^3.2", - "sebastian/comparator": "^1.2.4", - "sebastian/diff": "^1.4.3", - "sebastian/environment": "^1.3.4 || ^2.0", - "sebastian/exporter": "~2.0", - "sebastian/global-state": "^1.1", - "sebastian/object-enumerator": "~2.0", - "sebastian/resource-operations": "~1.0", - "sebastian/version": "^1.0.6|^2.0.1", - "symfony/yaml": "~2.1|~3.0|~4.0" - }, - "conflict": { - "phpdocumentor/reflection-docblock": "3.0.2" - }, - "require-dev": { - "ext-pdo": "*" - }, - "suggest": { - "ext-xdebug": "*", - "phpunit/php-invoker": "~1.1" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.7.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "time": "2018-02-01T05:50:59+00:00" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "3.4.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", - "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.6 || ^7.0", - "phpunit/php-text-template": "^1.2", - "sebastian/exporter": "^1.2 || ^2.0" - }, - "conflict": { - "phpunit/phpunit": "<5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.4" - }, - "suggest": { - "ext-soap": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "time": "2017-06-30T09:13:00+00:00" - }, - { - "name": "roave/security-advisories", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "1b2f1f59ff8fc933e4d61ee45214ff3228e20c75" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/1b2f1f59ff8fc933e4d61ee45214ff3228e20c75", - "reference": "1b2f1f59ff8fc933e4d61ee45214ff3228e20c75", - "shasum": "" - }, - "conflict": { - "3f/pygmentize": "<1.2", - "adodb/adodb-php": "<5.20.6", - "amphp/artax": "<1.0.6|>=2,<2.0.6", - "amphp/http": "<1.0.1", - "asymmetricrypt/asymmetricrypt": ">=0,<9.9.99", - "aws/aws-sdk-php": ">=3,<3.2.1", - "bugsnag/bugsnag-laravel": ">=2,<2.0.2", - "cakephp/cakephp": ">=1.3,<1.3.18|>=2,<2.4.99|>=2.5,<2.5.99|>=2.6,<2.6.12|>=2.7,<2.7.6|>=3,<3.0.15|>=3.1,<3.1.4", - "cart2quote/module-quotation": ">=4.1.6,<=4.4.5|>=5,<5.4.4", - "cartalyst/sentry": "<=2.1.6", - "codeigniter/framework": "<=3.0.6", - "composer/composer": "<=1.0.0-alpha11", - "contao-components/mediaelement": ">=2.14.2,<2.21.1", - "contao/core": ">=2,<3.5.32", - "contao/core-bundle": ">=4,<4.4.8", - "contao/listing-bundle": ">=4,<4.4.8", - "contao/newsletter-bundle": ">=4,<4.1", - "doctrine/annotations": ">=1,<1.2.7", - "doctrine/cache": ">=1,<1.3.2|>=1.4,<1.4.2", - "doctrine/common": ">=2,<2.4.3|>=2.5,<2.5.1", - "doctrine/dbal": ">=2,<2.0.8|>=2.1,<2.1.2", - "doctrine/doctrine-bundle": "<1.5.2", - "doctrine/doctrine-module": "<=0.7.1", - "doctrine/mongodb-odm": ">=1,<1.0.2", - "doctrine/mongodb-odm-bundle": ">=2,<3.0.1", - "doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1", - "dompdf/dompdf": ">=0.6,<0.6.2", - "drupal/core": ">=8,<8.4.5", - "drupal/drupal": ">=8,<8.4.5", - "erusev/parsedown": "<1.7", - "ezsystems/ezpublish-legacy": ">=5.3,<5.3.12.3|>=5.4,<5.4.11.3|>=2017.8,<2017.8.1.1|>=2017.12,<2017.12.2.1", - "firebase/php-jwt": "<2", - "friendsofsymfony/rest-bundle": ">=1.2,<1.2.2", - "friendsofsymfony/user-bundle": ">=1.2,<1.3.5", - "gree/jose": "<=2.2", - "gregwar/rst": "<1.0.3", - "guzzlehttp/guzzle": ">=6,<6.2.1|>=4.0.0-rc2,<4.2.4|>=5,<5.3.1", - "illuminate/auth": ">=4,<4.0.99|>=4.1,<4.1.26", - "illuminate/database": ">=4,<4.0.99|>=4.1,<4.1.29", - "joomla/session": "<1.3.1", - "laravel/framework": ">=4,<4.0.99|>=4.1,<4.1.29", - "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10", - "magento/magento1ce": ">=1.5.0.1,<1.9.3.2", - "magento/magento1ee": ">=1.9,<1.14.3.2", - "magento/magento2ce": ">=2,<2.2", - "monolog/monolog": ">=1.8,<1.12", - "namshi/jose": "<2.2", - "onelogin/php-saml": "<2.10.4", - "oro/crm": ">=1.7,<1.7.4", - "oro/platform": ">=1.7,<1.7.4", - "padraic/humbug_get_contents": "<1.1.2", - "pagarme/pagarme-php": ">=0,<3", - "paragonie/random_compat": "<2", - "phpmailer/phpmailer": ">=5,<5.2.24", - "phpunit/phpunit": ">=4.8.19,<4.8.28|>=5.0.10,<5.6.3", - "phpxmlrpc/extras": "<0.6.1", - "propel/propel": ">=2.0.0-alpha1,<=2.0.0-alpha7", - "propel/propel1": ">=1,<=1.7.1", - "pusher/pusher-php-server": "<2.2.1", - "sabre/dav": ">=1.6,<1.6.99|>=1.7,<1.7.11|>=1.8,<1.8.9", - "shopware/shopware": "<5.3.7", - "silverstripe/cms": ">=3,<=3.0.11|>=3.1,<3.1.11", - "silverstripe/forum": "<=0.6.1|>=0.7,<=0.7.3", - "silverstripe/framework": ">=3,<3.3", - "silverstripe/userforms": "<3", - "simplesamlphp/saml2": "<1.10.6|>=2,<2.3.8|>=3,<3.1.4", - "simplesamlphp/simplesamlphp": "<1.15.2", - "simplesamlphp/simplesamlphp-module-infocard": "<1.0.1", - "socalnick/scn-social-auth": "<1.15.2", - "squizlabs/php_codesniffer": ">=1,<2.8.1", - "stormpath/sdk": ">=0,<9.9.99", - "swiftmailer/swiftmailer": ">=4,<5.4.5", - "symfony/dependency-injection": ">=2,<2.0.17", - "symfony/form": ">=2.3,<2.3.35|>=2.4,<2.6.12|>=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", - "symfony/framework-bundle": ">=2,<2.3.18|>=2.4,<2.4.8|>=2.5,<2.5.2", - "symfony/http-foundation": ">=2,<2.3.27|>=2.4,<2.5.11|>=2.6,<2.6.6", - "symfony/http-kernel": ">=2,<2.3.29|>=2.4,<2.5.12|>=2.6,<2.6.8", - "symfony/intl": ">=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", - "symfony/routing": ">=2,<2.0.19", - "symfony/security": ">=2,<2.0.25|>=2.1,<2.1.13|>=2.2,<2.2.9|>=2.3,<2.3.37|>=2.4,<2.6.13|>=2.7,<2.7.9|>=2.7.30,<2.7.32|>=2.8.23,<2.8.25|>=3.2.10,<3.2.12|>=3.3.3,<3.3.5", - "symfony/security-core": ">=2.4,<2.6.13|>=2.7,<2.7.9|>=2.7.30,<2.7.32|>=2.8,<2.8.6|>=2.8.23,<2.8.25|>=3,<3.0.6|>=3.2.10,<3.2.12|>=3.3.3,<3.3.5", - "symfony/security-csrf": ">=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", - "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", - "symfony/serializer": ">=2,<2.0.11", - "symfony/symfony": ">=2,<2.3.41|>=2.4,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", - "symfony/translation": ">=2,<2.0.17", - "symfony/validator": ">=2,<2.0.24|>=2.1,<2.1.12|>=2.2,<2.2.5|>=2.3,<2.3.3", - "symfony/web-profiler-bundle": ">=2,<2.3.19|>=2.4,<2.4.9|>=2.5,<2.5.4", - "symfony/yaml": ">=2,<2.0.22|>=2.1,<2.1.7", - "thelia/backoffice-default-template": ">=2.1,<2.1.2", - "thelia/thelia": ">=2.1.0-beta1,<2.1.3|>=2.1,<2.1.2", - "titon/framework": ">=0,<9.9.99", - "twig/twig": "<1.20", - "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.22|>=8,<8.7.5", - "typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.10|>=3.1,<3.1.7|>=3.2,<3.2.7|>=3.3,<3.3.5", - "typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4", - "willdurand/js-translation-bundle": "<2.1.1", - "yiisoft/yii": ">=1.1.14,<1.1.15", - "yiisoft/yii2": "<2.0.14", - "yiisoft/yii2-bootstrap": "<2.0.4", - "yiisoft/yii2-dev": "<2.0.14", - "yiisoft/yii2-gii": "<2.0.4", - "yiisoft/yii2-jui": "<2.0.4", - "zendframework/zend-cache": ">=2.4,<2.4.8|>=2.5,<2.5.3", - "zendframework/zend-captcha": ">=2,<2.4.9|>=2.5,<2.5.2", - "zendframework/zend-crypt": ">=2,<2.4.9|>=2.5,<2.5.2", - "zendframework/zend-db": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.10|>=2.3,<2.3.5", - "zendframework/zend-diactoros": ">=1,<1.0.4", - "zendframework/zend-form": ">=2,<2.2.7|>=2.3,<2.3.1", - "zendframework/zend-http": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.3,<2.3.8|>=2.4,<2.4.1", - "zendframework/zend-json": ">=2.1,<2.1.6|>=2.2,<2.2.6", - "zendframework/zend-ldap": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.8|>=2.3,<2.3.3", - "zendframework/zend-mail": ">=2,<2.4.11|>=2.5,<2.7.2", - "zendframework/zend-navigation": ">=2,<2.2.7|>=2.3,<2.3.1", - "zendframework/zend-session": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.9|>=2.3,<2.3.4", - "zendframework/zend-validator": ">=2.3,<2.3.6", - "zendframework/zend-view": ">=2,<2.2.7|>=2.3,<2.3.1", - "zendframework/zend-xmlrpc": ">=2.1,<2.1.6|>=2.2,<2.2.6", - "zendframework/zendframework": ">=2,<2.4.11|>=2.5,<2.5.1", - "zendframework/zendframework1": "<1.12.20", - "zendframework/zendopenid": ">=2,<2.0.2", - "zendframework/zendxml": ">=1,<1.0.1", - "zetacomponents/mail": "<1.8.2", - "zf-commons/zfc-user": "<1.2.2", - "zfcampus/zf-apigility-doctrine": ">=1,<1.0.3", - "zfr/zfr-oauth2-server-module": "<0.1.2" - }, - "type": "metapackage", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "role": "maintainer" - } - ], - "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2018-03-15T17:53:05+00:00" - }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2017-03-04T06:30:41+00:00" - }, - { - "name": "sebastian/comparator", - "version": "1.2.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2 || ~2.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "time": "2017-01-29T09:50:25+00:00" - }, - { - "name": "sebastian/diff", - "version": "1.4.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff" - ], - "time": "2017-05-22T07:24:03+00:00" - }, - { - "name": "sebastian/environment", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.0" - }, - "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" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "time": "2016-11-26T07:53:53+00:00" - }, - { - "name": "sebastian/exporter", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~2.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.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": "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": "2016-11-19T08:54:04+00:00" - }, - { - "name": "sebastian/global-state", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "time": "2015-10-12T03:26:01+00:00" - }, - { - "name": "sebastian/object-enumerator", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", - "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", - "shasum": "" - }, - "require": { - "php": ">=5.6", - "sebastian/recursion-context": "~2.0" - }, - "require-dev": { - "phpunit/phpunit": "~5" - }, - "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" - } - ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-02-18T15:18:39+00:00" - }, - { - "name": "sebastian/recursion-context", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "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": "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": "2016-11-19T07:33:16+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": "symfony/console", - "version": "v4.0.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "555c8dbe0ae9e561740451eabdbed2cc554b6a51" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/555c8dbe0ae9e561740451eabdbed2cc554b6a51", - "reference": "555c8dbe0ae9e561740451eabdbed2cc554b6a51", - "shasum": "" - }, - "require": { - "php": "^7.1.3", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "symfony/dependency-injection": "<3.4", - "symfony/process": "<3.3" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~3.4|~4.0", - "symfony/dependency-injection": "~3.4|~4.0", - "symfony/event-dispatcher": "~3.4|~4.0", - "symfony/lock": "~3.4|~4.0", - "symfony/process": "~3.4|~4.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Console Component", - "homepage": "https://symfony.com", - "time": "2018-02-26T15:55:47+00:00" - }, - { - "name": "symfony/finder", - "version": "v4.0.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "44a796d2ecc2a16a5fc8f2956a34ee617934d55f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/44a796d2ecc2a16a5fc8f2956a34ee617934d55f", - "reference": "44a796d2ecc2a16a5fc8f2956a34ee617934d55f", - "shasum": "" - }, - "require": { - "php": "^7.1.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Finder Component", - "homepage": "https://symfony.com", - "time": "2018-03-05T18:28:26+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.7.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/78be803ce01e55d3491c1397cf1c64beb9c1b63b", - "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "time": "2018-01-30T19:27:44+00:00" - }, - { - "name": "symfony/yaml", - "version": "v4.0.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "de5f125ea39de846b90b313b2cfb031a0152d223" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/de5f125ea39de846b90b313b2cfb031a0152d223", - "reference": "de5f125ea39de846b90b313b2cfb031a0152d223", - "shasum": "" - }, - "require": { - "php": "^7.1.3" - }, - "conflict": { - "symfony/console": "<3.4" - }, - "require-dev": { - "symfony/console": "~3.4|~4.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com", - "time": "2018-02-19T20:08:53+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" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": { - "roave/security-advisories": 20 - }, - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": ">=5.6" - }, - "platform-dev": [] -} From 589d1d831a02e1f8e022a18df7c9c44511c167c0 Mon Sep 17 00:00:00 2001 From: Petr Hejna Date: Mon, 1 Oct 2018 14:59:09 +0200 Subject: [PATCH 2/4] add composer.lock into gitignore again --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 22d0d82..987e2a2 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ +composer.lock vendor From 9a6dac56c226905ca57645f7f8f99cab1152f5de Mon Sep 17 00:00:00 2001 From: Petr Hejna Date: Mon, 1 Oct 2018 15:15:42 +0200 Subject: [PATCH 3/4] Tweak the code to be PHP7.1 strict --- composer.json | 8 ++- phpstan.neon | 4 ++ ruleset.xml | 76 ++++++++++++++++++++++++ src/ActionHandler.php | 6 +- src/Controller.php | 6 +- src/DI/SlimApiExtension.php | 7 ++- src/ErrorHandler.php | 6 +- src/Middleware.php | 2 +- src/Request/Request.php | 33 +++++------ src/Response/Response.php | 16 ++--- src/SlimApp.php | 3 +- src/SlimApplicationFactory.php | 42 +++++++------ tests/Dummy/ApiErrorHandler.php | 7 ++- tests/Dummy/BeforeRequestMiddleware.php | 2 +- tests/Dummy/BeforeRouteMiddleware.php | 2 +- tests/Dummy/CreateChannelAction.php | 7 ++- tests/Dummy/ErroringAction.php | 7 ++- tests/Dummy/GoldenKeyAuthMiddleware.php | 2 +- tests/Dummy/NotAllowedHandler.php | 2 +- tests/Dummy/NotFoundHandler.php | 7 ++- tests/Request/RequestTest.php | 46 +++++++-------- tests/SlimApplicationFactoryTest.php | 78 ++++++++++++------------- 22 files changed, 240 insertions(+), 129 deletions(-) create mode 100644 ruleset.xml diff --git a/composer.json b/composer.json index 6d09b4e..825911f 100644 --- a/composer.json +++ b/composer.json @@ -16,13 +16,17 @@ "nette/neon": "^2.4", "slim/slim": "^3.9", "nette/utils": "^2.5", - "nette/di": "^2.4" + "nette/di": "^2.4", + "psr/http-message": "^1.0" }, "require-dev": { "phpunit/phpunit": "^7", "roave/security-advisories": "dev-master", "phpstan/phpstan": "^0.10", - "mockery/mockery": "dev-master" + "mockery/mockery": "dev-master", + "phpstan/phpstan-strict-rules": "^0.10.1", + "slevomat/coding-standard": "^4.8", + "phpstan/phpstan-phpunit": "^0.10.0" }, "scripts": { "test": "vendor/bin/phpunit tests", diff --git a/phpstan.neon b/phpstan.neon index 0bc891a..bbcd52d 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -4,3 +4,7 @@ parameters: ignoreErrors: - '#Call to an undefined method Mockery\\ExpectationInterface|Mockery\\HigherOrderMessage::andReturn().#' + +includes: + - vendor/phpstan/phpstan-strict-rules/rules.neon + - vendor/phpstan/phpstan-phpunit/extension.neon diff --git a/ruleset.xml b/ruleset.xml new file mode 100644 index 0000000..095c314 --- /dev/null +++ b/ruleset.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/ActionHandler.php b/src/ActionHandler.php index 410735b..3f1c0a0 100644 --- a/src/ActionHandler.php +++ b/src/ActionHandler.php @@ -14,6 +14,10 @@ interface ActionHandler * @param array $arguments * @return ResponseInterface */ - public function __invoke(RequestInterface $request, ResponseInterface $response, array $arguments = []); + public function __invoke( + RequestInterface $request, + ResponseInterface $response, + array $arguments = [] + ): ResponseInterface; } diff --git a/src/Controller.php b/src/Controller.php index 0238329..02cb04f 100644 --- a/src/Controller.php +++ b/src/Controller.php @@ -17,7 +17,7 @@ abstract class Controller extends Container * @param RequestInterface $request * @param ResponseInterface $response */ - public function beforeAction(RequestInterface $request, ResponseInterface $response) + public function beforeAction(RequestInterface $request, ResponseInterface $response): void { // intentionally - this method is empty in default } @@ -26,7 +26,7 @@ public function beforeAction(RequestInterface $request, ResponseInterface $respo * @param RequestInterface $request * @param ResponseInterface $response */ - public function afterAction(RequestInterface $request, ResponseInterface $response) + public function afterAction(RequestInterface $request, ResponseInterface $response): void { // intentionally - this method is empty in default } @@ -37,7 +37,7 @@ public function afterAction(RequestInterface $request, ResponseInterface $respon * @param Route $next * @return ResponseInterface */ - public function middleware(RequestInterface $request, ResponseInterface $response, Route $next) + public function middleware(RequestInterface $request, ResponseInterface $response, Route $next): ResponseInterface { $this->beforeAction($request, $response); /** @var ResponseInterface $response */ diff --git a/src/DI/SlimApiExtension.php b/src/DI/SlimApiExtension.php index dc0539a..eff8df5 100644 --- a/src/DI/SlimApiExtension.php +++ b/src/DI/SlimApiExtension.php @@ -2,20 +2,21 @@ namespace BrandEmbassy\Slim\DI; -use ArrayObject; use BrandEmbassy\Slim\SlimApplicationFactory; -use Chadicus\Slim\OAuth2\Middleware\Authorization; use Nette\DI\CompilerExtension; final class SlimApiExtension extends CompilerExtension { + /** + * @var array + */ private $defaults = [ 'apiDefinitionKey' => 'api', 'slimConfiguration' => [], ]; - public function loadConfiguration() + public function loadConfiguration(): void { $this->validateConfig($this->defaults); $builder = $this->getContainerBuilder(); diff --git a/src/ErrorHandler.php b/src/ErrorHandler.php index d519a4c..f0c0b29 100644 --- a/src/ErrorHandler.php +++ b/src/ErrorHandler.php @@ -15,6 +15,10 @@ interface ErrorHandler * @param Throwable|null $e * @return ResponseInterface */ - public function __invoke(RequestInterface $request, ResponseInterface $response, Throwable $e = null); + public function __invoke( + RequestInterface $request, + ResponseInterface $response, + Throwable $e = null + ): ResponseInterface; } diff --git a/src/Middleware.php b/src/Middleware.php index 324a4c9..93009c9 100644 --- a/src/Middleware.php +++ b/src/Middleware.php @@ -14,6 +14,6 @@ interface Middleware * @param callable $next * @return ResponseInterface */ - public function __invoke(RequestInterface $request, ResponseInterface $response, callable $next); + public function __invoke(RequestInterface $request, ResponseInterface $response, callable $next): ResponseInterface; } diff --git a/src/Request/Request.php b/src/Request/Request.php index 2ef4c6d..ca4a819 100644 --- a/src/Request/Request.php +++ b/src/Request/Request.php @@ -11,7 +11,6 @@ use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\StreamInterface; use Psr\Http\Message\UriInterface; -use Slim\Http\Request as SlimRequest; use Slim\Route; use stdClass; @@ -58,7 +57,7 @@ public function getRequiredArgument($name) { $arguments = $this->request->getAttributes(); - $value = isset($arguments[$name]) ? $arguments[$name] : ''; + $value = $arguments[$name] ?? ''; $value = Strings::trim($value); if ($value === '') { @@ -95,7 +94,7 @@ public function getOptionalField($name, $default = null) /** * @inheritdoc */ - public function hasField($name) + public function hasField($name): bool { return array_key_exists($name, (array)$this->getDecodedJsonFromBody()); } @@ -103,7 +102,7 @@ public function hasField($name) /** * @inheritDoc */ - public function getProtocolVersion() + public function getProtocolVersion(): string { return $this->request->getProtocolVersion(); } @@ -119,7 +118,7 @@ public function withProtocolVersion($version) /** * @inheritDoc */ - public function getHeaders() + public function getHeaders(): array { return $this->request->getHeaders(); } @@ -127,7 +126,7 @@ public function getHeaders() /** * @inheritDoc */ - public function hasHeader($name) + public function hasHeader($name): bool { return $this->request->hasHeader($name); } @@ -135,7 +134,7 @@ public function hasHeader($name) /** * @inheritDoc */ - public function getHeader($name) + public function getHeader($name): array { return $this->request->getHeader($name); } @@ -143,7 +142,7 @@ public function getHeader($name) /** * @inheritDoc */ - public function getHeaderLine($name) + public function getHeaderLine($name): string { return $this->request->getHeaderLine($name); } @@ -175,7 +174,7 @@ public function withoutHeader($name) /** * @inheritDoc */ - public function getBody() + public function getBody(): StreamInterface { return $this->request->getBody(); } @@ -191,7 +190,7 @@ public function withBody(StreamInterface $body) /** * @inheritDoc */ - public function getRequestTarget() + public function getRequestTarget(): string { return $this->request->getRequestTarget(); } @@ -207,7 +206,7 @@ public function withRequestTarget($requestTarget) /** * @inheritDoc */ - public function getMethod() + public function getMethod(): string { return $this->request->getMethod(); } @@ -223,7 +222,7 @@ public function withMethod($method) /** * @inheritDoc */ - public function getUri() + public function getUri(): UriInterface { return $this->request->getUri(); } @@ -239,7 +238,7 @@ public function withUri(UriInterface $uri, $preserveHost = false) /** * @inheritDoc */ - public function getServerParams() + public function getServerParams(): array { return $this->request->getServerParams(); } @@ -247,7 +246,7 @@ public function getServerParams() /** * @inheritDoc */ - public function getCookieParams() + public function getCookieParams(): array { return $this->request->getCookieParams(); } @@ -263,7 +262,7 @@ public function withCookieParams(array $cookies) /** * @inheritDoc */ - public function getQueryParams() + public function getQueryParams(): array { return $this->request->getQueryParams(); } @@ -279,7 +278,7 @@ public function withQueryParams(array $query) /** * @inheritDoc */ - public function getUploadedFiles() + public function getUploadedFiles(): array { return $this->request->getUploadedFiles(); } @@ -311,7 +310,7 @@ public function withParsedBody($data) /** * @inheritDoc */ - public function getAttributes() + public function getAttributes(): array { return $this->request->getAttributes(); } diff --git a/src/Response/Response.php b/src/Response/Response.php index 15b8364..ed37d6a 100644 --- a/src/Response/Response.php +++ b/src/Response/Response.php @@ -24,7 +24,7 @@ public function __construct(SlimResponse $slimResponse) /** * @inheritdoc */ - public function getProtocolVersion() + public function getProtocolVersion(): string { return $this->slimResponse->getProtocolVersion(); } @@ -40,7 +40,7 @@ public function withProtocolVersion($version) /** * @inheritdoc */ - public function getHeaders() + public function getHeaders(): array { return $this->slimResponse->getHeaders(); } @@ -48,7 +48,7 @@ public function getHeaders() /** * @inheritdoc */ - public function hasHeader($name) + public function hasHeader($name): bool { return $this->slimResponse->hasHeader($name); } @@ -56,7 +56,7 @@ public function hasHeader($name) /** * @inheritdoc */ - public function getHeader($name) + public function getHeader($name): array { return $this->slimResponse->getHeader($name); } @@ -64,7 +64,7 @@ public function getHeader($name) /** * @inheritdoc */ - public function getHeaderLine($name) + public function getHeaderLine($name): string { return $this->slimResponse->getHeaderLine($name); } @@ -96,7 +96,7 @@ public function withoutHeader($name) /** * @inheritdoc */ - public function getBody() + public function getBody(): StreamInterface { return $this->slimResponse->getBody(); } @@ -112,7 +112,7 @@ public function withBody(StreamInterface $body) /** * @inheritdoc */ - public function getStatusCode() + public function getStatusCode(): int { return $this->slimResponse->getStatusCode(); } @@ -136,7 +136,7 @@ public function withJson($data, $status = null, $encodingOptions = 0) /** * @inheritdoc */ - public function getReasonPhrase() + public function getReasonPhrase(): string { return $this->slimResponse->getReasonPhrase(); } diff --git a/src/SlimApp.php b/src/SlimApp.php index 614cf3d..704c4e1 100644 --- a/src/SlimApp.php +++ b/src/SlimApp.php @@ -4,6 +4,7 @@ use BrandEmbassy\Slim\Request\Request; use BrandEmbassy\Slim\Response\Response; +use Psr\Http\Message\ResponseInterface; use Slim\App; class SlimApp extends App @@ -12,7 +13,7 @@ class SlimApp extends App /** * @inheritdoc */ - public function run($silent = false) + public function run($silent = false): ResponseInterface { $request = new Request($this->getContainer()->get('request')); $response = new Response($this->getContainer()->get('response')); diff --git a/src/SlimApplicationFactory.php b/src/SlimApplicationFactory.php index 687e50c..b6e8171 100644 --- a/src/SlimApplicationFactory.php +++ b/src/SlimApplicationFactory.php @@ -41,7 +41,7 @@ public function __construct(array $configuration, Container $container) /** * @return SlimApp */ - public function create() + public function create(): SlimApp { $app = new SlimApp($this->configuration); @@ -53,8 +53,10 @@ public function create() $this->registerApis($app, $api, $apiName); } + $container = $app->getContainer(); + /** @var Collection $settings */ - $settings = $app->getContainer()['settings']; + $settings = $container->get('settings'); if ($settings->get('removeDefaultHandlers') === true) { $this->removeDefaultSlimErrorHandlers($app); } @@ -77,11 +79,11 @@ public function create() * @param string $configurationCode * @return array */ - private function getConfiguration($configurationCode) + private function getConfiguration(string $configurationCode): array { $configuration = $this->container->getParameters()[$configurationCode]; - if (!is_array($configuration)) { + if (!\is_array($configuration)) { throw new LogicException(sprintf('Missing %s configuration', $configurationCode)); } @@ -99,8 +101,12 @@ private function getConfiguration($configurationCode) * @param string $name * @param string $type */ - private function validateConfiguration(array $configuration, $configurationCode, $name, $type) - { + private function validateConfiguration( + array $configuration, + string $configurationCode, + string $name, + string $type + ): void { if (!isset($configuration[$name]) || gettype($configuration[$name]) !== $type) { throw new LogicException( sprintf( @@ -108,7 +114,7 @@ private function validateConfiguration(array $configuration, $configurationCode, $configurationCode, $name, $type, - gettype(isset($configuration[$name]) ? $configuration[$name] : null) + gettype($configuration[$name] ?? null) ) ); } @@ -118,7 +124,7 @@ private function validateConfiguration(array $configuration, $configurationCode, * @param string $serviceName * @return Closure */ - private function getServiceProvider($serviceName) + private function getServiceProvider(string $serviceName): callable { return function () use ($serviceName) { /** @var object|null $service */ @@ -134,7 +140,7 @@ private function getServiceProvider($serviceName) /** * @param SlimApp $app */ - private function removeDefaultSlimErrorHandlers(SlimApp $app) + private function removeDefaultSlimErrorHandlers(SlimApp $app): void { $app->getContainer()['phpErrorHandler'] = function () { return function (RequestInterface $request, ResponseInterface $response, \Exception $e) { @@ -147,7 +153,7 @@ private function removeDefaultSlimErrorHandlers(SlimApp $app) * @param SlimApp $app * @param array $handlers */ - private function registerHandlers(SlimApp $app, array $handlers) + private function registerHandlers(SlimApp $app, array $handlers): void { foreach ($handlers as $handlerName => $handlerClass) { $app->getContainer()[$handlerName . 'Handler'] = $this->getServiceProvider($handlerClass); @@ -158,7 +164,7 @@ private function registerHandlers(SlimApp $app, array $handlers) * @param SlimApp $app * @param string $serviceName */ - private function registerServiceIntoContainer(SlimApp $app, $serviceName) + private function registerServiceIntoContainer(SlimApp $app, string $serviceName): void { if (!$app->getContainer()->has($serviceName)) { $app->getContainer()[$serviceName] = $this->getServiceProvider($serviceName); @@ -170,7 +176,7 @@ private function registerServiceIntoContainer(SlimApp $app, $serviceName) * @param array $api * @param string $apiName */ - private function registerApis(SlimApp $app, array $api, $apiName) + private function registerApis(SlimApp $app, array $api, string $apiName): void { foreach ($api as $version => $routes) { $this->registerApi($app, $apiName, $version, $routes); @@ -183,7 +189,7 @@ private function registerApis(SlimApp $app, array $api, $apiName) * @param string $version * @param array $routes */ - private function registerApi(SlimApp $app, $apiName, $version, array $routes) + private function registerApi(SlimApp $app, string $apiName, string $version, array $routes): void { foreach ($routes as $routeName => $routeData) { $urlPattern = $this->createUrlPattern($apiName, $version, $routeName); @@ -203,7 +209,7 @@ private function registerApi(SlimApp $app, $apiName, $version, array $routes) * @param string $urlPattern * @param array $routeData */ - private function registerControllerRoute(SlimApp $app, $urlPattern, array $routeData) + private function registerControllerRoute(SlimApp $app, string $urlPattern, array $routeData): void { $this->registerServiceIntoContainer($app, $routeData['service']); @@ -218,7 +224,7 @@ private function registerControllerRoute(SlimApp $app, $urlPattern, array $route * @param array $routeData * @param string $urlPattern */ - private function registerInvokableActionRoutes(SlimApp $app, array $routeData, $urlPattern) + private function registerInvokableActionRoutes(SlimApp $app, array $routeData, string $urlPattern): void { foreach ($routeData as $method => $config) { $service = $config['service']; @@ -246,7 +252,7 @@ private function registerInvokableActionRoutes(SlimApp $app, array $routeData, $ * @param string $routeName * @return string */ - private function createUrlPattern($apiName, $version, $routeName) + private function createUrlPattern(string $apiName, string $version, string $routeName): string { return sprintf('/%s/%s%s', $apiName, $version, $routeName); } @@ -255,7 +261,7 @@ private function createUrlPattern($apiName, $version, $routeName) * @param SlimApp $app * @param string $middleware */ - private function registerBeforeRequestMiddleware(SlimApp $app, $middleware) + private function registerBeforeRequestMiddleware(SlimApp $app, string $middleware): void { $this->registerServiceIntoContainer($app, $middleware); $app->add($middleware); @@ -265,7 +271,7 @@ private function registerBeforeRequestMiddleware(SlimApp $app, $middleware) * @param SlimApp $app * @param array $configuration */ - private function registerBeforeRouteMiddlewares(SlimApp $app, $configuration) + private function registerBeforeRouteMiddlewares(SlimApp $app, array $configuration): void { if (isset($configuration['beforeRouteMiddlewares'])) { foreach ($configuration['beforeRouteMiddlewares'] as $globalMiddleware) { diff --git a/tests/Dummy/ApiErrorHandler.php b/tests/Dummy/ApiErrorHandler.php index 0946f4c..dab2dcd 100644 --- a/tests/Dummy/ApiErrorHandler.php +++ b/tests/Dummy/ApiErrorHandler.php @@ -13,8 +13,11 @@ final class ApiErrorHandler implements ErrorHandler /** * @inheritdoc */ - public function __invoke(RequestInterface $request, ResponseInterface $response, Throwable $e = null) - { + public function __invoke( + RequestInterface $request, + ResponseInterface $response, + Throwable $e = null + ): ResponseInterface { $error = $e !== null ? $e->getMessage() : 'Unknown error.'; return $response->withJson(['error' => $error], 500); diff --git a/tests/Dummy/BeforeRequestMiddleware.php b/tests/Dummy/BeforeRequestMiddleware.php index 72338b4..fd6a007 100644 --- a/tests/Dummy/BeforeRequestMiddleware.php +++ b/tests/Dummy/BeforeRequestMiddleware.php @@ -15,7 +15,7 @@ class BeforeRequestMiddleware implements Middleware * @param callable $next * @return ResponseInterface */ - public function __invoke(RequestInterface $request, ResponseInterface $response, callable $next) + public function __invoke(RequestInterface $request, ResponseInterface $response, callable $next): ResponseInterface { $response = $response->withAddedHeader( 'processed-by-before-request-middleware', diff --git a/tests/Dummy/BeforeRouteMiddleware.php b/tests/Dummy/BeforeRouteMiddleware.php index e8b1fe3..c6a9d96 100644 --- a/tests/Dummy/BeforeRouteMiddleware.php +++ b/tests/Dummy/BeforeRouteMiddleware.php @@ -15,7 +15,7 @@ class BeforeRouteMiddleware implements Middleware * @param callable $next * @return ResponseInterface */ - public function __invoke(RequestInterface $request, ResponseInterface $response, callable $next) + public function __invoke(RequestInterface $request, ResponseInterface $response, callable $next): ResponseInterface { $response = $response->withAddedHeader( 'processed-by-before-route-middlewares', diff --git a/tests/Dummy/CreateChannelAction.php b/tests/Dummy/CreateChannelAction.php index bb3b385..cc2de7f 100644 --- a/tests/Dummy/CreateChannelAction.php +++ b/tests/Dummy/CreateChannelAction.php @@ -12,8 +12,11 @@ final class CreateChannelAction implements ActionHandler /** * @inheritdoc */ - public function __invoke(RequestInterface $request, ResponseInterface $response, array $arguments = []) - { + public function __invoke( + RequestInterface $request, + ResponseInterface $response, + array $arguments = [] + ): ResponseInterface { return $response->withJson(['channelId' => 'fb_1234'], 201); } diff --git a/tests/Dummy/ErroringAction.php b/tests/Dummy/ErroringAction.php index b4553fb..2c0384d 100644 --- a/tests/Dummy/ErroringAction.php +++ b/tests/Dummy/ErroringAction.php @@ -13,8 +13,11 @@ final class ErroringAction implements ActionHandler /** * @inheritdoc */ - public function __invoke(RequestInterface $request, ResponseInterface $response, array $arguments = []) - { + public function __invoke( + RequestInterface $request, + ResponseInterface $response, + array $arguments = [] + ): ResponseInterface { throw new LogicException('Error or not to error, that\'s the question!'); } diff --git a/tests/Dummy/GoldenKeyAuthMiddleware.php b/tests/Dummy/GoldenKeyAuthMiddleware.php index d3e4b1a..1bd0f23 100644 --- a/tests/Dummy/GoldenKeyAuthMiddleware.php +++ b/tests/Dummy/GoldenKeyAuthMiddleware.php @@ -14,7 +14,7 @@ final class GoldenKeyAuthMiddleware implements Middleware * @inheritdoc * @throws Exception */ - public function __invoke(RequestInterface $request, ResponseInterface $response, callable $next) + public function __invoke(RequestInterface $request, ResponseInterface $response, callable $next): ResponseInterface { $headerData = $request->getHeader('goldenKey'); $token = reset($headerData); diff --git a/tests/Dummy/NotAllowedHandler.php b/tests/Dummy/NotAllowedHandler.php index fafed4b..1d0e266 100644 --- a/tests/Dummy/NotAllowedHandler.php +++ b/tests/Dummy/NotAllowedHandler.php @@ -14,7 +14,7 @@ final class NotAllowedHandler /** * @inheritdoc */ - public function __invoke(RequestInterface $request, ResponseInterface $response) + public function __invoke(RequestInterface $request, ResponseInterface $response): ResponseInterface { return $response->withJson(['error' => 'Dummy NotAllowedHandler here!'], 405); } diff --git a/tests/Dummy/NotFoundHandler.php b/tests/Dummy/NotFoundHandler.php index 9d3237c..731ce6c 100644 --- a/tests/Dummy/NotFoundHandler.php +++ b/tests/Dummy/NotFoundHandler.php @@ -13,8 +13,11 @@ final class NotFoundHandler implements ErrorHandler /** * @inheritdoc */ - public function __invoke(RequestInterface $request, ResponseInterface $response, Throwable $e = null) - { + public function __invoke( + RequestInterface $request, + ResponseInterface $response, + Throwable $e = null + ): ResponseInterface { return $response->withJson(['error' => 'Dummy NotFoundHandler here!'], 404); } diff --git a/tests/Request/RequestTest.php b/tests/Request/RequestTest.php index 4bc15da..2517876 100644 --- a/tests/Request/RequestTest.php +++ b/tests/Request/RequestTest.php @@ -9,38 +9,38 @@ use LogicException; use Mockery; use Mockery\MockInterface; -use PHPUnit_Framework_TestCase; +use PHPUnit\Framework\TestCase; use Psr\Http\Message\StreamInterface; use Slim\Http\Body; use Slim\Http\Headers; use Slim\Http\Request as SlimRequest; use Slim\Http\Uri; -final class RequestTest extends PHPUnit_Framework_TestCase +final class RequestTest extends TestCase { - const PARAM_NAME = 'dateFrom'; - const DATE_TIME_STRING = '2017-06-10T01:00:00+01:00'; + private const PARAM_NAME = 'dateFrom'; + private const DATE_TIME_STRING = '2017-06-10T01:00:00+01:00'; - public function testShouldDistinguishBetweenNullAndEmptyOption() + public function testShouldDistinguishBetweenNullAndEmptyOption(): void { $request = $this->createDummyRequest(); - $this->assertTrue($request->hasField('thisIsNull')); - $this->assertFalse($request->hasField('nonExistingField')); - $this->assertTrue($request->hasField('thisIsGandalf')); + self::assertTrue($request->hasField('thisIsNull')); + self::assertFalse($request->hasField('nonExistingField')); + self::assertTrue($request->hasField('thisIsGandalf')); } - public function testShouldRaiseExceptionForMissingRequiredField() + public function testShouldRaiseExceptionForMissingRequiredField(): void { $request = $this->createDummyRequest(); - $this->assertEquals('gandalf', $request->getField('thisIsGandalf')); + self::assertEquals('gandalf', $request->getField('thisIsGandalf')); $this->expectException(MissingApiArgumentException::class); $request->getField('nonExistingField'); } - public function testGettingDateTimeQueryParam() + public function testGettingDateTimeQueryParam(): void { $arguments = [self::PARAM_NAME => self::DATE_TIME_STRING]; $slimRequest = $this->createMockSlimRequest($arguments); @@ -48,8 +48,8 @@ public function testGettingDateTimeQueryParam() $request = new Request($slimRequest); $dateTime = $request->getDateTimeQueryParam(self::PARAM_NAME); - $this->assertInstanceOf(DateTimeImmutable::class, $dateTime); - $this->assertSame(self::DATE_TIME_STRING, $dateTime->format(DateTime::ATOM)); + self::assertInstanceOf(DateTimeImmutable::class, $dateTime); + self::assertSame(self::DATE_TIME_STRING, $dateTime->format(DateTime::ATOM)); } /** @@ -59,9 +59,9 @@ public function testGettingDateTimeQueryParam() * @param array $arguments */ public function testGettingDateTimeQueryParamThrowsExceptionIfInvalidArgument( - $logicExceptionMessage, + string $logicExceptionMessage, array $arguments - ) { + ): void { $slimRequest = $this->createMockSlimRequest($arguments); $request = new Request($slimRequest); $this->expectException(LogicException::class); @@ -73,7 +73,7 @@ public function testGettingDateTimeQueryParamThrowsExceptionIfInvalidArgument( /** * @return array */ - public function getDataForInvalidDateTimeArgument() + public function getDataForInvalidDateTimeArgument(): array { return [ 'Missing from' => [ @@ -91,7 +91,7 @@ public function getDataForInvalidDateTimeArgument() * @param array $arguments * @return MockInterface&SlimRequest */ - private function createMockSlimRequest(array $arguments) + private function createMockSlimRequest(array $arguments): MockInterface { /** @var MockInterface&SlimRequest $mock */ $mock = Mockery::mock(SlimRequest::class); @@ -104,7 +104,7 @@ private function createMockSlimRequest(array $arguments) * @param StreamInterface $body * @return Request */ - private function createRequest(StreamInterface $body) + private function createRequest(StreamInterface $body): Request { $url = new Uri('https', 'example.com'); $slimRequest = new SlimRequest('POST', $url, new Headers(), [], [], $body); @@ -115,15 +115,15 @@ private function createRequest(StreamInterface $body) /** * @return Request */ - private function createDummyRequest() + private function createDummyRequest(): Request { - $body = new Body(fopen('php://temp', 'rb+')); + $resource = fopen('php://temp', 'rb+'); + \assert(\is_resource($resource)); + $body = new Body($resource); $body->write('{"thisIsNull": null, "thisIsGandalf": "gandalf"}'); $body->rewind(); - $request = $this->createRequest($body); - - return $request; + return $this->createRequest($body); } } diff --git a/tests/SlimApplicationFactoryTest.php b/tests/SlimApplicationFactoryTest.php index a9c6040..a5fa1c6 100644 --- a/tests/SlimApplicationFactoryTest.php +++ b/tests/SlimApplicationFactoryTest.php @@ -3,7 +3,6 @@ namespace BrandEmbassyTest\Slim; use BrandEmbassy\Slim\Response\ResponseInterface; -use BrandEmbassy\Slim\SlimApp; use BrandEmbassy\Slim\SlimApplicationFactory; use BrandEmbassy\Slim\Request\Request; use BrandEmbassy\Slim\Response\Response; @@ -11,67 +10,66 @@ use Nette\DI\Container; use Nette\DI\ContainerLoader; use Nette\DI\Extensions\ExtensionsExtension; -use PHPUnit_Framework_TestCase; +use PHPUnit\Framework\TestCase; use Slim\App; use Slim\Http\Body; use Slim\Http\Headers; use Slim\Http\Request as SlimRequest; use Slim\Http\Uri; -final class SlimApplicationFactoryTest extends PHPUnit_Framework_TestCase +final class SlimApplicationFactoryTest extends TestCase { - public function testShouldAllowEmptyErrorHandlers() + public function testShouldAllowEmptyErrorHandlers(): void { - $result = $this->createSlimApp(__DIR__ . '/configNoHandlers.neon'); - $this->assertInstanceOf(SlimApp::class, $result); + $this->createSlimApp(__DIR__ . '/configNoHandlers.neon'); } - public function testShouldBeHandledByNotFoundErrorHandler() + public function testShouldBeHandledByNotFoundErrorHandler(): void { $request = $this->createRequest('POST', '/non-existing/path'); /** @var ResponseInterface $response */ $response = $this->createSlimApp()->process($request, new Response(new \Slim\Http\Response())); - $this->assertEquals(404, $response->getStatusCode()); - $this->assertEquals('{"error":"Dummy NotFoundHandler here!"}', $this->getContents($response)); + self::assertEquals(404, $response->getStatusCode()); + self::assertEquals('{"error":"Dummy NotFoundHandler here!"}', $this->getContents($response)); } - public function testShouldBeHandledByNotAllowedHandler() + public function testShouldBeHandledByNotAllowedHandler(): void { $request = $this->createRequest('PATCH', '/new-api/2.0/channels'); /** @var ResponseInterface $response */ $response = $this->createSlimApp()->process($request, new Response(new \Slim\Http\Response())); - $this->assertEquals(405, $response->getStatusCode()); - $this->assertEquals('{"error":"Dummy NotAllowedHandler here!"}', $this->getContents($response)); + self::assertEquals(405, $response->getStatusCode()); + self::assertEquals('{"error":"Dummy NotAllowedHandler here!"}', $this->getContents($response)); } - public function testShouldBeHandledByApiErrorHandler() + public function testShouldBeHandledByApiErrorHandler(): void { $request = $this->createRequest('POST', '/new-api/2.0/error'); /** @var ResponseInterface $response */ $response = $this->createSlimApp()->process($request, new Response(new \Slim\Http\Response())); - $this->assertEquals(500, $response->getStatusCode()); - $this->assertEquals('{"error":"Error or not to error, that\'s the question!"}', $this->getContents($response)); + self::assertEquals(500, $response->getStatusCode()); + self::assertEquals('{"error":"Error or not to error, that\'s the question!"}', $this->getContents($response)); } - public function testShouldDenyRequestByAccessMiddleware() + public function testShouldDenyRequestByAccessMiddleware(): void { $request = $this->createRequest('POST', '/new-api/2.0/channels'); /** @var ResponseInterface $response */ $response = $this->createSlimApp()->process($request, new Response(new \Slim\Http\Response())); - $this->assertEquals(401, $response->getStatusCode()); - $this->assertEquals('{"error":"YOU SHALL NOT PASS!"}', $this->getContents($response)); + self::assertEquals(401, $response->getStatusCode()); + self::assertEquals('{"error":"YOU SHALL NOT PASS!"}', $this->getContents($response)); } - public function testShouldAllowRequestByAccessMiddleware() + public function testShouldAllowRequestByAccessMiddleware(): void { $request = $this->createRequest( 'POST', @@ -82,36 +80,36 @@ public function testShouldAllowRequestByAccessMiddleware() /** @var ResponseInterface $response */ $response = $this->createSlimApp()->process($request, new Response(new \Slim\Http\Response())); - $this->assertEquals(201, $response->getStatusCode()); - $this->assertEquals('{"channelId":"fb_1234"}', $this->getContents($response)); + self::assertEquals(201, $response->getStatusCode()); + self::assertEquals('{"channelId":"fb_1234"}', $this->getContents($response)); } - public function testShouldProcessBothGlobalMiddlewares() + public function testShouldProcessBothGlobalMiddlewares(): void { $request = $this->createRequest('POST', '/new-api/2.0/channels'); /** @var ResponseInterface $response */ $response = $this->createSlimApp()->process($request, new Response(new \Slim\Http\Response())); - $this->assertEquals( + self::assertEquals( ['proof-for-before-request'], $response->getHeader('processed-by-before-request-middleware') ); - $this->assertEquals( + self::assertEquals( ['proof-for-before-route'], $response->getHeader('processed-by-before-route-middlewares') ); } - public function testShouldProcessBeforeRequestMiddleware() + public function testShouldProcessBeforeRequestMiddleware(): void { $request = $this->createRequest('POST', '/non-existing/path'); /** @var ResponseInterface $response */ $response = $this->createSlimApp()->process($request, new Response(new \Slim\Http\Response())); - $this->assertEquals( + self::assertEquals( ['proof-for-before-request'], $response->getHeader('processed-by-before-request-middleware') ); @@ -121,7 +119,7 @@ public function testShouldProcessBeforeRequestMiddleware() * @param string $configPath * @return Container */ - private function createContainer($configPath = __DIR__ . '/config.neon') + private function createContainer(string $configPath = __DIR__ . '/config.neon'): Container { $loader = new ContainerLoader(__DIR__ . '/temp', true); $class = $loader->load( @@ -142,25 +140,27 @@ function ($compiler) use ($configPath) { * @param string[] $headers * @return Request */ - private function createRequest($requestMethod, $requestUrlPath, array $headers = []) + private function createRequest(string $requestMethod, string $requestUrlPath, array $headers = []): Request { - return new Request( - new SlimRequest( - $requestMethod, - new Uri('http', 'api.be.com', 80, $requestUrlPath), - new Headers($headers), - [], - [], - new Body(fopen('php://temp', 'rb+')) - ) + $body = fopen('php://temp', 'rb+'); + \assert(\is_resource($body)); + $slimRequest = new SlimRequest( + $requestMethod, + new Uri('http', 'api.be.com', 80, $requestUrlPath), + new Headers($headers), + [], + [], + new Body($body) ); + + return new Request($slimRequest); } /** * @param string $configPath * @return App */ - private function createSlimApp($configPath = __DIR__ . '/config.neon') + private function createSlimApp(string $configPath = __DIR__ . '/config.neon'): App { /** @var SlimApplicationFactory $factory */ $factory = $this->createContainer($configPath)->getByType(SlimApplicationFactory::class); @@ -172,7 +172,7 @@ private function createSlimApp($configPath = __DIR__ . '/config.neon') * @param ResponseInterface $response * @return string */ - private function getContents(ResponseInterface $response) + private function getContents(ResponseInterface $response): string { $body = $response->getBody(); $body->rewind(); From 8242453e90a0259e2ac44144abe395778871bbba Mon Sep 17 00:00:00 2001 From: Petr Hejna Date: Mon, 1 Oct 2018 15:42:25 +0200 Subject: [PATCH 4/4] Autofix of codestyle --- .circleci/config.yml | 2 +- composer.json | 5 +-- phpstan.neon | 1 - ruleset.xml | 2 ++ src/ActionHandler.php | 2 +- src/Controller.php | 16 +-------- src/DI/SlimApiExtension.php | 3 +- src/ErrorHandler.php | 10 ++---- src/Middleware.php | 8 +---- src/MissingApiArgumentException.php | 2 +- src/Request/Request.php | 47 ++++++++----------------- src/Request/RequestInterface.php | 26 ++++---------- src/RequestException.php | 2 +- src/Response/Response.php | 17 +-------- src/Response/ResponseInterface.php | 2 +- src/SlimApp.php | 5 +-- src/SlimApplicationFactory.php | 42 +++++++--------------- tests/Dummy/ApiErrorHandler.php | 11 +++--- tests/Dummy/BeforeRequestMiddleware.php | 9 ++--- tests/Dummy/BeforeRouteMiddleware.php | 9 ++--- tests/Dummy/CreateChannelAction.php | 2 +- tests/Dummy/ErroringAction.php | 5 +-- tests/Dummy/GoldenKeyAuthMiddleware.php | 9 +++-- tests/Dummy/NotAllowedHandler.php | 5 +-- tests/Dummy/NotFoundHandler.php | 7 ++-- tests/Request/RequestTest.php | 22 ++++-------- tests/SlimApplicationFactoryTest.php | 26 ++++---------- 27 files changed, 87 insertions(+), 210 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fed18e0..dac96a0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,6 +22,6 @@ jobs: - ./vendor key: v1-dependencies-{{ checksum "composer.json" }} + - run: composer phpcs - run: composer phpstan - - run: composer test diff --git a/composer.json b/composer.json index 825911f..153252a 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ } }, "require": { - "php": ">=7.1", + "php": ">=7.2", "nette/neon": "^2.4", "slim/slim": "^3.9", "nette/utils": "^2.5", @@ -24,12 +24,13 @@ "roave/security-advisories": "dev-master", "phpstan/phpstan": "^0.10", "mockery/mockery": "dev-master", - "phpstan/phpstan-strict-rules": "^0.10.1", "slevomat/coding-standard": "^4.8", "phpstan/phpstan-phpunit": "^0.10.0" }, "scripts": { "test": "vendor/bin/phpunit tests", + "phpcs": "vendor/bin/phpcs --standard=ruleset.xml src tests --ignore=tests/temp", + "phpcbf": "./vendor/bin/phpcbf --standard=ruleset.xml src tests --ignore=tests/temp", "phpstan": "vendor/bin/phpstan analyse src tests -l max -c phpstan.neon" } } diff --git a/phpstan.neon b/phpstan.neon index bbcd52d..9128f66 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -6,5 +6,4 @@ parameters: - '#Call to an undefined method Mockery\\ExpectationInterface|Mockery\\HigherOrderMessage::andReturn().#' includes: - - vendor/phpstan/phpstan-strict-rules/rules.neon - vendor/phpstan/phpstan-phpunit/extension.neon diff --git a/ruleset.xml b/ruleset.xml index 095c314..dc2da08 100644 --- a/ruleset.xml +++ b/ruleset.xml @@ -16,6 +16,8 @@ + + diff --git a/src/ActionHandler.php b/src/ActionHandler.php index 3f1c0a0..7041562 100644 --- a/src/ActionHandler.php +++ b/src/ActionHandler.php @@ -1,4 +1,4 @@ -beforeAction($request, $response); diff --git a/src/DI/SlimApiExtension.php b/src/DI/SlimApiExtension.php index eff8df5..396f610 100644 --- a/src/DI/SlimApiExtension.php +++ b/src/DI/SlimApiExtension.php @@ -1,4 +1,4 @@ -addDefinition($this->prefix('slimApi.factory')) ->setFactory(SlimApplicationFactory::class, [$this->config]); } + } diff --git a/src/ErrorHandler.php b/src/ErrorHandler.php index f0c0b29..cdc7662 100644 --- a/src/ErrorHandler.php +++ b/src/ErrorHandler.php @@ -1,4 +1,4 @@ -request = $request; @@ -38,10 +35,11 @@ public function __construct(ServerRequestInterface $request) /** * @inheritdoc */ - public function getQueryParam($key, $default = null) + public function getQueryParam(string $key, $default = null) { $getParams = $this->getQueryParams(); $result = $default; + if (isset($getParams[$key])) { $result = $getParams[$key]; } @@ -53,7 +51,7 @@ public function getQueryParam($key, $default = null) * @inheritdoc * @throws MissingApiArgumentException */ - public function getRequiredArgument($name) + public function getRequiredArgument(string $name): string { $arguments = $this->request->getAttributes(); @@ -61,7 +59,7 @@ public function getRequiredArgument($name) $value = Strings::trim($value); if ($value === '') { - throw new MissingApiArgumentException(sprintf('Missing "%s" argument', $name)); + throw new MissingApiArgumentException(\sprintf('Missing "%s" argument', $name)); } return $value; @@ -71,12 +69,12 @@ public function getRequiredArgument($name) * @inheritdoc * @throws MissingApiArgumentException */ - public function getField($name) + public function getField(string $name) { $body = $this->getDecodedJsonFromBody(); if (!$this->hasField($name)) { - throw new MissingApiArgumentException(sprintf('Field "%s" is missing in request body', $name)); + throw new MissingApiArgumentException(\sprintf('Field "%s" is missing in request body', $name)); } return $body->$name; @@ -88,7 +86,9 @@ public function getField($name) */ public function getOptionalField($name, $default = null) { - return $this->hasField($name) ? $this->getField($name) : $default; + return $this->hasField($name) + ? $this->getField($name) + : $default; } /** @@ -96,12 +96,9 @@ public function getOptionalField($name, $default = null) */ public function hasField($name): bool { - return array_key_exists($name, (array)$this->getDecodedJsonFromBody()); + return \array_key_exists($name, (array)$this->getDecodedJsonFromBody()); } - /** - * @inheritDoc - */ public function getProtocolVersion(): string { return $this->request->getProtocolVersion(); @@ -171,9 +168,6 @@ public function withoutHeader($name) return new static($this->request->withoutHeader($name)); } - /** - * @inheritDoc - */ public function getBody(): StreamInterface { return $this->request->getBody(); @@ -187,9 +181,6 @@ public function withBody(StreamInterface $body) return new static($this->request->withBody($body)); } - /** - * @inheritDoc - */ public function getRequestTarget(): string { return $this->request->getRequestTarget(); @@ -203,9 +194,6 @@ public function withRequestTarget($requestTarget) return new static($this->request->withRequestTarget($requestTarget)); } - /** - * @inheritDoc - */ public function getMethod(): string { return $this->request->getMethod(); @@ -219,9 +207,6 @@ public function withMethod($method) return new static($this->request->withMethod($method)); } - /** - * @inheritDoc - */ public function getUri(): UriInterface { return $this->request->getUri(); @@ -324,6 +309,7 @@ public function getAttribute($name, $default = null) if ($value === $default) { $route = $this->request->getAttribute('route', $default); + if ($route instanceof Route) { $value = $route->getArgument($name, $default); } @@ -361,21 +347,18 @@ public function getDecodedJsonFromBody() return $this->decodedJsonFromBody; } - /** - * @inheritdoc - */ - public function getDateTimeQueryParam($field) + public function getDateTimeQueryParam(string $field): DateTimeImmutable { $datetimeParam = $this->getQueryParam($field); if ($datetimeParam === null) { - throw new LogicException(sprintf('Could not find %s in request\'s params', $field)); + throw new LogicException(\sprintf('Could not find %s in request\'s params', $field)); } $datetime = DateTimeImmutable::createFromFormat(DateTime::ATOM, $datetimeParam); if ($datetime === false || $datetime->format(DateTime::ATOM) !== $datetimeParam) { - throw new LogicException(sprintf('Could not parse %s as datetime', $field)); + throw new LogicException(\sprintf('Could not parse %s as datetime', $field)); } return $datetime; diff --git a/src/Request/RequestInterface.php b/src/Request/RequestInterface.php index 8439124..e64293e 100644 --- a/src/Request/RequestInterface.php +++ b/src/Request/RequestInterface.php @@ -1,4 +1,4 @@ -slimResponse = $slimResponse; } - /** - * @inheritdoc - */ public function getProtocolVersion(): string { return $this->slimResponse->getProtocolVersion(); @@ -93,9 +87,6 @@ public function withoutHeader($name) return new static($this->slimResponse->withoutHeader($name)); } - /** - * @inheritdoc - */ public function getBody(): StreamInterface { return $this->slimResponse->getBody(); @@ -109,9 +100,6 @@ public function withBody(StreamInterface $body) return new static($this->slimResponse->withBody($body)); } - /** - * @inheritdoc - */ public function getStatusCode(): int { return $this->slimResponse->getStatusCode(); @@ -133,9 +121,6 @@ public function withJson($data, $status = null, $encodingOptions = 0) return new static($this->slimResponse->withJson($data, $status, $encodingOptions)); } - /** - * @inheritdoc - */ public function getReasonPhrase(): string { return $this->slimResponse->getReasonPhrase(); diff --git a/src/Response/ResponseInterface.php b/src/Response/ResponseInterface.php index 31f8656..1c84583 100644 --- a/src/Response/ResponseInterface.php +++ b/src/Response/ResponseInterface.php @@ -1,4 +1,4 @@ -process($request, $response); $contentTypes = $response->getHeader('Content-Type'); - $contentType = reset($contentTypes); + $contentType = \reset($contentTypes); if ($contentType === 'text/html; charset=UTF-8' && $response->getBody()->getSize() === 0) { $response = $response->withHeader('Content-Type', 'text/plain; charset=UTF-8'); @@ -32,4 +32,5 @@ public function run($silent = false): ResponseInterface return $response; } + } diff --git a/src/SlimApplicationFactory.php b/src/SlimApplicationFactory.php index b6e8171..39f6c99 100644 --- a/src/SlimApplicationFactory.php +++ b/src/SlimApplicationFactory.php @@ -1,4 +1,4 @@ -beforeRoutesMiddlewares = []; } - /** - * @return SlimApp - */ public function create(): SlimApp { $app = new SlimApp($this->configuration); @@ -57,6 +54,7 @@ public function create(): SlimApp /** @var Collection $settings */ $settings = $container->get('settings'); + if ($settings->get('removeDefaultHandlers') === true) { $this->removeDefaultSlimErrorHandlers($app); } @@ -72,7 +70,6 @@ public function create(): SlimApp } return $app; - } /** @@ -84,10 +81,11 @@ private function getConfiguration(string $configurationCode): array $configuration = $this->container->getParameters()[$configurationCode]; if (!\is_array($configuration)) { - throw new LogicException(sprintf('Missing %s configuration', $configurationCode)); + throw new LogicException(\sprintf('Missing %s configuration', $configurationCode)); } $this->validateConfiguration($configuration, $configurationCode, 'routes', 'array'); + if (isset($configuration['handlers'])) { $this->validateConfiguration($configuration, $configurationCode, 'handlers', 'array'); } @@ -107,14 +105,14 @@ private function validateConfiguration( string $name, string $type ): void { - if (!isset($configuration[$name]) || gettype($configuration[$name]) !== $type) { + if (!isset($configuration[$name]) || \gettype($configuration[$name]) !== $type) { throw new LogicException( - sprintf( + \sprintf( 'Missing or empty %s.%s configuration (has to be %s, but is %s)', $configurationCode, $name, $type, - gettype($configuration[$name] ?? null) + \gettype($configuration[$name] ?? null) ) ); } @@ -129,6 +127,7 @@ private function getServiceProvider(string $serviceName): callable return function () use ($serviceName) { /** @var object|null $service */ $service = $this->container->getByType($serviceName, false); + if ($service === null) { $service = $this->container->getService($serviceName); } @@ -137,13 +136,10 @@ private function getServiceProvider(string $serviceName): callable }; } - /** - * @param SlimApp $app - */ private function removeDefaultSlimErrorHandlers(SlimApp $app): void { - $app->getContainer()['phpErrorHandler'] = function () { - return function (RequestInterface $request, ResponseInterface $response, \Exception $e) { + $app->getContainer()['phpErrorHandler'] = static function () { + return static function (RequestInterface $request, ResponseInterface $response, \Throwable $e): void { throw $e; }; }; @@ -160,10 +156,6 @@ private function registerHandlers(SlimApp $app, array $handlers): void } } - /** - * @param SlimApp $app - * @param string $serviceName - */ private function registerServiceIntoContainer(SlimApp $app, string $serviceName): void { if (!$app->getContainer()->has($serviceName)) { @@ -204,7 +196,6 @@ private function registerApi(SlimApp $app, string $apiName, string $version, arr /** * @deprecated Do not use Controllers, use Invokable Action classes (use MiddleWareInterface) - * * @param SlimApp $app * @param string $urlPattern * @param array $routeData @@ -246,21 +237,11 @@ private function registerInvokableActionRoutes(SlimApp $app, array $routeData, s } } - /** - * @param string $apiName - * @param string $version - * @param string $routeName - * @return string - */ private function createUrlPattern(string $apiName, string $version, string $routeName): string { - return sprintf('/%s/%s%s', $apiName, $version, $routeName); + return \sprintf('/%s/%s%s', $apiName, $version, $routeName); } - /** - * @param SlimApp $app - * @param string $middleware - */ private function registerBeforeRequestMiddleware(SlimApp $app, string $middleware): void { $this->registerServiceIntoContainer($app, $middleware); @@ -280,4 +261,5 @@ private function registerBeforeRouteMiddlewares(SlimApp $app, array $configurati } } } + } diff --git a/tests/Dummy/ApiErrorHandler.php b/tests/Dummy/ApiErrorHandler.php index dab2dcd..80520c8 100644 --- a/tests/Dummy/ApiErrorHandler.php +++ b/tests/Dummy/ApiErrorHandler.php @@ -1,4 +1,4 @@ -getMessage() : 'Unknown error.'; + $error = $e !== null + ? $e->getMessage() + : 'Unknown error.'; return $response->withJson(['error' => $error], 500); } diff --git a/tests/Dummy/BeforeRequestMiddleware.php b/tests/Dummy/BeforeRequestMiddleware.php index fd6a007..26233c8 100644 --- a/tests/Dummy/BeforeRequestMiddleware.php +++ b/tests/Dummy/BeforeRequestMiddleware.php @@ -1,4 +1,4 @@ -withAddedHeader( @@ -24,4 +18,5 @@ public function __invoke(RequestInterface $request, ResponseInterface $response, return $next($request, $response); } + } diff --git a/tests/Dummy/BeforeRouteMiddleware.php b/tests/Dummy/BeforeRouteMiddleware.php index c6a9d96..7499223 100644 --- a/tests/Dummy/BeforeRouteMiddleware.php +++ b/tests/Dummy/BeforeRouteMiddleware.php @@ -1,4 +1,4 @@ -withAddedHeader( @@ -24,4 +18,5 @@ public function __invoke(RequestInterface $request, ResponseInterface $response, return $next($request, $response); } + } diff --git a/tests/Dummy/CreateChannelAction.php b/tests/Dummy/CreateChannelAction.php index cc2de7f..e936b67 100644 --- a/tests/Dummy/CreateChannelAction.php +++ b/tests/Dummy/CreateChannelAction.php @@ -1,4 +1,4 @@ -getHeader('goldenKey'); - $token = reset($headerData); - $token = $token !== false ? $token : ''; + $token = \reset($headerData); + $token = $token !== false + ? $token + : ''; if ($token !== 'uber-secret-token-made-of-pure-gold') { return $response->withJson(['error' => 'YOU SHALL NOT PASS!'], 401); @@ -26,4 +28,5 @@ public function __invoke(RequestInterface $request, ResponseInterface $response, return $next($request, $response); } + } diff --git a/tests/Dummy/NotAllowedHandler.php b/tests/Dummy/NotAllowedHandler.php index 1d0e266..e3a848b 100644 --- a/tests/Dummy/NotAllowedHandler.php +++ b/tests/Dummy/NotAllowedHandler.php @@ -1,4 +1,4 @@ -withJson(['error' => 'Dummy NotAllowedHandler here!'], 405); diff --git a/tests/Dummy/NotFoundHandler.php b/tests/Dummy/NotFoundHandler.php index 731ce6c..8208e16 100644 --- a/tests/Dummy/NotFoundHandler.php +++ b/tests/Dummy/NotFoundHandler.php @@ -1,4 +1,4 @@ -withJson(['error' => 'Dummy NotFoundHandler here!'], 404); } diff --git a/tests/Request/RequestTest.php b/tests/Request/RequestTest.php index 2517876..54d181d 100644 --- a/tests/Request/RequestTest.php +++ b/tests/Request/RequestTest.php @@ -1,11 +1,10 @@ -getDateTimeQueryParam(self::PARAM_NAME); - self::assertInstanceOf(DateTimeImmutable::class, $dateTime); self::assertSame(self::DATE_TIME_STRING, $dateTime->format(DateTime::ATOM)); } /** * @dataProvider getDataForInvalidDateTimeArgument - * * @param string $logicExceptionMessage * @param array $arguments */ @@ -77,12 +74,12 @@ public function getDataForInvalidDateTimeArgument(): array { return [ 'Missing from' => [ - sprintf('Could not find %s in request\'s params', self::PARAM_NAME), - [] + \sprintf('Could not find %s in request\'s params', self::PARAM_NAME), + [], ], 'Invalid from' => [ - sprintf('Could not parse %s as datetime', self::PARAM_NAME), - [self::PARAM_NAME => 123456789] + \sprintf('Could not parse %s as datetime', self::PARAM_NAME), + [self::PARAM_NAME => '123456789'], ], ]; } @@ -100,10 +97,6 @@ private function createMockSlimRequest(array $arguments): MockInterface return $mock; } - /** - * @param StreamInterface $body - * @return Request - */ private function createRequest(StreamInterface $body): Request { $url = new Uri('https', 'example.com'); @@ -112,12 +105,9 @@ private function createRequest(StreamInterface $body): Request return new Request($slimRequest); } - /** - * @return Request - */ private function createDummyRequest(): Request { - $resource = fopen('php://temp', 'rb+'); + $resource = \fopen('php://temp', 'rb+'); \assert(\is_resource($resource)); $body = new Body($resource); $body->write('{"thisIsNull": null, "thisIsGandalf": "gandalf"}'); diff --git a/tests/SlimApplicationFactoryTest.php b/tests/SlimApplicationFactoryTest.php index a5fa1c6..67e5441 100644 --- a/tests/SlimApplicationFactoryTest.php +++ b/tests/SlimApplicationFactoryTest.php @@ -1,11 +1,11 @@ -createSlimApp(__DIR__ . '/configNoHandlers.neon'); + $this->expectNotToPerformAssertions(); } public function testShouldBeHandledByNotFoundErrorHandler(): void @@ -115,23 +116,18 @@ public function testShouldProcessBeforeRequestMiddleware(): void ); } - /** - * @param string $configPath - * @return Container - */ private function createContainer(string $configPath = __DIR__ . '/config.neon'): Container { $loader = new ContainerLoader(__DIR__ . '/temp', true); $class = $loader->load( - function ($compiler) use ($configPath) { - /** @var Compiler $compiler */ + static function (Compiler $compiler) use ($configPath): void { $compiler->loadConfig($configPath); $compiler->addExtension('extensions', new ExtensionsExtension()); }, \md5($configPath) ); - return new $class; + return new $class(); } /** @@ -142,7 +138,7 @@ function ($compiler) use ($configPath) { */ private function createRequest(string $requestMethod, string $requestUrlPath, array $headers = []): Request { - $body = fopen('php://temp', 'rb+'); + $body = \fopen('php://temp', 'rb+'); \assert(\is_resource($body)); $slimRequest = new SlimRequest( $requestMethod, @@ -156,10 +152,6 @@ private function createRequest(string $requestMethod, string $requestUrlPath, ar return new Request($slimRequest); } - /** - * @param string $configPath - * @return App - */ private function createSlimApp(string $configPath = __DIR__ . '/config.neon'): App { /** @var SlimApplicationFactory $factory */ @@ -168,10 +160,6 @@ private function createSlimApp(string $configPath = __DIR__ . '/config.neon'): A return $factory->create(); } - /** - * @param ResponseInterface $response - * @return string - */ private function getContents(ResponseInterface $response): string { $body = $response->getBody();