2017 © Pedro Peláez
 

library secret-santa

Secret Santa game in PHP

image

guillegf/secret-santa

Secret Santa game in PHP

  • Sunday, November 12, 2017
  • by GuilleGF
  • Repository
  • 2 Watchers
  • 1 Stars
  • 33 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 11 Versions
  • 0 % Grown

The README.md

SecretSantaPHP

Build Status Code Coverage Scrutinizer Code Quality Dependency Status Latest Stable Version Total Downloads License, (*1)

  • Repository: https://github.com/GuilleGF/SecretSantaPHP
  • Version: 1.3.0
  • License: MIT, see LICENSE

Description

Secret Santa game in PHP, (*2)

Installation

Composer is a widely used dependency manager for PHP packages. Is available on Packagist as guillegf/secret-santa and can be installed either by running the composer require command or adding the library to your composer.json. To enable Composer for you project, refer to the project's Getting Started documentation., (*3)

To add this dependency using the command, run the following from within your project directory:, (*4)

composer require guillegf/secret-santa "~1.3"

Alternatively, add the dependency directly to your composer.json file:, (*5)

"require": {
    "guillegf/secret-santa": "~1.3"
}

Usage

In this example in total we add 10 players, 2 singles players, 2 couples (exclusive) and 4 exclusive players., (*6)

The couples and exclusive players never match together., (*7)

<?php
$secretSanta = new SecretSanta();
$secretSanta->addPlayer('Player1', 'player1@email.com')
  ->addPlayer('Player2', 'player2@email.com')
  ->addCouple('Player3', 'player3@email.com', 'Couple3', 'couple3@email.com')
  ->addCouple('Player4', 'player4@email.com', 'Couple4', 'couple4@email.com')
  ->addExclusivePlayers(
      ['Player5', 'player5@email.com'],
      ['Player6', 'player6@email.com'],
      ['Player7', 'player7@email.com'],
      ['Player8', 'player8@email.com']
  );

foreach ($secretSanta->play() as $player) {
     echo ("{$player->name()} ({$player->email()}): {$player->secretSanta()->name()}\n");
}

The above example will output:, (*8)

Player1 (player1@email.com): Player5
Player2 (player2@email.com): Player7
Player3 (player3@email.com): Player2
Couple3 (couple3@email.com): Player8
Player4 (player4@email.com): Player3
Couple4 (couple4@email.com): Player6
Player5 (player5@email.com): Player4
Player6 (player6@email.com): Player1
Player7 (player7@email.com): Couple3
Player8 (player8@email.com): Couple4

License

The SecretSanta is open-sourced software licensed under the MIT license, (*9)

The Versions

12/11 2017

dev-master

9999999-dev https://github.com/GuilleGF/SecretSantaPHP

Secret Santa game in PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Guillermo González

php secret secret santa santa

12/11 2017

1.3.1

1.3.1.0 https://github.com/GuilleGF/SecretSantaPHP

Secret Santa game in PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Guillermo González

php secret secret santa santa

04/11 2017

1.3.0

1.3.0.0 https://github.com/GuilleGF/SecretSantaPHP

Secret Santa game in PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Guillermo González

php secret secret santa santa

03/11 2017

1.2.1

1.2.1.0 https://github.com/GuilleGF/SecretSantaPHP

Secret Santa game in PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Guillermo González

php secret secret santa santa

23/11 2016

1.2.0

1.2.0.0 https://github.com/GuilleGF/SecretSantaPHP

Secret Santa game in PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Guillermo González

php secret secret santa santa

08/11 2016

1.1.1

1.1.1.0 https://github.com/GuilleGF/SecretSantaPHP

Secret Santa game in PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Guillermo González

php secret secret santa santa

08/11 2016

1.1.0

1.1.0.0 https://github.com/GuilleGF/SecretSantaPHP

Secret Santa game in PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Guillermo González

php secret secret santa santa

06/11 2016

1.0.3

1.0.3.0 https://github.com/GuilleGF/SecretSantaPHP

Secret Santa game in PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Guillermo González

php secret secret santa santa

06/11 2016

1.0.1

1.0.1.0 https://github.com/GuilleGF/SecretSantaPHP

Secret Santa game in PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Guillermo González

php secret secret santa santa

06/11 2016

1.0.2

1.0.2.0 https://github.com/GuilleGF/SecretSantaPHP

Secret Santa game in PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Guillermo González

php secret secret santa santa

31/10 2016

1.0.0

1.0.0.0 https://github.com/GuilleGF/SecretSantaPHP

Secret Santa game in PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Guillermo González

php secret secret santa santa