/PokerKata

PokerKata

Primary LanguagePHP

PokerKata

Travis status: Build Status

Source: Solveet - Poker kata

Classes

  • Card: simple POPO (Plain Old PHP Object) class that contains the suit and the number of a card.
  • SortedCardSet: class that extends ArrayObject class, that groups the cards. When it is created, it sorts the cards by its number.

Also, there is a class for each combination, that try to match the combination with a SortedCardSet. Every combination extends an abstract class. Some combinations use other combinations to match. For example, the combination TwoPair use combination Pair twice.

The PokerKata class create a SortedCardSet, and iterate over the combinations trying to match.