PHPackages                             philicevic/berger - 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. philicevic/berger

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

philicevic/berger
=================

A tool to create round robin tournament matchups using the Berger tables

0.3.0(1y ago)04MITPHPPHP &gt;=8.2CI passing

Since Nov 21Pushed 1y ago1 watchersCompare

[ Source](https://github.com/philicevic/berger)[ Packagist](https://packagist.org/packages/philicevic/berger)[ RSS](/packages/philicevic-berger/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

Berger Tables for PHP
=====================

[](#berger-tables-for-php)

This package allows you to generate round robin tournament matchups based on the [Berger tables](https://en.wikipedia.org/wiki/Round-robin_tournament#Berger_tables).

Usage
-----

[](#usage)

```
use Philicevic\Berger\Services\RoundRobin;

// this creates 6 rounds where teams play each other twice
$teams = ['A', 'B', 'C', 'D'];
$matchesAgainstEachOther = 2;
$rounds = RoundRobin::makeFromTeams($teams, $matchesAgainstEachOther);

// or use it step by step

$teams = ['A', 'B', 'C', 'D'];
$rr = RoundRobin::create();
$rr->setTeams($teams);
$rounds = $rr->make();

```

`$rounds` will be an array of `Round` objects.

### Round

[](#round)

```
foreach ($rounds as $round) {
    // get array of fixtures
    $round->fixtures;

    // get number of round
    $round->number;

    // add fixture to round
    $round->addFixture($fixture);

    // remove fixture from round by index
    $round->removeFixture($index);

    // format round as array
    $round->toArray();
}

// $round->toArray() will return something like this
[
    [
        [
            'home' => 'A',
            'away' => 'C',
            'round' => 1,
        ],
        [
            'home' => 'B',
            'away' => 'D',
            'round' => 1,
        ],
    ],
    [
        [
            'home' => 'C',
            'away' => 'B',
            'round' => 2,
        ],
        [
            'home' => 'D',
            'away' => 'A',
            'round' => 2,
        ],
    ],
    [
        [
            'home' => 'A',
            'away' => 'B',
            'round' => 3,
        ],
        [
            'home' => 'C',
            'away' => 'D',
            'round' => 3,
        ],
    ],
]

```

### Fixture

[](#fixture)

Every fixture has two properties.

```
$fixture->home
$fixture->away

```

Both contain just the name of the team.

You could also access the teams via the `getTeams` method.

```
// returns ["Team A", "Team B"]
$fixture->getTeams()

```

If you want to swap the places of the teams for a fixture you can also do that.

```
$fixture->swapTeams()

```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance47

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~50 days

Total

4

Last Release

389d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ce449a6f84b18c753a6b1a6e6aa03310bc2a07dd766d7d81ed0ce0639163da2d?d=identicon)[philicevic](/maintainers/philicevic)

---

Top Contributors

[![philicevic](https://avatars.githubusercontent.com/u/22521271?v=4)](https://github.com/philicevic "philicevic (11 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/philicevic-berger/health.svg)

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

PHPackages © 2026

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