gift-factory/secret-santa-picker 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

gift-factory/secret-santa-picker

最新稳定版本:1.1.0

Composer 安装命令:

composer require gift-factory/secret-santa-picker

包简介

Pick a random player for each other player of a given group

README 文档

README

Pick a random player for each other player of a given group

Latest Stable Version PHP Version License GitHub Actions StyleCI codecov.io

Install

composer require gift-factory/secret-santa-picker

Use

$players = new PlayerList([
    new Player('Anna'),
    new Player('Bob'),
    // Bob and Dane won't be picked to send a gift to Chuck
    new Player('Chuck', exclusions: ['Bob', 'Dane']),
    new Player('Dane'),
    // Edith and Fiona will be mutually excluded
    [new Player('Edith'), new Player('Fiona')],
]);

$picker = new Picker();
$draw = $picker->pick($players);

foreach ($draw as $donor => $receiver) {
    mail(
        $donor->email,
        'Secret Santa',
        "
            Hello $donor->userName,

            This year, you'll be the santa of $receiver->userName,
            Here is the address where to send your gift:

            $receiver->realName
            $receiver->address
        ",
    );
}

Thanks

And a big thank-you to Jet Brains who provides such a great IDE:

统计信息

  • 总下载量: 4
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-11-17