{"id":13828199,"url":"https://github.com/Heroyt/tournament-generator","last_synced_at":"2025-07-09T05:31:51.561Z","repository":{"id":42568549,"uuid":"197920387","full_name":"Heroyt/tournament-generator","owner":"Heroyt","description":"A set of classes used to create multiple kinds of tournament brackets in PHP","archived":false,"fork":false,"pushed_at":"2023-12-09T13:13:20.000Z","size":2680,"stargazers_count":61,"open_issues_count":6,"forks_count":15,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-18T09:40:36.125Z","etag":null,"topics":["bracket","custom-bracket","games","tournament","tournament-brackets","tournament-generator"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Heroyt.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-07-20T11:19:58.000Z","updated_at":"2024-10-23T07:27:15.000Z","dependencies_parsed_at":"2024-01-18T05:18:48.098Z","dependency_job_id":"c8def179-7fcb-429a-86c6-214cd941cffd","html_url":"https://github.com/Heroyt/tournament-generator","commit_stats":{"total_commits":133,"total_committers":2,"mean_commits":66.5,"dds":0.3984962406015038,"last_synced_commit":"cbe06d2c2c34f30757ead7f13737fb6857c6f561"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Heroyt%2Ftournament-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Heroyt%2Ftournament-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Heroyt%2Ftournament-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Heroyt%2Ftournament-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Heroyt","download_url":"https://codeload.github.com/Heroyt/tournament-generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225486571,"owners_count":17481930,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bracket","custom-bracket","games","tournament","tournament-brackets","tournament-generator"],"created_at":"2024-08-04T09:02:36.206Z","updated_at":"2024-11-20T07:31:41.183Z","avatar_url":"https://github.com/Heroyt.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n\u003cbr\u003e\nTournament Generator\n\u003cbr\u003e\n\u003c/h1\u003e\n\n\u003ch4 align=\"center\"\u003eA set of multiple classes to generate and work with all different kinds of tournament brackets or defining a custom bracket.\u003c/h4\u003e\n\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://packagist.org/packages/heroyt/tournament-generator\"\u003e\u003cimg src=\"https://poser.pugx.org/heroyt/tournament-generator/v/stable\" alt=\"Latest Stable Version\"\u003e\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/heroyt/tournament-generator\"\u003e\u003cimg src=\"https://poser.pugx.org/heroyt/tournament-generator/downloads\" alt=\"Total Downloads\"\u003e\u003c/a\u003e\n\u003ca href=\"https://scrutinizer-ci.com/g/heroyt/tournament-generator/?branch=master\"\u003e\u003cimg src=\"https://scrutinizer-ci.com/g/heroyt/tournament-generator/badges/quality-score.png?b=master\" alt=\"Scrutinizer Code Quality\" data-canonical-src=\"https://scrutinizer-ci.com/g/heroyt/tournament-generator/badges/quality-score.png?b=master\" style=\"max-width:100%;\"\u003e\u003c/a\u003e\n\u003ca href=\"https://scrutinizer-ci.com/g/Heroyt/tournament-generator/build-status/master\"\u003e\u003cimg src=\"https://scrutinizer-ci.com/g/Heroyt/tournament-generator/badges/build.png?b=master\" alt=\"Scrutinizer Build\" data-canonical-src=\"https://scrutinizer-ci.com/g/Heroyt/tournament-generator/badges/build.png?b=master\" style=\"max-width:100%;\"\u003e\u003c/a\u003e\n\u003ca href=\"(https://scrutinizer-ci.com/g/Heroyt/tournament-generator/?branch=master\"\u003e\u003cimg src=\"https://scrutinizer-ci.com/g/Heroyt/tournament-generator/badges/coverage.png?b=master\" alt=\"Code Coverage\" data-canonical-src=\"https://scrutinizer-ci.com/g/heroyt/tournament-generator/badges/quality-score.png?b=master\" style=\"max-width:100%;\"\u003e\u003c/a\u003e\n\u003ca href='https://tournament-generator.readthedocs.io/en/latest/?badge=latest'\u003e\n    \u003cimg src='https://readthedocs.org/projects/tournament-generator/badge/?version=latest' alt='Documentation Status' /\u003e\n\u003c/a\u003e\n\u003cimg src='https://img.shields.io/endpoint?style=flat\u0026url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2FHeroyt%2Ftournament-generator%2Fmaster' alt=\"Mutation testing badge\" /\u003e\n\u003c/p\u003e\n\n[Documentation](https://tournament-generator.readthedocs.io/en/latest/)\n\n[API documentation](https://heroyt.github.io/tournament-generator/)\n\n## Features\n\n- Creating a custom tournament bracket with any number of categories, rounds, groups and teams\n- Defining a multiple different conditions\n- Easily generating Robin-Robin tournaments\n- Generating a tournament using a predefined preset (single elimination, double elimination, 2R2G) with any number of teams\n- Generating brackets with 2 to 4 teams in one game against each other\n- Filling your bracket with results and getting teams table with scores\n\n## Installation\n\n```shell\n$ composer require heroyt/tournament-generator\n```\n\n## Basic Usage\n\n```php\nrequire 'vendor/autoload.php';\n\n// Create a tournament\n$tournament = new TournamentGenerator\\Tournament('Tournament name');\n\n// Set tournament lengths - could be omitted\n$tournament\n\t-\u003esetPlay(7) // SET GAME TIME TO 7 MINUTES\n\t-\u003esetGameWait(2) // SET TIME BETWEEN GAMES TO 2 MINUTES\n\t-\u003esetRoundWait(0); // SET TIME BETWEEN ROUNDS TO 0 MINUTES\n\n// Create a round and a final round\n$round = $tournament-\u003eround(\"First's round's name\");\n$final = $tournament-\u003eround(\"Final's round's name\");\n\n// Create 2 groups for the first round\n$group_1 = $round-\u003egroup('Round 1')\n\t-\u003esetInGame(2) // 2 TEAMS PLAYING AGAINST EACH OTHER\n\t-\u003esetType(TournamentGenerator\\Constants::ROUND_ROBIN); // ROBIN-ROBIN GROUP\n$group_2 = $round-\u003egroup('Round 2')\n\t-\u003esetInGame(2) // 2 TEAMS PLAYING AGAINST EACH OTHER\n\t-\u003esetType(TournamentGenerator\\Constants::ROUND_ROBIN); // ROBIN-ROBIN GROUP\n\n// Create a final group\n$final_group = $final-\u003egroup('Finale')\n\t-\u003esetInGame(2) // 2 TEAMS PLAYING AGAINST EACH OTHER\n\t-\u003esetType(TournamentGenerator\\Constants::ROUND_ROBIN); // ROBIN-ROBIN GROUP\n\n// CREATE 6 TEAMS\nfor ($i=1; $i \u003c= 6; $i++) {\n\t$tournament-\u003eteam('Team '.$i);\n}\n\n// SET PROGRESSIONS FROM GROUP 1 AND 2 TO FINAL GROUP\n$group_1-\u003eprogression($final_group, 0, 2); // PROGRESS 2 BEST WINNING TEAMS\n$group_2-\u003eprogression($final_group, 0, 2); // PROGRESS 2 BEST WINNING TEAMS\n\n// Generate games in the first round\n$round-\u003egenGames();\n// Simulate results (or you can fill it with your own real results)\n$round-\u003esimulate();\n// Progress best teams from first round to final round\n$round-\u003eprogress();\n// Generate games in the final round\n$final-\u003egenGames();\n// Simulate results (or you can fill it with your own real results)\n$final-\u003esimulate();\n\n// GET ALL TEAMS\n$teams = $tournament-\u003egetTeams(true); // TRUE to get teams ordered by their results\n```\n\n### Creating a tournament with a template\n\n```php\nrequire 'vendor/autoload.php';\n\n// Create a tournament\n$tournament = new TournamentGenerator\\Preset\\SingleElimination('Tournament name');\n\n// Set tournament lengths - could be omitted\n$tournament\n\t-\u003esetPlay(7) // SET GAME TIME TO 7 MINUTES\n\t-\u003esetGameWait(2) // SET TIME BETWEEN GAMES TO 2 MINUTES\n\t-\u003esetRoundWait(0); // SET TIME BETWEEN ROUNDS TO 0 MINUTES\n\n// CREATE 6 TEAMS\nfor ($i=1; $i \u003c= 6; $i++) {\n\t$tournament-\u003eteam('Team '.$i);\n}\n\n// GENERATE ALL GAMES\n$tournament-\u003egenerate();\n\n// Simulate games\n$tournament-\u003egenGamesSimulate(); // Simulate only games for example to only save bracket to DB\n$tournament-\u003egenGamesSimulateReal(); // Simulate games with results like a real tournament\n\n// GET ALL TEAMS\n$teams = $tournament-\u003egetTeams(true); // TRUE to get teams ordered by their results\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHeroyt%2Ftournament-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FHeroyt%2Ftournament-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHeroyt%2Ftournament-generator/lists"}