src/Evaluators/HandEvaluator.php
/**
    * Validate Cards
    * Used when instantiating different Hands
    * It accepts an array of at least five Cards
    * or a string of at least 5 cards in short values Cards
    * i.e. 'Ac2h3s4d5s'
    * 
    * @param array|string $cards
    */
Validate Cards
Used when instantiating different Hands
It accepts an array of at least five Cards
or a string of at least 5 cards in short values Cards
i.e.

@param array|string $cards
Validate Cards Used when instantiating different Hands It accepts an array of at least five Cards or a string of at least 5 cards in short values Cards i . e . @param array|string $cards
protected function validateCards($cards)
    {
        $this->cards = Card::convertToCards($cards);
        $uniqueCards = array_unique($this->cards);
        if (count($uniqueCards) != count($this->cards)) {
            $duplicateCards = array_diff_assoc($this->cards, $uniqueCards);
            $invalidCards = implode(", ", $duplicateCards); 
            throw new InvalidHandException("Duplicate cards given: $invalidCards");
        }
        if (count($this->cards) < $this->minCards || count($this->cards) > $this->maxCards) {
            throw new InvalidHandException('Need between ' . $this->minCards . ' and ' . $this->maxCards . ' cards to determine hand ranking');
        }
    }
protected function validateCards ( $ cards ) { $ this -> cards = Card :: convertToCards ( $ cards ) ; $ uniqueCards = array_unique ( $ this -> cards ) ; if ( count ( $ uniqueCards ) != count ( $ this -> cards ) ) { $ duplicateCards = array_diff_assoc ( $ this -> cards , $ uniqueCards ) ; $ invalidCards = implode ( " ,  " , $ duplicateCards ) ; throw new InvalidHandException ( " Duplicate cards given:  $ invalidCards " ) ; } if ( count ( $ this -> cards ) < $ this -> minCards || count ( $ this -> cards ) > $ this -> maxCards ) { throw new InvalidHandException ( 'Need between ' . $ this -> minCards . ' and ' . $ this -> maxCards . ' cards to determine hand ranking' ) ; } }
Validate Cards
 Used when instantiating different Hands
 It accepts an array of at least five Cards
 or a string of at least 5 cards in short values Cards
 i.e.
Validate Cards Used when instantiating different Hands It accepts an array of at least five Cards or a string of at least 5 cards in short values Cards i . e .
// Throw error if duplicate cards are given // Uses magic __toString for short card description // Throw error if less than five cards given because at least five are needed to determine hand rank // Up to eight cards are valid because we determine best five cards out of x provided