shooglypeg/teams
最新稳定版本:v0.14
Composer 安装命令:
composer require shooglypeg/teams
包简介
team names and data
README 文档
README
Class to model team names with code generation from a csv of
- canonical name
- optional short name
- list of potential typos and different spellings
- is this team non-league?
// these three are equivalent $name = new TeamName('Airdrieonians'); // Canonical name $short = new TeamName('Airdrie'); // Short name $typo = new TeamName('Airdrie United'); // Out of date might get from an external source $name->short(); // return Airdrie $name = TeamName::random(); // a random team $league = TeamName::league(); // an array of all current league teams $all = TeamName::all(); // an array of all current league teams plus any non-league teams recently in the league
Extends Name so can also...
$name = new TeamName(TeamName::HEART_OF_MIDLOTHIAN); $name->slug(); // heart--of--midlothian $name = new TeamName(TeamName::QUEENS_PARK); $name->slug(); // queen-s--park $name = TeamName::fromSlug('raith--rovers');
Class is generated from a csv like the following.
"Aberdeen",
"Airdrieonians","Airdrie","Airdrie United"
"Albion Rovers","Albion"
"Alloa Athletic","Alloa"
"Annan Athletic","Annan
"Arbroath"
"Ayr United","Ayr","Ayr Utd"
"Bonnyrigg Rose Athletic","Bonnyrigg"
"Berwick Rangers","Berwick","NONLEAGUE"
统计信息
- 总下载量: 22
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2022-07-27