diff --git a/.gitignore b/.gitignore index 54a0eea..e5aa861 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ -.*/ -vendor +vendor/ .*.cache/ -*.phar .phpdoc/ -output/ \ No newline at end of file +output/ +tools/ \ No newline at end of file diff --git a/.phive/phars.xml b/.phive/phars.xml new file mode 100644 index 0000000..ea0555e --- /dev/null +++ b/.phive/phars.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/.woodpecker/test.yml b/.woodpecker/test.yml new file mode 100644 index 0000000..079bce1 --- /dev/null +++ b/.woodpecker/test.yml @@ -0,0 +1,17 @@ +when: + - event: [push, tag] +steps: + - name: requirements + image: composer + commands: + - composer install --no-dev + - name: run + image: php:cli-bookworm + commands: + - php examples/3teams.php + - php examples/basic.php + - name: test + image: composer + commands: + - composer install + - vendor/bin/phpunit tests --no-coverage \ No newline at end of file diff --git a/benchmark/BasicBench.php b/benchmark/BasicBench.php index 57904f4..d250c70 100644 --- a/benchmark/BasicBench.php +++ b/benchmark/BasicBench.php @@ -42,8 +42,8 @@ final class BasicBench $team1 = new Team($p1, $newRatings->getRating($p1)); $team2 = new Team($p2, $newRatings->getRating($p2)); - $newRatings->getRating($p1)->getConservativeRating(); - $newRatings->getRating($p2)->getConservativeRating(); + echo $newRatings->getRating($p1)->getConservativeRating(); + echo $newRatings->getRating($p2)->getConservativeRating(); } } @@ -73,8 +73,8 @@ final class BasicBench $team1 = new Team($p1, $newRatings->getRating($p1)); $team2 = new Team($p2, $newRatings->getRating($p2)); - $newRatings->getRating($p1)->getConservativeRating(); - $newRatings->getRating($p2)->getConservativeRating(); + echo $newRatings->getRating($p1)->getConservativeRating(); + echo $newRatings->getRating($p2)->getConservativeRating(); } } @@ -104,8 +104,8 @@ final class BasicBench $team1 = new Team($p1, $newRatings->getRating($p1)); $team2 = new Team($p2, $newRatings->getRating($p2)); - $newRatings->getRating($p1)->getConservativeRating(); - $newRatings->getRating($p2)->getConservativeRating(); + echo $newRatings->getRating($p1)->getConservativeRating(); + echo $newRatings->getRating($p2)->getConservativeRating(); } } @@ -138,9 +138,9 @@ final class BasicBench $team2 = new Team($p2, $newRatings->getRating($p2)); $team3 = new Team($p3, $newRatings->getRating($p3)); - $newRatings->getRating($p1)->getConservativeRating(); - $newRatings->getRating($p2)->getConservativeRating(); - $newRatings->getRating($p3)->getConservativeRating(); + echo $newRatings->getRating($p1)->getConservativeRating(); + echo $newRatings->getRating($p2)->getConservativeRating(); + echo $newRatings->getRating($p3)->getConservativeRating(); } } } diff --git a/composer.json b/composer.json index 93c20e8..7f1db1f 100644 --- a/composer.json +++ b/composer.json @@ -6,8 +6,6 @@ "php": "^8.4" }, "require-dev": { - "phpstan/phpstan": "^1.0", - "vimeo/psalm": "dev-master", "phpmetrics/phpmetrics": "^3.0-dev", "phpunit/phpunit": "^11.2", "psalm/plugin-phpunit": "^0.18.4", @@ -26,22 +24,22 @@ }, "scripts": { "test": "phpunit", - "document": "phpDocumentor", - "benchmark": "phpbench run --report=default --output=build-artifact", + "document": "tools/phpDocumentor", + "benchmark": "tools/phpbench run --report=default --output=build-artifact", "metrics": "vendor/bin/phpmetrics --config=phpmetrics.yml", "lint": [ - "phplint", - "phpcs", - "phpcbf src/ tests/ benchmark/ examples/", - "phpmd src/,tests/,benchmark/,examples/ text phpmd.ruleset.xml" + "tools/phplint", + "tools/phpcs", + "tools/phpcbf src/ tests/ benchmark/ examples/", + "tools/phpmd src/,tests/,benchmark/,examples/ text phpmd.ruleset.xml" ], "analyze": [ "@analyze-phpstan", "@analyze-psalm", "@analyze-rector" ], - "analyze-phpstan":"vendor/bin/phpstan analyze --error-format=raw", - "analyze-psalm": "vendor/bin/psalm --no-cache --show-info=true", + "analyze-phpstan":"tools/phpstan analyze --error-format=raw", + "analyze-psalm": "tools/psalm --no-cache --show-info=true", "analyze-rector": "vendor/bin/rector --dry-run", "html": [ "pandoc -s README.md -o output/README.html", diff --git a/composer.lock b/composer.lock index 54188fc..d636a93 100644 --- a/composer.lock +++ b/composer.lock @@ -2366,16 +2366,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.12.23", + "version": "1.12.24", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "29201e7a743a6ab36f91394eab51889a82631428" + "reference": "338b92068f58d9f8035b76aed6cf2b9e5624c025" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/29201e7a743a6ab36f91394eab51889a82631428", - "reference": "29201e7a743a6ab36f91394eab51889a82631428", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/338b92068f58d9f8035b76aed6cf2b9e5624c025", + "reference": "338b92068f58d9f8035b76aed6cf2b9e5624c025", "shasum": "" }, "require": { @@ -2420,7 +2420,7 @@ "type": "github" } ], - "time": "2025-03-23T14:57:32+00:00" + "time": "2025-04-16T13:01:53+00:00" }, { "name": "phpunit/php-code-coverage", @@ -2747,16 +2747,16 @@ }, { "name": "phpunit/phpunit", - "version": "11.5.17", + "version": "11.5.18", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "fd2e863a2995cdfd864fb514b5e0b28b09895b5c" + "reference": "fc3e887c7f3f9917e1bf61e523413d753db00a17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fd2e863a2995cdfd864fb514b5e0b28b09895b5c", - "reference": "fd2e863a2995cdfd864fb514b5e0b28b09895b5c", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fc3e887c7f3f9917e1bf61e523413d753db00a17", + "reference": "fc3e887c7f3f9917e1bf61e523413d753db00a17", "shasum": "" }, "require": { @@ -2828,7 +2828,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.17" + "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.18" }, "funding": [ { @@ -2839,12 +2839,20 @@ "url": "https://github.com/sebastianbergmann", "type": "github" }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, { "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", "type": "tidelift" } ], - "time": "2025-04-08T07:59:11+00:00" + "time": "2025-04-22T06:09:49+00:00" }, { "name": "psalm/plugin-phpunit", @@ -5140,12 +5148,12 @@ "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "c65b0f026cd7c5d26587d4a939f3a35be49bd267" + "reference": "9b0b4bd058e178ff6e29ebcf6760d89eb3fe04cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/c65b0f026cd7c5d26587d4a939f3a35be49bd267", - "reference": "c65b0f026cd7c5d26587d4a939f3a35be49bd267", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/9b0b4bd058e178ff6e29ebcf6760d89eb3fe04cf", + "reference": "9b0b4bd058e178ff6e29ebcf6760d89eb3fe04cf", "shasum": "" }, "require": { @@ -5250,7 +5258,7 @@ "issues": "https://github.com/vimeo/psalm/issues", "source": "https://github.com/vimeo/psalm" }, - "time": "2025-04-09T09:51:06+00:00" + "time": "2025-04-21T20:43:58+00:00" }, { "name": "webmozart/assert", diff --git a/src/TrueSkill/Factors/GaussianLikelihoodFactor.php b/src/TrueSkill/Factors/GaussianLikelihoodFactor.php index 16fac28..4530381 100644 --- a/src/TrueSkill/Factors/GaussianLikelihoodFactor.php +++ b/src/TrueSkill/Factors/GaussianLikelihoodFactor.php @@ -32,7 +32,7 @@ final class GaussianLikelihoodFactor extends GaussianFactor public function getLogNormalization(): float { /** - * @var KeyedVariable[]|mixed $vars + * @var KeyedVariable[] $vars */ $vars = $this->getVariables(); /**