PHPackages                             maartenstaa/glicko2 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. maartenstaa/glicko2

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

maartenstaa/glicko2
===================

PHP implementation of the Glicko-2 rating algorithm

v1.0.0(10y ago)147.4k3[1 issues](https://github.com/MaartenStaa/glicko2/issues)BSD-3-ClausePHPCI failing

Since Aug 13Pushed 10y ago2 watchersCompare

[ Source](https://github.com/MaartenStaa/glicko2)[ Packagist](https://packagist.org/packages/maartenstaa/glicko2)[ RSS](/packages/maartenstaa-glicko2/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Glicko2
=======

[](#glicko2)

PHP implementation of the Glicko-2 rating algorithm. This is a PHP port of [goochjs/glicko2](https://github.com/goochjs/glicko2).

[![Build Status](https://camo.githubusercontent.com/cd28982476219c360685aff6284e6fde18949942f7be9a1225c4717fe7a0c342/68747470733a2f2f7472617669732d63692e6f72672f4d61617274656e537461612f6c61726176656c2d34312d726f7574652d63616368696e672e737667)](https://travis-ci.org/MaartenStaa/glicko2)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/53cc85a9d838ef07093aecf050583702b8893876201e7d9014703c1a9201baff/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4d61617274656e537461612f6c61726176656c2d34312d726f7574652d63616368696e672f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/MaartenStaa/glicko2/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/f7faf2991460ca678bc07b4903b01e1789a416c47f3ca1b787257bfc145753d8/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4d61617274656e537461612f6c61726176656c2d34312d726f7574652d63616368696e672f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/MaartenStaa/glicko2/?branch=master)

Installation
------------

[](#installation)

Using [Composer](http://getcomposer.org/), add the package to your `require` section.

```
{
	"require": {
		"maartenstaa/glicko2": "dev-master"
	}
}
```

Run `composer update` to fetch the new requirement.

Usage
-----

[](#usage)

```
use MaartenStaa\Glicko2\Rating;
use MaartenStaa\Glicko2\RatingCalculator;
use MaartenStaa\Glicko2\RatingPeriodResults;

// Instantiate a RatingCalculator object.
// At instantiation, you can set the default rating for a player's volatility and
// the system constant for your game ("τ", which constrains changes in volatility
// over time) or just accept the defaults.
$calculator = new RatingCalculator(/* $initVolatility, $tau */);

// Instantiate a Rating object for each player.
$player1 = new Rating($calculator/* , $rating, $ratingDeviation, $volatility */);
$player2 = new Rating($calculator/* , $rating, $ratingDeviation, $volatility */);
$player3 = new Rating($calculator/* , $rating, $ratingDeviation, $volatility */);

// Instantiate a RatingPeriodResults object.
$results = new RatingPeriodResults();

// Add game results to the RatingPeriodResults object until you reach the end of your rating period.
// Use addResult($winner, $loser) for games that had an outcome.
$results->addResult($player1, $player2);
// Use addDraw($player1, $player2) for games that resulted in a draw.
$results->addDraw($player1, $player2);
// Use addParticipant($player) to add players that played no games in the rating period.
$results->addParticipant($player3);

// Once you've reached the end of your rating period, call the updateRatings method
// against the RatingCalculator; this takes the RatingPeriodResults object as argument.
//  * Note that the RatingPeriodResults object is cleared down of game results once
//    the new ratings have been calculated.
//  * Participants remain within the RatingPeriodResults object, however, and will
//    have their rating deviations recalculated at the end of future rating periods
//    even if they don't play any games. This is in-line with Glickman's algorithm.
$calculator->updateRatings($results);

// Access the getRating, getRatingDeviation, and getVolatility methods of each
// player's Rating to see the new values.
foreach (array($player1, $player2, $player3) as $index => $player) {
	echo 'Player #', $index, ' values: ', $player->getRating(), ', ',
		$player->getRatingDeviation(), ', ', $player->getVolatility(), PHP_EOL;
}
```

Contributing
------------

[](#contributing)

### Coding standard

[](#coding-standard)

All code is to follow the [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) coding standard.

### Unit tests

[](#unit-tests)

If you find a bug, feel free to send a pull request to fix it, but make sure to always include a regression test.

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3967d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/33e827509a7fa4b6ad18dfacc6cf7e6c1a6cb58b9b61b83787e0940a371ac70c?d=identicon)[MaartenStaa](/maintainers/MaartenStaa)

---

Tags

chessglicko2matchmakingphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/maartenstaa-glicko2/health.svg)

```
[![Health](https://phpackages.com/badges/maartenstaa-glicko2/health.svg)](https://phpackages.com/packages/maartenstaa-glicko2)
```

###  Alternatives

[laravel-admin-ext/config

Config extension for laravel-admin

97182.0k5](/packages/laravel-admin-ext-config)[brick/schema

Schema.org library for PHP

5173.1k1](/packages/brick-schema)[webinarium/php-dictionary

Static dictionary implementation for PHP

1019.2k](/packages/webinarium-php-dictionary)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
