diff --git a/composer.json b/composer.json index e237851..262341d 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "php": "^7.2", "clue/block-react": "^1.3", "wyrihaximus/cs-fixer-config": "^1.0.1", - "wyrihaximus/test-utilities": "^1.0.1" + "wyrihaximus/test-utilities": "^1.2.1" }, "require-dev": {}, "config": { @@ -98,7 +98,7 @@ ], "stan": [ "@ensure-installed", - "phpstan analyse src tests --level max --ansi" + "phpstan analyse src tests --level max --ansi -c phpstan.neon" ], "unit": [ "@ensure-installed", diff --git a/composer.lock b/composer.lock index 8825c4b..ec80b2a 100644 --- a/composer.lock +++ b/composer.lock @@ -1,10 +1,10 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "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": "e9c190e809dd7e8f55edcac2e918b2af", + "content-hash": "37bff7bf8820b6946ea49b8acc628d15", "packages": [ { "name": "api-clients/cs-fixer-config", @@ -952,6 +952,52 @@ "homepage": "https://github.com/JakubOnderka/PHP-Parallel-Lint", "time": "2018-02-24T15:31:20+00:00" }, + { + "name": "jangregor/phpstan-prophecy", + "version": "0.3.0", + "source": { + "type": "git", + "url": "https://github.com/Jan0707/phpstan-prophecy.git", + "reference": "a1bfe3c3920829d4004240fb68ed85ab6dd18b14" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Jan0707/phpstan-prophecy/zipball/a1bfe3c3920829d4004240fb68ed85ab6dd18b14", + "reference": "a1bfe3c3920829d4004240fb68ed85ab6dd18b14", + "shasum": "" + }, + "require": { + "php": "^7.1", + "phpstan/phpstan": "^0.10.0 || ^0.11.0" + }, + "conflict": { + "phpspec/prophecy": "<1.7, >=2.0", + "phpunit/phpunit": "<6.0, >=8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.13.1", + "phpspec/prophecy": "^1.7", + "phpunit/phpunit": "^6.0||^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "JanGregor\\Prophecy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jan Gregor Emge-Triebel", + "email": "jan@jangregor.me" + } + ], + "description": "Provides a phpstan/phpstan extension for phpspec/prophecy", + "time": "2019-01-18T13:44:45+00:00" + }, { "name": "jean85/pretty-package-versions", "version": "1.2", @@ -1124,16 +1170,16 @@ }, { "name": "localheinz/composer-normalize", - "version": "1.1.2", + "version": "1.1.3", "source": { "type": "git", "url": "https://github.com/localheinz/composer-normalize.git", - "reference": "506fdf9234447372df695a391331a8405f3c2613" + "reference": "a69d1e8c29c12d7c7d47151ebc58fe96e4301e7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/localheinz/composer-normalize/zipball/506fdf9234447372df695a391331a8405f3c2613", - "reference": "506fdf9234447372df695a391331a8405f3c2613", + "url": "https://api.github.com/repos/localheinz/composer-normalize/zipball/a69d1e8c29c12d7c7d47151ebc58fe96e4301e7a", + "reference": "a69d1e8c29c12d7c7d47151ebc58fe96e4301e7a", "shasum": "" }, "require": { @@ -1185,7 +1231,7 @@ "normalizer", "plugin" ], - "time": "2019-02-15T20:35:52+00:00" + "time": "2019-03-13T14:42:11+00:00" }, { "name": "localheinz/json-normalizer", @@ -1288,6 +1334,59 @@ ], "time": "2018-08-11T23:54:50+00:00" }, + { + "name": "localheinz/phpstan-rules", + "version": "0.7.1", + "source": { + "type": "git", + "url": "https://github.com/localheinz/phpstan-rules.git", + "reference": "fbbd15c097cd76a42d525badfd5342cd3c7d36a5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/localheinz/phpstan-rules/zipball/fbbd15c097cd76a42d525badfd5342cd3c7d36a5", + "reference": "fbbd15c097cd76a42d525badfd5342cd3c7d36a5", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.1.0", + "php": "^7.1", + "phpstan/phpstan": "~0.10.5 || ~0.11.0" + }, + "require-dev": { + "infection/infection": "~0.11.5", + "localheinz/composer-normalize": "^1.1.1", + "localheinz/php-cs-fixer-config": "~1.19.0", + "localheinz/test-util": "~0.7.0", + "phpstan/phpstan-deprecation-rules": "~0.10.2 || ~0.11.0", + "phpstan/phpstan-strict-rules": "~0.10.1 || ~0.11.0", + "phpunit/phpunit": "^7.5.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Localheinz\\PHPStan\\Rules\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andreas Möller", + "email": "am@localheinz.com" + } + ], + "description": "Provides additional rules for phpstan/phpstan.", + "homepage": "https://github.com/localheinz/phpstan-rules", + "keywords": [ + "PHPStan", + "phpstan-extreme-rules", + "phpstan-rules" + ], + "time": "2019-01-17T22:24:11+00:00" + }, { "name": "myclabs/deep-copy", "version": "1.8.1", @@ -2144,6 +2243,54 @@ ], "time": "2018-07-02T15:55:56+00:00" }, + { + "name": "pepakriz/phpstan-exception-rules", + "version": "v0.7.0", + "source": { + "type": "git", + "url": "https://github.com/pepakriz/phpstan-exception-rules.git", + "reference": "b478b965237f350f81d177070ac78e4a80e24d23" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pepakriz/phpstan-exception-rules/zipball/b478b965237f350f81d177070ac78e4a80e24d23", + "reference": "b478b965237f350f81d177070ac78e4a80e24d23", + "shasum": "" + }, + "require": { + "php": "^7.1", + "phpstan/phpstan": "^0.11" + }, + "require-dev": { + "cdn77/coding-standard": "^0.7.1", + "jakub-onderka/php-console-highlighter": "0.3.2", + "jakub-onderka/php-parallel-lint": "1.0.0", + "phpstan/phpstan-nette": "^0.11", + "phpstan/phpstan-phpunit": "^0.11", + "phpstan/phpstan-strict-rules": "^0.11", + "phpunit/phpunit": "^7.1.5", + "satooshi/php-coveralls": "^2.0", + "slevomat/coding-standard": "^4.8.3", + "squizlabs/php_codesniffer": "~3.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.7-dev" + } + }, + "autoload": { + "psr-4": { + "Pepakriz\\PHPStanExceptionRules\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Exception rules for PHPStan", + "time": "2019-02-28T13:32:28+00:00" + }, { "name": "phar-io/manifest", "version": "1.0.3", @@ -2560,16 +2707,16 @@ }, { "name": "phpstan/phpstan", - "version": "0.11.3", + "version": "0.11.4", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "e4644b4a8fd393c346f1137305fb2f76a7dc20a7" + "reference": "ccc4f854748664cc61d1f3d4ecb26810df1f0cd4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e4644b4a8fd393c346f1137305fb2f76a7dc20a7", - "reference": "e4644b4a8fd393c346f1137305fb2f76a7dc20a7", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/ccc4f854748664cc61d1f3d4ecb26810df1f0cd4", + "reference": "ccc4f854748664cc61d1f3d4ecb26810df1f0cd4", "shasum": "" }, "require": { @@ -2629,44 +2776,234 @@ "MIT" ], "description": "PHPStan - PHP Static Analysis Tool", - "time": "2019-03-10T16:25:30+00:00" + "time": "2019-03-14T14:46:15+00:00" + }, + { + "name": "phpstan/phpstan-deprecation-rules", + "version": "0.11", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan-deprecation-rules.git", + "reference": "449fee6223220b337760abca4444801ddcc8b38d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/449fee6223220b337760abca4444801ddcc8b38d", + "reference": "449fee6223220b337760abca4444801ddcc8b38d", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.0", + "php": "~7.1", + "phpstan/phpstan": "^0.11" + }, + "require-dev": { + "consistence/coding-standard": "^3.0.1", + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4", + "jakub-onderka/php-parallel-lint": "^1.0", + "phing/phing": "^2.16.0", + "phpstan/phpstan-phpunit": "^0.11", + "phpunit/phpunit": "^7.0", + "slevomat/coding-standard": "^4.5.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.11-dev" + } + }, + "autoload": { + "psr-4": { + "PHPStan\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan rules for detecting usage of deprecated classes, methods, properties, constants and traits.", + "time": "2018-12-05T18:04:16+00:00" + }, + { + "name": "phpstan/phpstan-php-parser", + "version": "0.11", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan-php-parser.git", + "reference": "a4b9d826f1be3816a82f9a3b0e7572a3b1e18420" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan-php-parser/zipball/a4b9d826f1be3816a82f9a3b0e7572a3b1e18420", + "reference": "a4b9d826f1be3816a82f9a3b0e7572a3b1e18420", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.0", + "php": "~7.1", + "phpstan/phpstan": "^0.11" + }, + "require-dev": { + "consistence/coding-standard": "^3.0.1", + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4", + "jakub-onderka/php-parallel-lint": "^1.0", + "phing/phing": "^2.16.0", + "phpstan/phpstan-phpunit": "^0.11", + "phpstan/phpstan-strict-rules": "^0.11", + "phpunit/phpunit": "^7.0", + "slevomat/coding-standard": "^4.5.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.11-dev" + } + }, + "autoload": { + "psr-4": { + "PHPStan\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHP-Parser extensions for PHPStan", + "time": "2018-11-01T15:58:09+00:00" + }, + { + "name": "phpstan/phpstan-phpunit", + "version": "0.11", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan-phpunit.git", + "reference": "70c22d44b96a21a4952fc13021a5a63cc83f5c81" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/70c22d44b96a21a4952fc13021a5a63cc83f5c81", + "reference": "70c22d44b96a21a4952fc13021a5a63cc83f5c81", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.0", + "php": "~7.1", + "phpstan/phpdoc-parser": "^0.3", + "phpstan/phpstan": "^0.11" + }, + "conflict": { + "phpunit/phpunit": "<7.0" + }, + "require-dev": { + "consistence/coding-standard": "^3.0.1", + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4", + "jakub-onderka/php-parallel-lint": "^1.0", + "phing/phing": "^2.16.0", + "phpstan/phpstan-strict-rules": "^0.11", + "phpunit/phpunit": "^7.0", + "satooshi/php-coveralls": "^1.0", + "slevomat/coding-standard": "^4.5.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.11-dev" + } + }, + "autoload": { + "psr-4": { + "PHPStan\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPUnit extensions and rules for PHPStan", + "time": "2018-12-22T14:05:04+00:00" + }, + { + "name": "phpstan/phpstan-strict-rules", + "version": "0.11", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan-strict-rules.git", + "reference": "747a742b26a35ef4e4ebef5ec4490ad74eebcbc0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/747a742b26a35ef4e4ebef5ec4490ad74eebcbc0", + "reference": "747a742b26a35ef4e4ebef5ec4490ad74eebcbc0", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.0", + "php": "~7.1", + "phpstan/phpstan": "^0.11" + }, + "require-dev": { + "consistence/coding-standard": "^3.0.1", + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4", + "jakub-onderka/php-parallel-lint": "^1.0", + "phing/phing": "^2.16.0", + "phpstan/phpstan-phpunit": "^0.11", + "phpunit/phpunit": "^7.0", + "slevomat/coding-standard": "^4.5.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.11-dev" + } + }, + "autoload": { + "psr-4": { + "PHPStan\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Extra strict and opinionated rules for PHPStan", + "time": "2019-01-14T09:56:55+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "6.1.4", + "version": "7.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d" + "reference": "0317a769a81845c390e19684d9ba25d7f6aa4707" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", - "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/0317a769a81845c390e19684d9ba25d7f6aa4707", + "reference": "0317a769a81845c390e19684d9ba25d7f6aa4707", "shasum": "" }, "require": { "ext-dom": "*", "ext-xmlwriter": "*", - "php": "^7.1", - "phpunit/php-file-iterator": "^2.0", + "php": "^7.2", + "phpunit/php-file-iterator": "^2.0.2", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^3.0", + "phpunit/php-token-stream": "^3.0.1", "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^3.1 || ^4.0", + "sebastian/environment": "^4.1", "sebastian/version": "^2.0.1", "theseer/tokenizer": "^1.1" }, "require-dev": { - "phpunit/phpunit": "^7.0" + "phpunit/phpunit": "^8.0" }, "suggest": { - "ext-xdebug": "^2.6.0" + "ext-xdebug": "^2.6.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "6.1-dev" + "dev-master": "7.0-dev" } }, "autoload": { @@ -2692,7 +3029,7 @@ "testing", "xunit" ], - "time": "2018-10-31T16:06:48+00:00" + "time": "2019-02-26T07:38:26+00:00" }, { "name": "phpunit/php-file-iterator", @@ -2885,16 +3222,16 @@ }, { "name": "phpunit/phpunit", - "version": "7.5.6", + "version": "8.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "09c85e14994df92e5ff1f5ec0b481bdb7d3d3df9" + "reference": "19cbed2120839772c4a00e8b28456b0c77d1a7b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/09c85e14994df92e5ff1f5ec0b481bdb7d3d3df9", - "reference": "09c85e14994df92e5ff1f5ec0b481bdb7d3d3df9", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/19cbed2120839772c4a00e8b28456b0c77d1a7b4", + "reference": "19cbed2120839772c4a00e8b28456b0c77d1a7b4", "shasum": "" }, "require": { @@ -2904,27 +3241,25 @@ "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", + "ext-xmlwriter": "*", "myclabs/deep-copy": "^1.7", "phar-io/manifest": "^1.0.2", "phar-io/version": "^2.0", - "php": "^7.1", + "php": "^7.2", "phpspec/prophecy": "^1.7", - "phpunit/php-code-coverage": "^6.0.7", + "phpunit/php-code-coverage": "^7.0", "phpunit/php-file-iterator": "^2.0.1", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^2.0", + "phpunit/php-timer": "^2.1", "sebastian/comparator": "^3.0", "sebastian/diff": "^3.0", - "sebastian/environment": "^4.0", + "sebastian/environment": "^4.1", "sebastian/exporter": "^3.1", - "sebastian/global-state": "^2.0", + "sebastian/global-state": "^3.0", "sebastian/object-enumerator": "^3.0.3", "sebastian/resource-operations": "^2.0", "sebastian/version": "^2.0.1" }, - "conflict": { - "phpunit/phpunit-mock-objects": "*" - }, "require-dev": { "ext-pdo": "*" }, @@ -2939,7 +3274,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "7.5-dev" + "dev-master": "8.0-dev" } }, "autoload": { @@ -2965,7 +3300,7 @@ "testing", "xunit" ], - "time": "2019-02-18T09:24:50+00:00" + "time": "2019-03-16T07:33:46+00:00" }, { "name": "pimple/pimple", @@ -3540,23 +3875,26 @@ }, { "name": "sebastian/global-state", - "version": "2.0.0", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" + "reference": "edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4", + "reference": "edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4", "shasum": "" }, "require": { - "php": "^7.0" + "php": "^7.2", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "ext-dom": "*", + "phpunit/phpunit": "^8.0" }, "suggest": { "ext-uopz": "*" @@ -3564,7 +3902,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -3587,7 +3925,7 @@ "keywords": [ "global state" ], - "time": "2017-04-27T15:39:26+00:00" + "time": "2019-02-01T05:30:01+00:00" }, { "name": "sebastian/object-enumerator", @@ -4658,6 +4996,232 @@ "homepage": "https://symfony.com", "time": "2019-02-23T15:17:42+00:00" }, + { + "name": "thecodingmachine/phpstan-safe-rule", + "version": "v0.1.3", + "source": { + "type": "git", + "url": "https://github.com/thecodingmachine/phpstan-safe-rule.git", + "reference": "00f4845905feb5240ca62fb799e3c51ba85c9230" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thecodingmachine/phpstan-safe-rule/zipball/00f4845905feb5240ca62fb799e3c51ba85c9230", + "reference": "00f4845905feb5240ca62fb799e3c51ba85c9230", + "shasum": "" + }, + "require": { + "php": "^7.1", + "phpstan/phpstan": "^0.10 | ^0.11", + "thecodingmachine/safe": "^0.1.11" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^7.5.2", + "squizlabs/php_codesniffer": "^3.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.1-dev" + } + }, + "autoload": { + "psr-4": { + "TheCodingMachine\\Safe\\PHPStan\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "David Négrier", + "email": "d.negrier@thecodingmachine.com" + } + ], + "description": "A PHPStan rule to detect safety issues. Must be used in conjunction with thecodingmachine/safe", + "time": "2019-03-07T13:52:42+00:00" + }, + { + "name": "thecodingmachine/phpstan-strict-rules", + "version": "v0.11.0", + "source": { + "type": "git", + "url": "https://github.com/thecodingmachine/phpstan-strict-rules.git", + "reference": "663fad8801b24c666f3c695ca6cbbc1cb28776a9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thecodingmachine/phpstan-strict-rules/zipball/663fad8801b24c666f3c695ca6cbbc1cb28776a9", + "reference": "663fad8801b24c666f3c695ca6cbbc1cb28776a9", + "shasum": "" + }, + "require": { + "php": "^7.1", + "phpstan/phpstan": "^0.10|^0.11" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.10-dev" + } + }, + "autoload": { + "psr-4": { + "TheCodingMachine\\PHPStan\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "David Négrier", + "email": "d.negrier@thecodingmachine.com" + } + ], + "description": "A set of additional rules for PHPStan based on best practices followed at TheCodingMachine", + "time": "2019-01-18T08:10:20+00:00" + }, + { + "name": "thecodingmachine/safe", + "version": "v0.1.14", + "source": { + "type": "git", + "url": "https://github.com/thecodingmachine/safe.git", + "reference": "67b654c7effeda8db27c133e5f0cbb638e90d1e4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thecodingmachine/safe/zipball/67b654c7effeda8db27c133e5f0cbb638e90d1e4", + "reference": "67b654c7effeda8db27c133e5f0cbb638e90d1e4", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "phpstan/phpstan": "^0.10.3", + "squizlabs/php_codesniffer": "^3.2", + "thecodingmachine/phpstan-strict-rules": "^0.10.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.1-dev" + } + }, + "autoload": { + "psr-4": { + "Safe\\": [ + "lib/", + "generated/" + ] + }, + "files": [ + "generated/apache.php", + "generated/apc.php", + "generated/apcu.php", + "generated/array.php", + "generated/bzip2.php", + "generated/classobj.php", + "generated/com.php", + "generated/cubrid.php", + "generated/curl.php", + "generated/datetime.php", + "generated/dir.php", + "generated/eio.php", + "generated/errorfunc.php", + "generated/exec.php", + "generated/fileinfo.php", + "generated/filesystem.php", + "generated/filter.php", + "generated/fpm.php", + "generated/ftp.php", + "generated/funchand.php", + "generated/gmp.php", + "generated/gnupg.php", + "generated/hash.php", + "generated/ibase.php", + "generated/ibmDb2.php", + "generated/iconv.php", + "generated/image.php", + "generated/imap.php", + "generated/info.php", + "generated/ingres-ii.php", + "generated/inotify.php", + "generated/json.php", + "generated/ldap.php", + "generated/libevent.php", + "generated/libxml.php", + "generated/lzf.php", + "generated/mailparse.php", + "generated/mbstring.php", + "generated/misc.php", + "generated/msql.php", + "generated/mssql.php", + "generated/mysql.php", + "generated/mysqli.php", + "generated/mysqlndMs.php", + "generated/mysqlndQc.php", + "generated/network.php", + "generated/oci8.php", + "generated/opcache.php", + "generated/openssl.php", + "generated/outcontrol.php", + "generated/password.php", + "generated/pcntl.php", + "generated/pcre.php", + "generated/pdf.php", + "generated/pgsql.php", + "generated/posix.php", + "generated/ps.php", + "generated/pspell.php", + "generated/readline.php", + "generated/rrd.php", + "generated/sem.php", + "generated/session.php", + "generated/shmop.php", + "generated/simplexml.php", + "generated/sockets.php", + "generated/sodium.php", + "generated/solr.php", + "generated/spl.php", + "generated/sqlsrv.php", + "generated/ssdeep.php", + "generated/ssh2.php", + "generated/stats.php", + "generated/stream.php", + "generated/strings.php", + "generated/swoole.php", + "generated/uodbc.php", + "generated/uopz.php", + "generated/url.php", + "generated/var.php", + "generated/xdiff.php", + "generated/xml.php", + "generated/xmlrpc.php", + "generated/yaml.php", + "generated/yaz.php", + "generated/zip.php", + "generated/zlib.php", + "lib/special_cases.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHP core functions that throw exceptions instead of returning FALSE on error", + "time": "2019-03-07T11:09:21+00:00" + }, { "name": "theseer/tokenizer", "version": "1.1.0", @@ -4792,18 +5356,57 @@ "description": "friendsofphp/php-cs-fixer config", "time": "2019-01-20T17:38:15+00:00" }, + { + "name": "wyrihaximus/phpstan-rules-wrapper", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/WyriHaximus/php-phpstan-rules-wrapper.git", + "reference": "d582a3204b9842514a80cd4a8c55e4a69aae19f5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/WyriHaximus/php-phpstan-rules-wrapper/zipball/d582a3204b9842514a80cd4a8c55e4a69aae19f5", + "reference": "d582a3204b9842514a80cd4a8c55e4a69aae19f5", + "shasum": "" + }, + "require": { + "jangregor/phpstan-prophecy": "^0.3.0", + "localheinz/phpstan-rules": "^0.7.1", + "pepakriz/phpstan-exception-rules": "^0.7.0", + "phpstan/phpstan-deprecation-rules": "^0.11.0", + "phpstan/phpstan-php-parser": "^0.11.0", + "phpstan/phpstan-phpunit": "^0.11.0", + "phpstan/phpstan-strict-rules": "^0.11.0", + "thecodingmachine/phpstan-safe-rule": "^0.1.3", + "thecodingmachine/phpstan-strict-rules": "^0.11.0" + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Cees-Jan Kiewiet", + "email": "ceesjank@gmail.com" + } + ], + "description": "🌯 PHPStan rules wrapper", + "time": "2019-03-16T14:53:23+00:00" + }, { "name": "wyrihaximus/test-utilities", - "version": "1.1.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/WyriHaximus/php-test-utilities.git", - "reference": "2a20ecbf167d0f2c87863d7d8456aa42567e9d34" + "reference": "a399b8578fe49cc0e789361a49a6cb3efa5479cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WyriHaximus/php-test-utilities/zipball/2a20ecbf167d0f2c87863d7d8456aa42567e9d34", - "reference": "2a20ecbf167d0f2c87863d7d8456aa42567e9d34", + "url": "https://api.github.com/repos/WyriHaximus/php-test-utilities/zipball/a399b8578fe49cc0e789361a49a6cb3efa5479cb", + "reference": "a399b8578fe49cc0e789361a49a6cb3efa5479cb", "shasum": "" }, "require": { @@ -4816,8 +5419,9 @@ "nunomaduro/collision": "^2.1", "php": "^7.2", "phpstan/phpstan": "^0.10.7 || ^0.11.0", - "phpunit/phpunit": "^7.5", - "wyrihaximus/cs-fixer-config": "^1.0.1" + "phpunit/phpunit": "^7.5 || ^8.0", + "wyrihaximus/cs-fixer-config": "^1.0.1", + "wyrihaximus/phpstan-rules-wrapper": "^1.0" }, "type": "library", "autoload": { @@ -4836,7 +5440,7 @@ } ], "description": "Test utilities for api-clients packages", - "time": "2019-03-12T16:37:04+00:00" + "time": "2019-03-16T16:09:45+00:00" } ], "packages-dev": [], diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..365473e --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,9 @@ +parameters: + ignoreErrors: + - '#Method [a-zA-Z0-9\\_]+::[a-zA-Z0-9_]+\(\) has parameter \$[a-zA-Z0-9_]+ with a nullable type declaration.#' + - '#Method [a-zA-Z0-9\\_]+::[a-zA-Z0-9_]+\(\) has parameter \$[a-zA-Z0-9_]+ with null as default value.#' + classesAllowedToBeExtended: + - WyriHaximus\AsyncTestUtilities\AsyncTestCase + +includes: + - vendor/wyrihaximus/test-utilities/rules.neon \ No newline at end of file diff --git a/phpunit.xml.dist b/phpunit.xml.dist index a65ee72..d9b3788 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -10,7 +10,4 @@ src/ - - - diff --git a/rules.neon b/rules.neon new file mode 100644 index 0000000..423c9a3 --- /dev/null +++ b/rules.neon @@ -0,0 +1,6 @@ +parameters: + classesAllowedToBeExtended: + - WyriHaximus\AsyncTestUtilities\AsyncTestCase + +includes: + - ../test-utilities/rules.neon \ No newline at end of file diff --git a/src/AsyncTestCase.php b/src/AsyncTestCase.php index 9664814..1b729ea 100644 --- a/src/AsyncTestCase.php +++ b/src/AsyncTestCase.php @@ -12,14 +12,15 @@ abstract class AsyncTestCase extends TestCase { - const DEFAULT_AWAIT_TIMEOUT = 60; + public const DEFAULT_AWAIT_TIMEOUT = 60.0; /** * @param PromiseInterface $promise * @param LoopInterface|null $loop + * @param float|null $timeout * @return mixed */ - protected function await(PromiseInterface $promise, LoopInterface $loop = null, float $timeout = self::DEFAULT_AWAIT_TIMEOUT) + protected function await(PromiseInterface $promise, ?LoopInterface $loop = null, ?float $timeout = self::DEFAULT_AWAIT_TIMEOUT) { if (!($loop instanceof LoopInterface)) { $loop = Factory::create(); @@ -31,9 +32,10 @@ protected function await(PromiseInterface $promise, LoopInterface $loop = null, /** * @param array $promises * @param LoopInterface|null $loop + * @param float|null $timeout * @return array */ - protected function awaitAll(array $promises, LoopInterface $loop = null, float $timeout = self::DEFAULT_AWAIT_TIMEOUT) + protected function awaitAll(array $promises, ?LoopInterface $loop = null, ?float $timeout = self::DEFAULT_AWAIT_TIMEOUT): array { if (!($loop instanceof LoopInterface)) { $loop = Factory::create(); @@ -45,9 +47,10 @@ protected function awaitAll(array $promises, LoopInterface $loop = null, float $ /** * @param array $promises * @param LoopInterface|null $loop + * @param float|null $timeout * @return mixed */ - protected function awaitAny(array $promises, LoopInterface $loop = null, float $timeout = self::DEFAULT_AWAIT_TIMEOUT) + protected function awaitAny(array $promises, ?LoopInterface $loop = null, ?float $timeout = self::DEFAULT_AWAIT_TIMEOUT) { if (!($loop instanceof LoopInterface)) { $loop = Factory::create(); diff --git a/tests/AsyncTestCaseTest.php b/tests/AsyncTestCaseTest.php index 74dd7e4..f9e6d18 100644 --- a/tests/AsyncTestCaseTest.php +++ b/tests/AsyncTestCaseTest.php @@ -12,17 +12,7 @@ final class AsyncTestCaseTest extends AsyncTestCase { - protected function setUp(): void - { - parent::setUp(); - } - - protected function tearDown(): void - { - parent::tearDown(); - } - - public function provideEventLoop() + public function provideEventLoop(): iterable { yield [null]; yield [Factory::create()]; @@ -32,7 +22,7 @@ public function provideEventLoop() /** * @dataProvider provideEventLoop */ - public function testAwait(LoopInterface $loop = null) + public function testAwait(?LoopInterface $loop): void { $value = time(); static::assertSame($value, $this->await(resolve($value), $loop)); @@ -41,7 +31,7 @@ public function testAwait(LoopInterface $loop = null) /** * @dataProvider provideEventLoop */ - public function testAwaitAll(LoopInterface $loop = null) + public function testAwaitAll(?LoopInterface $loop): void { $value = time(); static::assertSame([$value, $value], $this->awaitAll([resolve($value), resolve($value)], $loop)); @@ -50,7 +40,7 @@ public function testAwaitAll(LoopInterface $loop = null) /** * @dataProvider provideEventLoop */ - public function testAwaitAny(LoopInterface $loop = null) + public function testAwaitAny(?LoopInterface $loop): void { $value = time(); static::assertSame($value, $this->awaitAny([resolve($value), resolve($value)], $loop)); @@ -59,7 +49,7 @@ public function testAwaitAny(LoopInterface $loop = null) /** * @dataProvider provideEventLoop */ - public function testAwaitTimeout(LoopInterface $loop = null) + public function testAwaitTimeout(?LoopInterface $loop): void { self::expectException(TimeoutException::class);