From 068b6f18aa81b156d404b8c71dbc5eb02013c556 Mon Sep 17 00:00:00 2001 From: Jens True Date: Tue, 1 Aug 2023 11:26:38 +0000 Subject: [PATCH] Refactoring for PHP8.2 --- .gitignore | 4 +- composer.json | 8 +- composer.lock | 989 ++++++------------ phpstan.neon | 4 +- phpunit.xml | 13 +- src/Guard.php | 6 +- src/PairwiseComparison.php | 17 +- .../IteratedTeamDifferencesInnerLayer.php | 4 +- .../TwoPlayerTrueSkillCalculator.php | 2 +- src/TrueSkill/TwoTeamTrueSkillCalculator.php | 8 +- tests/Numerics/BasicMathTest.php | 2 +- tests/Numerics/GaussianDistributionTest.php | 14 +- tests/Numerics/MatrixTest.php | 14 +- tests/TrueSkill/DrawMarginTest.php | 4 +- ...FactorGraphTeamTrueSkillCalculatorTest.php | 2 +- tests/TrueSkill/TrueSkillCalculatorTests.php | 62 +- .../TwoPlayerTrueSkillCalculatorTest.php | 2 +- .../TwoTeamTrueSkillCalculatorTest.php | 2 +- 18 files changed, 375 insertions(+), 782 deletions(-) diff --git a/.gitignore b/.gitignore index 0c44624..e8b5541 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ coverage nbproject .idea +.vscode vendor bin -.phpunit.result.cache \ No newline at end of file +.phpunit.cache +composer.phar \ No newline at end of file diff --git a/composer.json b/composer.json index 7c79cd2..9743f8c 100644 --- a/composer.json +++ b/composer.json @@ -6,10 +6,10 @@ "php": "^8.1" }, "require-dev": { - "phpunit/phpunit": "^9.0", - "rector/rector": "^0.13.7", - "phpstan/phpstan": "^1.8", - "laravel/pint": "^0.2.3" + "phpunit/phpunit": "^10", + "rector/rector": "^0.17", + "phpstan/phpstan": "^1", + "laravel/pint": "^1" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 7ce668a..d5d5f0c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,91 +4,21 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ac8b97bff674024ae19ad228626b465d", + "content-hash": "f51a29d6ec21868ebc22ce4439494ab0", "packages": [], "packages-dev": [ - { - "name": "doctrine/instantiator", - "version": "1.4.1", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc", - "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^9", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^0.16 || ^1", - "phpstan/phpstan": "^1.4", - "phpstan/phpstan-phpunit": "^1", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.22" - }, - "type": "library", - "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": "https://ocramius.github.io/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "constructor", - "instantiate" - ], - "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.1" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", - "type": "tidelift" - } - ], - "time": "2022-03-03T08:28:38+00:00" - }, { "name": "laravel/pint", - "version": "v0.2.3", + "version": "v1.10.5", "source": { "type": "git", "url": "https://github.com/laravel/pint.git", - "reference": "d0829631687c1238abdd660daac3d7218254b65c" + "reference": "a458fb057bfa2f5a09888a8aa349610be807b0c3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/d0829631687c1238abdd660daac3d7218254b65c", - "reference": "d0829631687c1238abdd660daac3d7218254b65c", + "url": "https://api.github.com/repos/laravel/pint/zipball/a458fb057bfa2f5a09888a8aa349610be807b0c3", + "reference": "a458fb057bfa2f5a09888a8aa349610be807b0c3", "shasum": "" }, "require": { @@ -96,16 +26,16 @@ "ext-mbstring": "*", "ext-tokenizer": "*", "ext-xml": "*", - "php": "^8.0" + "php": "^8.1.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.8.0", - "illuminate/view": "^9.17.0", - "laravel-zero/framework": "^9.1.1", - "mockery/mockery": "^1.5.0", - "nunomaduro/larastan": "^2.1.11", - "nunomaduro/termwind": "^1.10.1", - "pestphp/pest": "^1.21.3" + "friendsofphp/php-cs-fixer": "^3.21.1", + "illuminate/view": "^10.5.1", + "laravel-zero/framework": "^10.1.1", + "mockery/mockery": "^1.5.1", + "nunomaduro/larastan": "^2.5.1", + "nunomaduro/termwind": "^1.15.1", + "pestphp/pest": "^2.4.0" }, "bin": [ "builds/pint" @@ -141,20 +71,20 @@ "issues": "https://github.com/laravel/pint/issues", "source": "https://github.com/laravel/pint" }, - "time": "2022-07-04T16:04:06+00:00" + "time": "2023-07-14T10:26:01+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.11.0", + "version": "1.11.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614" + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/14daed4296fae74d9e3201d2c4925d1acb7aa614", - "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", "shasum": "" }, "require": { @@ -192,7 +122,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" }, "funding": [ { @@ -200,20 +130,20 @@ "type": "tidelift" } ], - "time": "2022-03-03T13:19:32+00:00" + "time": "2023-03-08T13:26:56+00:00" }, { "name": "nikic/php-parser", - "version": "v4.14.0", + "version": "v4.16.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1" + "reference": "19526a33fb561ef417e822e85f08a00db4059c17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/34bea19b6e03d8153165d8f30bba4c3be86184c1", - "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/19526a33fb561ef417e822e85f08a00db4059c17", + "reference": "19526a33fb561ef417e822e85f08a00db4059c17", "shasum": "" }, "require": { @@ -254,9 +184,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.14.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.16.0" }, - "time": "2022-05-31T20:59:12+00:00" + "time": "2023-06-25T14:52:30+00:00" }, { "name": "phar-io/manifest", @@ -369,245 +299,18 @@ }, "time": "2022-02-21T01:04:05+00:00" }, - { - "name": "phpdocumentor/reflection-common", - "version": "2.2.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", - "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" - }, - "time": "2020-06-27T09:03:43+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "5.3.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", - "shasum": "" - }, - "require": { - "ext-filter": "*", - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.3", - "webmozart/assert": "^1.9.1" - }, - "require-dev": { - "mockery/mockery": "~1.3.2", - "psalm/phar": "^4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - }, - { - "name": "Jaap van Otterdijk", - "email": "account@ijaap.nl" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" - }, - "time": "2021-10-19T17:43:47+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "1.6.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "77a32518733312af16a44300404e945338981de3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/77a32518733312af16a44300404e945338981de3", - "reference": "77a32518733312af16a44300404e945338981de3", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.0" - }, - "require-dev": { - "ext-tokenizer": "*", - "psalm/phar": "^4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-1.x": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "support": { - "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.1" - }, - "time": "2022-03-15T21:29:03+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "v1.15.0", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.2", - "php": "^7.2 || ~8.0, <8.2", - "phpdocumentor/reflection-docblock": "^5.2", - "sebastian/comparator": "^3.0 || ^4.0", - "sebastian/recursion-context": "^3.0 || ^4.0" - }, - "require-dev": { - "phpspec/phpspec": "^6.0 || ^7.0", - "phpunit/phpunit": "^8.0 || ^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Prophecy\\": "src/Prophecy" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "support": { - "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.15.0" - }, - "time": "2021-12-08T12:19:24+00:00" - }, { "name": "phpstan/phpstan", - "version": "1.8.0", + "version": "1.10.26", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "b7648d4ee9321665acaf112e49da9fd93df8fbd5" + "reference": "5d660cbb7e1b89253a47147ae44044f49832351f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/b7648d4ee9321665acaf112e49da9fd93df8fbd5", - "reference": "b7648d4ee9321665acaf112e49da9fd93df8fbd5", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/5d660cbb7e1b89253a47147ae44044f49832351f", + "reference": "5d660cbb7e1b89253a47147ae44044f49832351f", "shasum": "" }, "require": { @@ -631,9 +334,16 @@ "MIT" ], "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], "support": { + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.8.0" + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" }, "funding": [ { @@ -644,57 +354,53 @@ "url": "https://github.com/phpstan", "type": "github" }, - { - "url": "https://www.patreon.com/phpstan", - "type": "patreon" - }, { "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", "type": "tidelift" } ], - "time": "2022-06-29T08:53:31+00:00" + "time": "2023-07-19T12:44:37+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "9.2.15", + "version": "10.1.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f" + "reference": "db1497ec8dd382e82c962f7abbe0320e4882ee4e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2e9da11878c4202f97915c1cb4bb1ca318a63f5f", - "reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/db1497ec8dd382e82c962f7abbe0320e4882ee4e", + "reference": "db1497ec8dd382e82c962f7abbe0320e4882ee4e", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.13.0", - "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.3", - "phpunit/php-text-template": "^2.0.2", - "sebastian/code-unit-reverse-lookup": "^2.0.2", - "sebastian/complexity": "^2.0", - "sebastian/environment": "^5.1.2", - "sebastian/lines-of-code": "^1.0.3", - "sebastian/version": "^3.0.1", + "nikic/php-parser": "^4.15", + "php": ">=8.1", + "phpunit/php-file-iterator": "^4.0", + "phpunit/php-text-template": "^3.0", + "sebastian/code-unit-reverse-lookup": "^3.0", + "sebastian/complexity": "^3.0", + "sebastian/environment": "^6.0", + "sebastian/lines-of-code": "^2.0", + "sebastian/version": "^4.0", "theseer/tokenizer": "^1.2.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.1" }, "suggest": { - "ext-pcov": "*", - "ext-xdebug": "*" + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "9.2-dev" + "dev-main": "10.1-dev" } }, "autoload": { @@ -722,7 +428,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.15" + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.2" }, "funding": [ { @@ -730,32 +437,32 @@ "type": "github" } ], - "time": "2022-03-07T09:28:20+00:00" + "time": "2023-05-22T09:04:27+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "3.0.6", + "version": "4.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + "reference": "5647d65443818959172645e7ed999217360654b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/5647d65443818959172645e7ed999217360654b6", + "reference": "5647d65443818959172645e7ed999217360654b6", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -782,7 +489,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.0.2" }, "funding": [ { @@ -790,28 +498,28 @@ "type": "github" } ], - "time": "2021-12-02T12:48:52+00:00" + "time": "2023-05-07T09:13:23+00:00" }, { "name": "phpunit/php-invoker", - "version": "3.1.1", + "version": "4.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", + "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { "ext-pcntl": "*", - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "suggest": { "ext-pcntl": "*" @@ -819,7 +527,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -845,7 +553,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-invoker/issues", - "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + "source": "https://github.com/sebastianbergmann/php-invoker/tree/4.0.0" }, "funding": [ { @@ -853,32 +561,32 @@ "type": "github" } ], - "time": "2020-09-28T05:58:55+00:00" + "time": "2023-02-03T06:56:09+00:00" }, { "name": "phpunit/php-text-template", - "version": "2.0.4", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + "reference": "9f3d3709577a527025f55bcf0f7ab8052c8bb37d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/9f3d3709577a527025f55bcf0f7ab8052c8bb37d", + "reference": "9f3d3709577a527025f55bcf0f7ab8052c8bb37d", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -904,7 +612,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.0" }, "funding": [ { @@ -912,32 +620,32 @@ "type": "github" } ], - "time": "2020-10-26T05:33:50+00:00" + "time": "2023-02-03T06:56:46+00:00" }, { "name": "phpunit/php-timer", - "version": "5.0.3", + "version": "6.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/e2a2d67966e740530f4a3343fe2e030ffdc1161d", + "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -963,7 +671,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + "source": "https://github.com/sebastianbergmann/php-timer/tree/6.0.0" }, "funding": [ { @@ -971,24 +679,23 @@ "type": "github" } ], - "time": "2020-10-26T13:16:10+00:00" + "time": "2023-02-03T06:57:52+00:00" }, { "name": "phpunit/phpunit", - "version": "9.5.21", + "version": "10.2.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "0e32b76be457de00e83213528f6bb37e2a38fcb1" + "reference": "1c17815c129f133f3019cc18e8d0c8622e6d9bcd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0e32b76be457de00e83213528f6bb37e2a38fcb1", - "reference": "0e32b76be457de00e83213528f6bb37e2a38fcb1", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/1c17815c129f133f3019cc18e8d0c8622e6d9bcd", + "reference": "1c17815c129f133f3019cc18e8d0c8622e6d9bcd", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.3.1", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", @@ -998,31 +705,26 @@ "myclabs/deep-copy": "^1.10.1", "phar-io/manifest": "^2.0.3", "phar-io/version": "^3.0.2", - "php": ">=7.3", - "phpspec/prophecy": "^1.12.1", - "phpunit/php-code-coverage": "^9.2.13", - "phpunit/php-file-iterator": "^3.0.5", - "phpunit/php-invoker": "^3.1.1", - "phpunit/php-text-template": "^2.0.3", - "phpunit/php-timer": "^5.0.2", - "sebastian/cli-parser": "^1.0.1", - "sebastian/code-unit": "^1.0.6", - "sebastian/comparator": "^4.0.5", - "sebastian/diff": "^4.0.3", - "sebastian/environment": "^5.1.3", - "sebastian/exporter": "^4.0.3", - "sebastian/global-state": "^5.0.1", - "sebastian/object-enumerator": "^4.0.3", - "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^3.0", - "sebastian/version": "^3.0.2" - }, - "require-dev": { - "phpspec/prophecy-phpunit": "^2.0.1" + "php": ">=8.1", + "phpunit/php-code-coverage": "^10.1.1", + "phpunit/php-file-iterator": "^4.0", + "phpunit/php-invoker": "^4.0", + "phpunit/php-text-template": "^3.0", + "phpunit/php-timer": "^6.0", + "sebastian/cli-parser": "^2.0", + "sebastian/code-unit": "^2.0", + "sebastian/comparator": "^5.0", + "sebastian/diff": "^5.0", + "sebastian/environment": "^6.0", + "sebastian/exporter": "^5.0", + "sebastian/global-state": "^6.0", + "sebastian/object-enumerator": "^5.0", + "sebastian/recursion-context": "^5.0", + "sebastian/type": "^4.0", + "sebastian/version": "^4.0" }, "suggest": { - "ext-soap": "*", - "ext-xdebug": "*" + "ext-soap": "To be able to generate mocks based on WSDL files" }, "bin": [ "phpunit" @@ -1030,7 +732,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.5-dev" + "dev-main": "10.2-dev" } }, "autoload": { @@ -1061,7 +763,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.21" + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.2.6" }, "funding": [ { @@ -1071,37 +774,36 @@ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" } ], - "time": "2022-06-19T12:14:25+00:00" + "time": "2023-07-17T12:08:28+00:00" }, { "name": "rector/rector", - "version": "0.13.7", + "version": "0.17.7", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "3574bf6399ae3951e31f3a9481e22ddb2f2f08b2" + "reference": "0e76101aa329911b7fec43106aac5843a978b209" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/3574bf6399ae3951e31f3a9481e22ddb2f2f08b2", - "reference": "3574bf6399ae3951e31f3a9481e22ddb2f2f08b2", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/0e76101aa329911b7fec43106aac5843a978b209", + "reference": "0e76101aa329911b7fec43106aac5843a978b209", "shasum": "" }, "require": { "php": "^7.2|^8.0", - "phpstan/phpstan": "^1.8" + "phpstan/phpstan": "^1.10.26" }, "conflict": { - "phpstan/phpdoc-parser": "<1.6.2", - "rector/rector-cakephp": "*", "rector/rector-doctrine": "*", - "rector/rector-laravel": "*", - "rector/rector-nette": "*", - "rector/rector-phpoffice": "*", + "rector/rector-downgrade-php": "*", "rector/rector-phpunit": "*", - "rector/rector-prefixed": "*", "rector/rector-symfony": "*" }, "bin": [ @@ -1110,7 +812,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "0.13-dev" + "dev-main": "0.15-dev" } }, "autoload": { @@ -1123,9 +825,15 @@ "MIT" ], "description": "Instant Upgrade and Automated Refactoring of any PHP code", + "keywords": [ + "automation", + "dev", + "migration", + "refactoring" + ], "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/0.13.7" + "source": "https://github.com/rectorphp/rector/tree/0.17.7" }, "funding": [ { @@ -1133,32 +841,32 @@ "type": "github" } ], - "time": "2022-06-29T12:00:57+00:00" + "time": "2023-07-23T20:44:23+00:00" }, { "name": "sebastian/cli-parser", - "version": "1.0.1", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/efdc130dbbbb8ef0b545a994fd811725c5282cae", + "reference": "efdc130dbbbb8ef0b545a994fd811725c5282cae", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "2.0-dev" } }, "autoload": { @@ -1181,7 +889,7 @@ "homepage": "https://github.com/sebastianbergmann/cli-parser", "support": { "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" + "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.0" }, "funding": [ { @@ -1189,32 +897,32 @@ "type": "github" } ], - "time": "2020-09-28T06:08:49+00:00" + "time": "2023-02-03T06:58:15+00:00" }, { "name": "sebastian/code-unit", - "version": "1.0.8", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + "reference": "a81fee9eef0b7a76af11d121767abc44c104e503" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/a81fee9eef0b7a76af11d121767abc44c104e503", + "reference": "a81fee9eef0b7a76af11d121767abc44c104e503", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "2.0-dev" } }, "autoload": { @@ -1237,7 +945,7 @@ "homepage": "https://github.com/sebastianbergmann/code-unit", "support": { "issues": "https://github.com/sebastianbergmann/code-unit/issues", - "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + "source": "https://github.com/sebastianbergmann/code-unit/tree/2.0.0" }, "funding": [ { @@ -1245,32 +953,32 @@ "type": "github" } ], - "time": "2020-10-26T13:08:54+00:00" + "time": "2023-02-03T06:58:43+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", - "version": "2.0.3", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", + "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -1292,7 +1000,7 @@ "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", "support": { "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/3.0.0" }, "funding": [ { @@ -1300,34 +1008,36 @@ "type": "github" } ], - "time": "2020-09-28T05:30:19+00:00" + "time": "2023-02-03T06:59:15+00:00" }, { "name": "sebastian/comparator", - "version": "4.0.6", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382" + "reference": "72f01e6586e0caf6af81297897bd112eb7e9627c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/72f01e6586e0caf6af81297897bd112eb7e9627c", + "reference": "72f01e6586e0caf6af81297897bd112eb7e9627c", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/diff": "^4.0", - "sebastian/exporter": "^4.0" + "ext-dom": "*", + "ext-mbstring": "*", + "php": ">=8.1", + "sebastian/diff": "^5.0", + "sebastian/exporter": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -1366,7 +1076,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" + "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.0" }, "funding": [ { @@ -1374,33 +1084,33 @@ "type": "github" } ], - "time": "2020-10-26T15:49:45+00:00" + "time": "2023-02-03T07:07:16+00:00" }, { "name": "sebastian/complexity", - "version": "2.0.2", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + "reference": "e67d240970c9dc7ea7b2123a6d520e334dd61dc6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/e67d240970c9dc7ea7b2123a6d520e334dd61dc6", + "reference": "e67d240970c9dc7ea7b2123a6d520e334dd61dc6", "shasum": "" }, "require": { - "nikic/php-parser": "^4.7", - "php": ">=7.3" + "nikic/php-parser": "^4.10", + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -1423,7 +1133,7 @@ "homepage": "https://github.com/sebastianbergmann/complexity", "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" + "source": "https://github.com/sebastianbergmann/complexity/tree/3.0.0" }, "funding": [ { @@ -1431,33 +1141,33 @@ "type": "github" } ], - "time": "2020-10-26T15:52:27+00:00" + "time": "2023-02-03T06:59:47+00:00" }, { "name": "sebastian/diff", - "version": "4.0.4", + "version": "5.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + "reference": "912dc2fbe3e3c1e7873313cc801b100b6c68c87b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", - "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/912dc2fbe3e3c1e7873313cc801b100b6c68c87b", + "reference": "912dc2fbe3e3c1e7873313cc801b100b6c68c87b", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3", + "phpunit/phpunit": "^10.0", "symfony/process": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -1489,7 +1199,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/5.0.3" }, "funding": [ { @@ -1497,27 +1208,27 @@ "type": "github" } ], - "time": "2020-10-26T13:10:38+00:00" + "time": "2023-05-01T07:48:21+00:00" }, { "name": "sebastian/environment", - "version": "5.1.4", + "version": "6.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7" + "reference": "43c751b41d74f96cbbd4e07b7aec9675651e2951" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/1b5dff7bb151a4db11d49d90e5408e4e938270f7", - "reference": "1b5dff7bb151a4db11d49d90e5408e4e938270f7", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/43c751b41d74f96cbbd4e07b7aec9675651e2951", + "reference": "43c751b41d74f96cbbd4e07b7aec9675651e2951", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "suggest": { "ext-posix": "*" @@ -1525,7 +1236,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -1544,7 +1255,7 @@ } ], "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", + "homepage": "https://github.com/sebastianbergmann/environment", "keywords": [ "Xdebug", "environment", @@ -1552,7 +1263,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.4" + "security": "https://github.com/sebastianbergmann/environment/security/policy", + "source": "https://github.com/sebastianbergmann/environment/tree/6.0.1" }, "funding": [ { @@ -1560,34 +1272,34 @@ "type": "github" } ], - "time": "2022-04-03T09:37:03+00:00" + "time": "2023-04-11T05:39:26+00:00" }, { "name": "sebastian/exporter", - "version": "4.0.4", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9" + "reference": "f3ec4bf931c0b31e5b413f5b4fc970a7d03338c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9", - "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/f3ec4bf931c0b31e5b413f5b4fc970a7d03338c0", + "reference": "f3ec4bf931c0b31e5b413f5b4fc970a7d03338c0", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/recursion-context": "^4.0" + "ext-mbstring": "*", + "php": ">=8.1", + "sebastian/recursion-context": "^5.0" }, "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -1629,7 +1341,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/exporter/tree/5.0.0" }, "funding": [ { @@ -1637,38 +1349,35 @@ "type": "github" } ], - "time": "2021-11-11T14:18:36+00:00" + "time": "2023-02-03T07:06:49+00:00" }, { "name": "sebastian/global-state", - "version": "5.0.5", + "version": "6.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2" + "reference": "7ea9ead78f6d380d2a667864c132c2f7b83055e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/7ea9ead78f6d380d2a667864c132c2f7b83055e4", + "reference": "7ea9ead78f6d380d2a667864c132c2f7b83055e4", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" + "php": ">=8.1", + "sebastian/object-reflector": "^3.0", + "sebastian/recursion-context": "^5.0" }, "require-dev": { "ext-dom": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-uopz": "*" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -1693,7 +1402,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5" + "security": "https://github.com/sebastianbergmann/global-state/security/policy", + "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.1" }, "funding": [ { @@ -1701,33 +1411,33 @@ "type": "github" } ], - "time": "2022-02-14T08:28:10+00:00" + "time": "2023-07-19T07:19:23+00:00" }, { "name": "sebastian/lines-of-code", - "version": "1.0.3", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + "reference": "17c4d940ecafb3d15d2cf916f4108f664e28b130" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/17c4d940ecafb3d15d2cf916f4108f664e28b130", + "reference": "17c4d940ecafb3d15d2cf916f4108f664e28b130", "shasum": "" }, "require": { - "nikic/php-parser": "^4.6", - "php": ">=7.3" + "nikic/php-parser": "^4.10", + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "2.0-dev" } }, "autoload": { @@ -1750,7 +1460,7 @@ "homepage": "https://github.com/sebastianbergmann/lines-of-code", "support": { "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.0" }, "funding": [ { @@ -1758,34 +1468,34 @@ "type": "github" } ], - "time": "2020-11-28T06:42:11+00:00" + "time": "2023-02-03T07:08:02+00:00" }, { "name": "sebastian/object-enumerator", - "version": "4.0.4", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/202d0e344a580d7f7d04b3fafce6933e59dae906", + "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" + "php": ">=8.1", + "sebastian/object-reflector": "^3.0", + "sebastian/recursion-context": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -1807,7 +1517,7 @@ "homepage": "https://github.com/sebastianbergmann/object-enumerator/", "support": { "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/5.0.0" }, "funding": [ { @@ -1815,32 +1525,32 @@ "type": "github" } ], - "time": "2020-10-26T13:12:34+00:00" + "time": "2023-02-03T07:08:32+00:00" }, { "name": "sebastian/object-reflector", - "version": "2.0.4", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + "reference": "24ed13d98130f0e7122df55d06c5c4942a577957" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/24ed13d98130f0e7122df55d06c5c4942a577957", + "reference": "24ed13d98130f0e7122df55d06c5c4942a577957", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -1862,7 +1572,7 @@ "homepage": "https://github.com/sebastianbergmann/object-reflector/", "support": { "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + "source": "https://github.com/sebastianbergmann/object-reflector/tree/3.0.0" }, "funding": [ { @@ -1870,32 +1580,32 @@ "type": "github" } ], - "time": "2020-10-26T13:14:26+00:00" + "time": "2023-02-03T07:06:18+00:00" }, { "name": "sebastian/recursion-context", - "version": "4.0.4", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" + "reference": "05909fb5bc7df4c52992396d0116aed689f93712" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", - "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/05909fb5bc7df4c52992396d0116aed689f93712", + "reference": "05909fb5bc7df4c52992396d0116aed689f93712", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -1922,10 +1632,10 @@ } ], "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/5.0.0" }, "funding": [ { @@ -1933,87 +1643,32 @@ "type": "github" } ], - "time": "2020-10-26T13:17:30+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "support": { - "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T06:45:17+00:00" + "time": "2023-02-03T07:05:40+00:00" }, { "name": "sebastian/type", - "version": "3.0.0", + "version": "4.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "b233b84bc4465aff7b57cf1c4bc75c86d00d6dad" + "reference": "462699a16464c3944eefc02ebdd77882bd3925bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b233b84bc4465aff7b57cf1c4bc75c86d00d6dad", - "reference": "b233b84bc4465aff7b57cf1c4bc75c86d00d6dad", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/462699a16464c3944eefc02ebdd77882bd3925bf", + "reference": "462699a16464c3944eefc02ebdd77882bd3925bf", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "require-dev": { - "phpunit/phpunit": "^9.5" + "phpunit/phpunit": "^10.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -2036,7 +1691,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.0.0" + "source": "https://github.com/sebastianbergmann/type/tree/4.0.0" }, "funding": [ { @@ -2044,29 +1699,29 @@ "type": "github" } ], - "time": "2022-03-15T09:54:48+00:00" + "time": "2023-02-03T07:10:45+00:00" }, { "name": "sebastian/version", - "version": "3.0.2", + "version": "4.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c6c1022351a901512170118436c764e473f6de8c" + "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", - "reference": "c6c1022351a901512170118436c764e473f6de8c", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c51fa83a5d8f43f1402e3f32a005e6262244ef17", + "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -2089,7 +1744,7 @@ "homepage": "https://github.com/sebastianbergmann/version", "support": { "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + "source": "https://github.com/sebastianbergmann/version/tree/4.0.1" }, "funding": [ { @@ -2097,7 +1752,7 @@ "type": "github" } ], - "time": "2020-09-28T06:39:44+00:00" + "time": "2023-02-07T11:34:05+00:00" }, { "name": "theseer/tokenizer", @@ -2148,64 +1803,6 @@ } ], "time": "2021-07-28T10:34:58+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.11.0", - "source": { - "type": "git", - "url": "https://github.com/webmozarts/assert.git", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", - "shasum": "" - }, - "require": { - "ext-ctype": "*", - "php": "^7.2 || ^8.0" - }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<4.6.1 || 4.6.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.13" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10-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" - ], - "support": { - "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.11.0" - }, - "time": "2022-06-03T18:03:27+00:00" } ], "aliases": [], @@ -2217,5 +1814,5 @@ "php": "^8.1" }, "platform-dev": [], - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.3.0" } diff --git a/phpstan.neon b/phpstan.neon index e05e39d..94d7141 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -2,4 +2,6 @@ parameters: level: 6 paths: - src - - tests \ No newline at end of file +# - tests + ignoreErrors: + - '#with no value type specified in iterable type array#' \ No newline at end of file diff --git a/phpunit.xml b/phpunit.xml index 046c3aa..6e336e0 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,13 +1,14 @@ - - - - src/ - - + + ./tests/ + + + src/ + + diff --git a/src/Guard.php b/src/Guard.php index 5438b61..0df3eac 100644 --- a/src/Guard.php +++ b/src/Guard.php @@ -11,21 +11,21 @@ use Exception; */ class Guard { - public static function argumentNotNull($value, $parameterName) + public static function argumentNotNull(mixed $value, string $parameterName): void { if ($value == null) { throw new Exception($parameterName.' can not be null'); } } - public static function argumentIsValidIndex($index, $count, $parameterName) + public static function argumentIsValidIndex(int $index, int $count, string $parameterName): void { if (($index < 0) || ($index >= $count)) { throw new Exception($parameterName.' is an invalid index'); } } - public static function argumentInRangeInclusive($value, $min, $max, $parameterName) + public static function argumentInRangeInclusive(float $value, float $min, float $max, string $parameterName): void { if (($value < $min) || ($value > $max)) { throw new Exception($parameterName.' is not in the valid range ['.$min.', '.$max.']'); diff --git a/src/PairwiseComparison.php b/src/PairwiseComparison.php index bf1738e..e4a98f7 100644 --- a/src/PairwiseComparison.php +++ b/src/PairwiseComparison.php @@ -7,20 +7,11 @@ namespace DNW\Skills; * * @internal The actual values for the enum were chosen so that the also correspond to the multiplier for updates to means. */ -class PairwiseComparison +enum PairwiseComparison: int { - final const WIN = 1; + case WIN = 1; - final const DRAW = 0; + case DRAW = 0; - final const LOSE = -1; - - public static function getRankFromComparison($comparison) - { - return match ($comparison) { - PairwiseComparison::WIN => [1, 2], - PairwiseComparison::LOSE => [2, 1], - default => [1, 1], - }; - } + case LOSE = -1; } diff --git a/src/TrueSkill/Layers/IteratedTeamDifferencesInnerLayer.php b/src/TrueSkill/Layers/IteratedTeamDifferencesInnerLayer.php index f99afc9..6d18a0b 100644 --- a/src/TrueSkill/Layers/IteratedTeamDifferencesInnerLayer.php +++ b/src/TrueSkill/Layers/IteratedTeamDifferencesInnerLayer.php @@ -18,7 +18,7 @@ class IteratedTeamDifferencesInnerLayer extends TrueSkillFactorGraphLayer parent::__construct($parentGraph); } - public function getLocalFactors() + public function getLocalFactors(): array { return array_merge($this->_TeamPerformancesToTeamPerformanceDifferencesLayer->getLocalFactors(), $this->_TeamDifferencesComparisonLayer->getLocalFactors() @@ -36,7 +36,7 @@ class IteratedTeamDifferencesInnerLayer extends TrueSkillFactorGraphLayer $this->_TeamDifferencesComparisonLayer->buildLayer(); } - public function createPriorSchedule() + public function createPriorSchedule(): ScheduleSequence { switch (is_countable($this->getInputVariablesGroups()) ? count($this->getInputVariablesGroups()) : 0) { case 0: diff --git a/src/TrueSkill/TwoPlayerTrueSkillCalculator.php b/src/TrueSkill/TwoPlayerTrueSkillCalculator.php index f4a8a4f..2331420 100644 --- a/src/TrueSkill/TwoPlayerTrueSkillCalculator.php +++ b/src/TrueSkill/TwoPlayerTrueSkillCalculator.php @@ -102,7 +102,7 @@ class TwoPlayerTrueSkillCalculator extends SkillCalculator // non-draw case $v = TruncatedGaussianCorrectionFunctions::vExceedsMarginScaled($meanDelta, $drawMargin, $c); $w = TruncatedGaussianCorrectionFunctions::wExceedsMarginScaled($meanDelta, $drawMargin, $c); - $rankMultiplier = (int) $comparison; + $rankMultiplier = $comparison->value; } else { $v = TruncatedGaussianCorrectionFunctions::vWithinMarginScaled($meanDelta, $drawMargin, $c); $w = TruncatedGaussianCorrectionFunctions::wWithinMarginScaled($meanDelta, $drawMargin, $c); diff --git a/src/TrueSkill/TwoTeamTrueSkillCalculator.php b/src/TrueSkill/TwoTeamTrueSkillCalculator.php index 1af676b..600102e 100644 --- a/src/TrueSkill/TwoTeamTrueSkillCalculator.php +++ b/src/TrueSkill/TwoTeamTrueSkillCalculator.php @@ -27,7 +27,7 @@ class TwoTeamTrueSkillCalculator extends SkillCalculator parent::__construct(SkillCalculatorSupportedOptions::NONE, TeamsRange::exactly(2), PlayersRange::atLeast(1)); } - public function calculateNewRatings(GameInfo $gameInfo, array $teams, array $teamRanks) + public function calculateNewRatings(GameInfo $gameInfo, array $teams, array $teamRanks): RatingContainer { Guard::argumentNotNull($gameInfo, 'gameInfo'); $this->validateTeamCountAndPlayersCountPerTeam($teams); @@ -60,7 +60,7 @@ class TwoTeamTrueSkillCalculator extends SkillCalculator RatingContainer $newPlayerRatings, Team $selfTeam, Team $otherTeam, - $selfToOtherTeamComparison) + PairwiseComparison $selfToOtherTeamComparison): void { $drawMargin = DrawMargin::getDrawMarginFromDrawProbability( $gameInfo->getDrawProbability(), @@ -107,7 +107,7 @@ class TwoTeamTrueSkillCalculator extends SkillCalculator // non-draw case $v = TruncatedGaussianCorrectionFunctions::vExceedsMarginScaled($meanDelta, $drawMargin, $c); $w = TruncatedGaussianCorrectionFunctions::wExceedsMarginScaled($meanDelta, $drawMargin, $c); - $rankMultiplier = (int) $selfToOtherTeamComparison; + $rankMultiplier = $selfToOtherTeamComparison->value; } else { // assume draw $v = TruncatedGaussianCorrectionFunctions::vWithinMarginScaled($meanDelta, $drawMargin, $c); @@ -137,7 +137,7 @@ class TwoTeamTrueSkillCalculator extends SkillCalculator /** * {@inheritdoc} */ - public function calculateMatchQuality(GameInfo $gameInfo, array $teams) + public function calculateMatchQuality(GameInfo $gameInfo, array $teams): float { Guard::argumentNotNull($gameInfo, 'gameInfo'); $this->validateTeamCountAndPlayersCountPerTeam($teams); diff --git a/tests/Numerics/BasicMathTest.php b/tests/Numerics/BasicMathTest.php index 5e9057d..606a130 100644 --- a/tests/Numerics/BasicMathTest.php +++ b/tests/Numerics/BasicMathTest.php @@ -7,7 +7,7 @@ use DNW\Skills\Tests\TestCase; class BasicMathTest extends TestCase { - public function testSquare() + public function testSquare(): void { $this->assertEquals(1, BasicMath::square(1)); $this->assertEquals(1.44, BasicMath::square(1.2)); diff --git a/tests/Numerics/GaussianDistributionTest.php b/tests/Numerics/GaussianDistributionTest.php index a298405..03b28aa 100644 --- a/tests/Numerics/GaussianDistributionTest.php +++ b/tests/Numerics/GaussianDistributionTest.php @@ -10,21 +10,21 @@ class GaussianDistributionTest extends TestCase { const ERROR_TOLERANCE = 0.000001; - public function testCumulativeTo() + public function testCumulativeTo(): void { // Verified with WolframAlpha // (e.g. http://www.wolframalpha.com/input/?i=CDF%5BNormalDistribution%5B0%2C1%5D%2C+0.5%5D ) $this->assertEqualsWithDelta(0.691462, GaussianDistribution::cumulativeTo(0.5), GaussianDistributionTest::ERROR_TOLERANCE); } - public function testAt() + public function testAt(): void { // Verified with WolframAlpha // (e.g. http://www.wolframalpha.com/input/?i=PDF%5BNormalDistribution%5B0%2C1%5D%2C+0.5%5D ) $this->assertEqualsWithDelta(0.352065, GaussianDistribution::at(0.5), GaussianDistributionTest::ERROR_TOLERANCE); } - public function testMultiplication() + public function testMultiplication(): void { // I verified this against the formula at http://www.tina-vision.net/tina-knoppix/tina-memo/2003-003.pdf $standardNormal = new GaussianDistribution(0, 1); @@ -46,7 +46,7 @@ class GaussianDistributionTest extends TestCase $this->assertEqualsWithDelta($expectedSigma, $product2->getStandardDeviation(), GaussianDistributionTest::ERROR_TOLERANCE); } - public function testDivision() + public function testDivision(): void { // Since the multiplication was worked out by hand, we use the same numbers but work backwards $product = new GaussianDistribution(0.2, 3.0 / sqrt(10)); @@ -63,7 +63,7 @@ class GaussianDistributionTest extends TestCase $this->assertEqualsWithDelta(7.0, $product2DividedByM4S5->getStandardDeviation(), GaussianDistributionTest::ERROR_TOLERANCE); } - public function testLogProductNormalization() + public function testLogProductNormalization(): void { // Verified with Ralf Herbrich's F# implementation $standardNormal = new GaussianDistribution(0, 1); @@ -76,7 +76,7 @@ class GaussianDistributionTest extends TestCase $this->assertEqualsWithDelta(-2.5168046699816684, $lpn2, GaussianDistributionTest::ERROR_TOLERANCE); } - public function testLogRatioNormalization() + public function testLogRatioNormalization(): void { // Verified with Ralf Herbrich's F# implementation $m1s2 = new GaussianDistribution(1, 2); @@ -85,7 +85,7 @@ class GaussianDistributionTest extends TestCase $this->assertEqualsWithDelta(2.6157405972171204, $lrn, GaussianDistributionTest::ERROR_TOLERANCE); } - public function testAbsoluteDifference() + public function testAbsoluteDifference(): void { // Verified with Ralf Herbrich's F# implementation $standardNormal = new GaussianDistribution(0, 1); diff --git a/tests/Numerics/MatrixTest.php b/tests/Numerics/MatrixTest.php index cf9edba..447c088 100644 --- a/tests/Numerics/MatrixTest.php +++ b/tests/Numerics/MatrixTest.php @@ -9,7 +9,7 @@ use DNW\Skills\Tests\TestCase; class MatrixTest extends TestCase { - public function testTwoByTwoDeterminant() + public function testTwoByTwoDeterminant(): void { $a = new SquareMatrix(1, 2, 3, 4); @@ -32,7 +32,7 @@ class MatrixTest extends TestCase $this->assertEquals(12 * 21 - 15 * 17, $d->getDeterminant()); } - public function testThreeByThreeDeterminant() + public function testThreeByThreeDeterminant(): void { $a = new SquareMatrix(1, 2, 3, 4, 5, 6, @@ -48,7 +48,7 @@ class MatrixTest extends TestCase $this->assertEquals(-90, $pi->getDeterminant()); } - public function testFourByFourDeterminant() + public function testFourByFourDeterminant(): void { $a = new SquareMatrix(1, 2, 3, 4, 5, 6, 7, 8, @@ -66,7 +66,7 @@ class MatrixTest extends TestCase $this->assertEquals(98, $pi->getDeterminant()); } - public function testEightByEightDeterminant() + public function testEightByEightDeterminant(): void { $a = new SquareMatrix(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, @@ -92,7 +92,7 @@ class MatrixTest extends TestCase $this->assertEquals(1378143, $pi->getDeterminant()); } - public function testEquals() + public function testEquals(): void { $a = new SquareMatrix(1, 2, 3, 4); @@ -130,7 +130,7 @@ class MatrixTest extends TestCase $this->assertTrue($g->equals($h)); } - public function testAdjugate() + public function testAdjugate(): void { // From Wikipedia: http://en.wikipedia.org/wiki/Adjugate_matrix $a = new SquareMatrix(1, 2, @@ -152,7 +152,7 @@ class MatrixTest extends TestCase $this->assertTrue($d->equals($c->getAdjugate())); } - public function testInverse() + public function testInverse(): void { // see http://www.mathwords.com/i/inverse_of_a_matrix.htm $a = new SquareMatrix(4, 3, diff --git a/tests/TrueSkill/DrawMarginTest.php b/tests/TrueSkill/DrawMarginTest.php index d354176..b84a19b 100644 --- a/tests/TrueSkill/DrawMarginTest.php +++ b/tests/TrueSkill/DrawMarginTest.php @@ -9,7 +9,7 @@ class DrawMarginTest extends TestCase { const ERROR_TOLERANCE = 0.000001; - public function testGetDrawMarginFromDrawProbability() + public function testGetDrawMarginFromDrawProbability(): void { $beta = 25.0 / 6.0; // The expected values were compared against Ralf Herbrich's implementation in F# @@ -18,7 +18,7 @@ class DrawMarginTest extends TestCase $this->assertDrawMargin(0.33, $beta, 2.5111010132487492); } - private function assertDrawMargin($drawProbability, $beta, $expected) + private function assertDrawMargin($drawProbability, $beta, $expected): void { $actual = DrawMargin::getDrawMarginFromDrawProbability($drawProbability, $beta); $this->assertEqualsWithDelta($expected, $actual, DrawMarginTest::ERROR_TOLERANCE); diff --git a/tests/TrueSkill/FactorGraphTeamTrueSkillCalculatorTest.php b/tests/TrueSkill/FactorGraphTeamTrueSkillCalculatorTest.php index c5f3bad..6cf795f 100644 --- a/tests/TrueSkill/FactorGraphTeamTrueSkillCalculatorTest.php +++ b/tests/TrueSkill/FactorGraphTeamTrueSkillCalculatorTest.php @@ -7,7 +7,7 @@ use DNW\Skills\TrueSkill\FactorGraphTrueSkillCalculator; class FactorGraphTeamTrueSkillCalculatorTest extends TestCase { - public function testFactorGraphTrueSkillCalculator() + public function testFactorGraphTrueSkillCalculator(): void { $calculator = new FactorGraphTrueSkillCalculator(); diff --git a/tests/TrueSkill/TrueSkillCalculatorTests.php b/tests/TrueSkill/TrueSkillCalculatorTests.php index d51ff8e..9c845b9 100644 --- a/tests/TrueSkill/TrueSkillCalculatorTests.php +++ b/tests/TrueSkill/TrueSkillCalculatorTests.php @@ -18,7 +18,7 @@ class TrueSkillCalculatorTests // These are the roll-up ones - public static function testAllTwoPlayerScenarios(TestCase $testClass, SkillCalculator $calculator) + public static function testAllTwoPlayerScenarios(TestCase $testClass, SkillCalculator $calculator): void { self::twoPlayerTestNotDrawn($testClass, $calculator); self::twoPlayerTestDrawn($testClass, $calculator); @@ -26,7 +26,7 @@ class TrueSkillCalculatorTests self::oneOnOneMassiveUpsetDrawTest($testClass, $calculator); } - public static function testAllTwoTeamScenarios(TestCase $testClass, SkillCalculator $calculator) + public static function testAllTwoTeamScenarios(TestCase $testClass, SkillCalculator $calculator): void { self::oneOnTwoSimpleTest($testClass, $calculator); self::oneOnTwoSomewhatBalanced($testClass, $calculator); @@ -45,7 +45,7 @@ class TrueSkillCalculatorTests self::fourOnFourSimpleTest($testClass, $calculator); } - public static function testAllMultipleTeamScenarios(TestCase $testClass, SkillCalculator $calculator) + public static function testAllMultipleTeamScenarios(TestCase $testClass, SkillCalculator $calculator): void { self::threeTeamsOfOneNotDrawn($testClass, $calculator); self::threeTeamsOfOneDrawn($testClass, $calculator); @@ -57,7 +57,7 @@ class TrueSkillCalculatorTests self::twoOnFourOnTwoWinDraw($testClass, $calculator); } - public static function testPartialPlayScenarios(TestCase $testClass, SkillCalculator $calculator) + public static function testPartialPlayScenarios(TestCase $testClass, SkillCalculator $calculator): void { self::oneOnTwoBalancedPartialPlay($testClass, $calculator); } @@ -76,7 +76,7 @@ class TrueSkillCalculatorTests // Two Player Tests //------------------------------------------------------------------------------ - private static function twoPlayerTestNotDrawn(TestCase $testClass, SkillCalculator $calculator) + private static function twoPlayerTestNotDrawn(TestCase $testClass, SkillCalculator $calculator): void { $player1 = new Player(1); $player2 = new Player(2); @@ -97,7 +97,7 @@ class TrueSkillCalculatorTests self::assertMatchQuality($testClass, 0.447, $calculator->calculateMatchQuality($gameInfo, $teams)); } - private static function twoPlayerTestDrawn(TestCase $testClass, SkillCalculator $calculator) + private static function twoPlayerTestDrawn(TestCase $testClass, SkillCalculator $calculator): void { $player1 = new Player(1); $player2 = new Player(2); @@ -119,7 +119,7 @@ class TrueSkillCalculatorTests self::assertMatchQuality($testClass, 0.447, $calculator->calculateMatchQuality($gameInfo, $teams)); } - private static function twoPlayerChessTestNotDrawn(TestCase $testClass, SkillCalculator $calculator) + private static function twoPlayerChessTestNotDrawn(TestCase $testClass, SkillCalculator $calculator): void { // Inspired by a real bug :-) $player1 = new Player(1); @@ -138,7 +138,7 @@ class TrueSkillCalculatorTests self::assertRating($testClass, 1185.0383099003536, 42.485604606897752, $player2NewRating); } - private static function oneOnOneMassiveUpsetDrawTest(TestCase $testClass, SkillCalculator $calculator) + private static function oneOnOneMassiveUpsetDrawTest(TestCase $testClass, SkillCalculator $calculator): void { $player1 = new Player(1); @@ -167,7 +167,7 @@ class TrueSkillCalculatorTests // Two Team Tests //------------------------------------------------------------------------------ - private static function oneOnTwoSimpleTest(TestCase $testClass, SkillCalculator $calculator) + private static function oneOnTwoSimpleTest(TestCase $testClass, SkillCalculator $calculator): void { $player1 = new Player(1); @@ -200,7 +200,7 @@ class TrueSkillCalculatorTests // Two Team Tests //------------------------------------------------------------------------------ - private static function twoOnTwoSimpleTest(TestCase $testClass, SkillCalculator $calculator) + private static function twoOnTwoSimpleTest(TestCase $testClass, SkillCalculator $calculator): void { $player1 = new Player(1); $player2 = new Player(2); @@ -232,7 +232,7 @@ class TrueSkillCalculatorTests self::assertMatchQuality($testClass, 0.447, $calculator->calculateMatchQuality($gameInfo, $teams)); } - private static function oneOnTwoSomewhatBalanced(TestCase $testClass, SkillCalculator $calculator) + private static function oneOnTwoSomewhatBalanced(TestCase $testClass, SkillCalculator $calculator): void { $player1 = new Player(1); @@ -261,7 +261,7 @@ class TrueSkillCalculatorTests self::assertMatchQuality($testClass, 0.478, $calculator->calculateMatchQuality($gameInfo, $teams)); } - private static function oneOnThreeSimpleTest(TestCase $testClass, SkillCalculator $calculator) + private static function oneOnThreeSimpleTest(TestCase $testClass, SkillCalculator $calculator): void { $player1 = new Player(1); @@ -293,7 +293,7 @@ class TrueSkillCalculatorTests self::assertMatchQuality($testClass, 0.012, $calculator->calculateMatchQuality($gameInfo, $teams)); } - private static function oneOnTwoDrawTest(TestCase $testClass, SkillCalculator $calculator) + private static function oneOnTwoDrawTest(TestCase $testClass, SkillCalculator $calculator): void { $player1 = new Player(1); @@ -322,7 +322,7 @@ class TrueSkillCalculatorTests self::assertMatchQuality($testClass, 0.135, $calculator->calculateMatchQuality($gameInfo, $teams)); } - private static function oneOnThreeDrawTest(TestCase $testClass, SkillCalculator $calculator) + private static function oneOnThreeDrawTest(TestCase $testClass, SkillCalculator $calculator): void { $player1 = new Player(1); @@ -354,7 +354,7 @@ class TrueSkillCalculatorTests self::assertMatchQuality($testClass, 0.012, $calculator->calculateMatchQuality($gameInfo, $teams)); } - private static function oneOnSevenSimpleTest(TestCase $testClass, SkillCalculator $calculator) + private static function oneOnSevenSimpleTest(TestCase $testClass, SkillCalculator $calculator): void { $player1 = new Player(1); @@ -398,7 +398,7 @@ class TrueSkillCalculatorTests self::assertMatchQuality($testClass, 0.000, $calculator->calculateMatchQuality($gameInfo, $teams)); } - private static function threeOnTwoTests(TestCase $testClass, SkillCalculator $calculator) + private static function threeOnTwoTests(TestCase $testClass, SkillCalculator $calculator): void { $player1 = new Player(1); $player2 = new Player(2); @@ -444,7 +444,7 @@ class TrueSkillCalculatorTests self::assertMatchQuality($testClass, 0.254, $calculator->calculateMatchQuality($gameInfo, $teams)); } - private static function twoOnTwoUnbalancedDrawTest(TestCase $testClass, SkillCalculator $calculator) + private static function twoOnTwoUnbalancedDrawTest(TestCase $testClass, SkillCalculator $calculator): void { $player1 = new Player(1); $player2 = new Player(2); @@ -476,7 +476,7 @@ class TrueSkillCalculatorTests self::assertMatchQuality($testClass, 0.214, $calculator->calculateMatchQuality($gameInfo, $teams)); } - private static function twoOnTwoUpsetTest(TestCase $testClass, SkillCalculator $calculator) + private static function twoOnTwoUpsetTest(TestCase $testClass, SkillCalculator $calculator): void { $player1 = new Player(1); $player2 = new Player(2); @@ -508,7 +508,7 @@ class TrueSkillCalculatorTests self::assertMatchQuality($testClass, 0.084, $calculator->calculateMatchQuality($gameInfo, $teams)); } - private static function fourOnFourSimpleTest(TestCase $testClass, SkillCalculator $calculator) + private static function fourOnFourSimpleTest(TestCase $testClass, SkillCalculator $calculator): void { $player1 = new Player(1); $player2 = new Player(2); @@ -553,7 +553,7 @@ class TrueSkillCalculatorTests self::assertMatchQuality($testClass, 0.447, $calculator->calculateMatchQuality($gameInfo, $teams)); } - private static function twoOnTwoDrawTest(TestCase $testClass, SkillCalculator $calculator) + private static function twoOnTwoDrawTest(TestCase $testClass, SkillCalculator $calculator): void { $player1 = new Player(1); $player2 = new Player(2); @@ -585,7 +585,7 @@ class TrueSkillCalculatorTests self::assertMatchQuality($testClass, 0.447, $calculator->calculateMatchQuality($gameInfo, $teams)); } - private static function threeTeamsOfOneNotDrawn(TestCase $testClass, SkillCalculator $calculator) + private static function threeTeamsOfOneNotDrawn(TestCase $testClass, SkillCalculator $calculator): void { $player1 = new Player(1); $player2 = new Player(2); @@ -612,7 +612,7 @@ class TrueSkillCalculatorTests self::assertMatchQuality($testClass, 0.200, $calculator->calculateMatchQuality($gameInfo, $teams)); } - private static function threeTeamsOfOneDrawn(TestCase $testClass, SkillCalculator $calculator) + private static function threeTeamsOfOneDrawn(TestCase $testClass, SkillCalculator $calculator): void { $player1 = new Player(1); $player2 = new Player(2); @@ -639,7 +639,7 @@ class TrueSkillCalculatorTests self::assertMatchQuality($testClass, 0.200, $calculator->calculateMatchQuality($gameInfo, $teams)); } - private static function fourTeamsOfOneNotDrawn(TestCase $testClass, SkillCalculator $calculator) + private static function fourTeamsOfOneNotDrawn(TestCase $testClass, SkillCalculator $calculator): void { $player1 = new Player(1); $player2 = new Player(2); @@ -671,7 +671,7 @@ class TrueSkillCalculatorTests self::assertMatchQuality($testClass, 0.089, $calculator->calculateMatchQuality($gameInfo, $teams)); } - private static function fiveTeamsOfOneNotDrawn(TestCase $testClass, SkillCalculator $calculator) + private static function fiveTeamsOfOneNotDrawn(TestCase $testClass, SkillCalculator $calculator): void { $player1 = new Player(1); $player2 = new Player(2); @@ -707,7 +707,7 @@ class TrueSkillCalculatorTests self::assertMatchQuality($testClass, 0.040, $calculator->calculateMatchQuality($gameInfo, $teams)); } - private static function eightTeamsOfOneDrawn(TestCase $testClass, SkillCalculator $calculator) + private static function eightTeamsOfOneDrawn(TestCase $testClass, SkillCalculator $calculator): void { $player1 = new Player(1); $player2 = new Player(2); @@ -758,7 +758,7 @@ class TrueSkillCalculatorTests self::AssertMatchQuality($testClass, 0.004, $calculator->calculateMatchQuality($gameInfo, $teams)); } - private static function eightTeamsOfOneUpset(TestCase $testClass, SkillCalculator $calculator) + private static function eightTeamsOfOneUpset(TestCase $testClass, SkillCalculator $calculator): void { $player1 = new Player(1); $player2 = new Player(2); @@ -810,7 +810,7 @@ class TrueSkillCalculatorTests self::assertMatchQuality($testClass, 0.000, $calculator->calculateMatchQuality($gameInfo, $teams)); } - private static function sixteenTeamsOfOneNotDrawn(TestCase $testClass, SkillCalculator $calculator) + private static function sixteenTeamsOfOneNotDrawn(TestCase $testClass, SkillCalculator $calculator): void { $player1 = new Player(1); $player2 = new Player(2); @@ -907,7 +907,7 @@ class TrueSkillCalculatorTests self::assertRating($testClass, 9.46054223053080, 5.27581643889032, $player16NewRating); } - private static function twoOnFourOnTwoWinDraw(TestCase $testClass, SkillCalculator $calculator) + private static function twoOnFourOnTwoWinDraw(TestCase $testClass, SkillCalculator $calculator): void { $player1 = new Player(1); $player2 = new Player(2); @@ -956,7 +956,7 @@ class TrueSkillCalculatorTests // Partial Play Tests //------------------------------------------------------------------------------ - private static function oneOnTwoBalancedPartialPlay(TestCase $testClass, SkillCalculator $calculator) + private static function oneOnTwoBalancedPartialPlay(TestCase $testClass, SkillCalculator $calculator): void { $gameInfo = new GameInfo(); @@ -986,13 +986,13 @@ class TrueSkillCalculatorTests self::assertMatchQuality($testClass, 0.44721358745011336, $matchQuality); } - private static function assertRating(TestCase $testClass, $expectedMean, $expectedStandardDeviation, $actual) + private static function assertRating(TestCase $testClass, $expectedMean, $expectedStandardDeviation, $actual): void { $testClass->assertEqualsWithDelta($expectedMean, $actual->getMean(), self::ERROR_TOLERANCE_TRUESKILL); $testClass->assertEqualsWithDelta($expectedStandardDeviation, $actual->getStandardDeviation(), self::ERROR_TOLERANCE_TRUESKILL); } - private static function assertMatchQuality(TestCase $testClass, $expectedMatchQuality, $actualMatchQuality) + private static function assertMatchQuality(TestCase $testClass, $expectedMatchQuality, $actualMatchQuality): void { $testClass->assertEqualsWithDelta($expectedMatchQuality, $actualMatchQuality, self::ERROR_TOLERANCE_MATCH_QUALITY); } diff --git a/tests/TrueSkill/TwoPlayerTrueSkillCalculatorTest.php b/tests/TrueSkill/TwoPlayerTrueSkillCalculatorTest.php index 5e858d7..4e1a962 100644 --- a/tests/TrueSkill/TwoPlayerTrueSkillCalculatorTest.php +++ b/tests/TrueSkill/TwoPlayerTrueSkillCalculatorTest.php @@ -7,7 +7,7 @@ use DNW\Skills\TrueSkill\TwoPlayerTrueSkillCalculator; class TwoPlayerTrueSkillCalculatorTest extends TestCase { - public function testTwoPlayerTrueSkillCalculator() + public function testTwoPlayerTrueSkillCalculator(): void { $calculator = new TwoPlayerTrueSkillCalculator(); diff --git a/tests/TrueSkill/TwoTeamTrueSkillCalculatorTest.php b/tests/TrueSkill/TwoTeamTrueSkillCalculatorTest.php index 86ba7ff..b731cd4 100644 --- a/tests/TrueSkill/TwoTeamTrueSkillCalculatorTest.php +++ b/tests/TrueSkill/TwoTeamTrueSkillCalculatorTest.php @@ -7,7 +7,7 @@ use DNW\Skills\TrueSkill\TwoTeamTrueSkillCalculator; class TwoTeamTrueSkillCalculatorTest extends TestCase { - public function testTwoTeamTrueSkillCalculator() + public function testTwoTeamTrueSkillCalculator(): void { $calculator = new TwoTeamTrueSkillCalculator();