shooglypeg / teams
此包最新版本(v0.14)没有可用的许可证信息。
团队名称和数据
v0.14
2022-10-14 22:20 UTC
Requires
- php: ^8.0
- shooglypeg/valueobjects: ^1.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.9
- league/flysystem: ^3.2
- league/flysystem-memory: ^3.1
- nette/php-generator: ^4.0
- phpunit/phpunit: ^9.5
This package is not auto-updated.
Last update: 2024-09-28 08:04:41 UTC
README
用于从规范名称的csv生成代码来模型团队名称的类
- 规范名称
- 可选简短名称
- 潜在错误拼写和不同拼写的列表
- 这个团队是非联赛的吗?
// 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
扩展 Name
所以也可以...
$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');
类是从如下格式的csv生成的。
"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"