PHPackages                             lindelius/php-fide - 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. lindelius/php-fide

ActiveLibrary

lindelius/php-fide
==================

A zero-dependency PHP implementation of the FIDE Rating System.

1.1(1y ago)5291Apache-2.0PHPPHP ^8.1CI failing

Since May 13Pushed 1y ago2 watchersCompare

[ Source](https://github.com/lindelius/php-fide)[ Packagist](https://packagist.org/packages/lindelius/php-fide)[ Docs](https://github.com/lindelius/php-fide)[ RSS](/packages/lindelius-php-fide/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (5)Dependencies (2)Versions (6)Used By (0)

php-fide
========

[](#php-fide)

[![CircleCI](https://camo.githubusercontent.com/4acc3b8425d35b56215a4ea2409162e157ccc670f4b11954a9b2698c848a9c50/68747470733a2f2f636972636c6563692e636f6d2f67682f6c696e64656c6975732f7068702d666964652e7376673f7374796c653d736869656c64)](https://circleci.com/gh/lindelius/php-fide)

A zero-dependency PHP implementation of the [FIDE Rating System](https://handbook.fide.com).

Requirements
------------

[](#requirements)

- PHP 8.1, or higher

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

[](#installation)

If you are using Composer, you may install the latest version of this library by running the following command from your project's root folder:

```
composer require lindelius/php-fide

```

You may also manually download the library by navigating to the "Releases" page and then expanding the "Assets" section of the latest release.

Usage
-----

[](#usage)

**Step 1.** Implement the [`Lindelius\FIDE\ContestantInterface`](src/ContestantInterface.php) interface in your contestant entity model (the object holding rating information about a given contestant in a given competition).

```
use Lindelius\FIDE\ContestantInterface;

final class MyContestant implements ContestantInterface
{
    private int $highestRating;
    private int $matchesPlayed;
    private int $rating;

    // ...

    public function getCurrentRating(): int
    {
        return $this->rating;
    }

    public function getHighestRating(): int
    {
        return $this->highestRating;
    }

    public function getTotalMatchesPlayed(): int
    {
        return $this->matchesPlayed;
    }
}
```

**Step 2.** Use the appropriate [`Lindelius\FIDE\RatingSystemInterface`](src/RatingSystemInterface.php) method(s) to calculate the new ratings for the contestants after each match. Please note that all available methods return the new rating for the contestant, and not just the rating change.

For matches with a winner, you will want to use the [`calculateRatingAfterWin()`](src/RatingSystemInterface.php#L38) and [`calculateRatingAfterLoss()`](src/RatingSystemInterface.php#L27) methods.

```
$newRatingForWinner = $ratingSystem->calculateRatingAfterWin($winner, $loser);
$newRatingForLoser = $ratingSystem->calculateRatingAfterLoss($loser, $winner);
```

And for matches that end in a draw, you will want to use the [`calculateRatingAfterDraw()`](src/RatingSystemInterface.php#L16) method.

```
$newRatingForContestant = $ratingSystem->calculateRatingAfterDraw($contestant, $opponent);
$newRatingForOpponent = $ratingSystem->calculateRatingAfterDraw($opponent, $contestant);
```

Benchmarking
------------

[](#benchmarking)

This library is using [PHPBench](https://github.com/phpbench/phpbench) for benchmarking.

You can benchmark the library on your own system by running the following command from the library's root folder:

```
./vendor/bin/phpbench run --report=default

```

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 97.7% of commits — single point of failure

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

Every ~686 days

Total

5

Last Release

544d ago

Major Versions

0.3 → 1.02021-02-07

PHP version history (3 changes)0.1PHP ^5.6 || ^7.0

1.0PHP ^7.4||^8.0

1.1PHP ^8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8205651?v=4)[Tom Lindelius](/maintainers/lindelius)[@lindelius](https://github.com/lindelius)

---

Top Contributors

[![lindelius](https://avatars.githubusercontent.com/u/8205651?v=4)](https://github.com/lindelius "lindelius (43 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")

---

Tags

chesselofideratingRatingelochessfide

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lindelius-php-fide/health.svg)

```
[![Health](https://phpackages.com/badges/lindelius-php-fide/health.svg)](https://phpackages.com/packages/lindelius-php-fide)
```

###  Alternatives

[kartik-v/bootstrap-star-rating

A simple yet powerful JQuery star rating plugin for Bootstrap.

1.1k4.5M5](/packages/kartik-v-bootstrap-star-rating)[gabrielbull/ups-api

PHP UPS API

4642.4M10](/packages/gabrielbull-ups-api)[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k302.7k1](/packages/cybercog-laravel-love)[multicaret/laravel-acquaintances

This light package, with no dependencies, gives Eloquent models the ability to manage friendships (with groups), verifications, and interactions such as: Likes, favorites, votes, subscribe, follow, ..etc. And it includes advanced rating system.

851266.9k2](/packages/multicaret-laravel-acquaintances)[willvincent/laravel-rateable

Allows multiple models to be rated with a fivestar like system.

416452.0k3](/packages/willvincent-laravel-rateable)[codebyray/laravel-review-rateable

Review &amp; Rating system for Laravel 10, 11 &amp; 12

310351.9k](/packages/codebyray-laravel-review-rateable)

PHPackages © 2026

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