public function getCard($index = 0, $failOnNoCardFound = false)
    {
        if (!array_key_exists($index, $this->reel['cards'])) {
            if ($failOnNoCardFound) {
                throw new Exception\NoCardFoundException(sprintf(
                    "Cannot resolve a card value for the '%s' slot. (Perhaps you need to set a '_default' alias for the slot or the card of index 0 is missing from the slot's assigned reel?)",
		    $this->name
                ));
            }
            switch ($this->undefinedCardResolution) {
                case UndefinedCardResolution::NO_CARD_FOUND_EXCEPTION:
                default:
                    throw new Exception\NoCardFoundException(sprintf(
                        "Card of index %d was not found in the slot `%s`.", $index, $this->name
                    ));

                case UndefinedCardResolution::DEFAULT_CARD:
                    return $this->getDefaultCard();

                case UndefinedCardResolution::FALLBACK_CARD:
                    return $this->getFallbackCard();

                case UndefinedCardResolution::BLANK_CARD:
                    return '';

                // End Switch
            }
        }
        return $this->reel['cards'][$index];
    }
public function getCard($index = 0, $failOnNoCardFound = false)
    {
        if (!array_key_exists($index, $this->reel['cards'])) {
            if ($failOnNoCardFound) {
                throw new Exception\NoCardFoundException(sprintf(
                    "Cannot resolve a card value for the '%s' slot. (Perhaps you need to set a '_default' alias for the slot or the card of index 0 is missing from the slot's assigned reel?)",
		    $this->name
                ));
            }
            switch ($this->undefinedCardResolution) {
                case UndefinedCardResolution::NO_CARD_FOUND_EXCEPTION:
                default:
                    throw new Exception\NoCardFoundException(sprintf(
                        "Card of index %d was not found in the slot `%s`.", $index, $this->name
                    ));

                case UndefinedCardResolution::DEFAULT_CARD:
                    return $this->getDefaultCard();

                case UndefinedCardResolution::FALLBACK_CARD:
                    return $this->getFallbackCard();

                case UndefinedCardResolution::BLANK_CARD:
                    return '';

                // End Switch
            }
        }
        return $this->reel['cards'][$index];
    }
public function getCard ( $ index = 0 , $ failOnNoCardFound = false ) { if ( ! array_key_exists ( $ index , $ this -> reel [ 'cards' ] ) ) { if ( $ failOnNoCardFound ) { throw new Exception \ NoCardFoundException ( sprintf ( "Cannot resolve a card value for the '%s' slot. (Perhaps you need to set a '_default' alias for the slot or the card of index 0 is missing from the slot's assigned reel?)" , $ this -> name ) ) ; } switch ( $ this -> undefinedCardResolution ) { case UndefinedCardResolution :: NO_CARD_FOUND_EXCEPTION : default : throw new Exception \ NoCardFoundException ( sprintf ( "Card of index %d was not found in the slot `%s`." , $ index , $ this -> name ) ) ; case UndefinedCardResolution :: DEFAULT_CARD : return $ this -> getDefaultCard ( ) ; case UndefinedCardResolution :: FALLBACK_CARD : return $ this -> getFallbackCard ( ) ; case UndefinedCardResolution :: BLANK_CARD : return '' ; // End Switch } } return $ this -> reel [ 'cards' ] [ $ index ] ; }
Get a value of a card by its index.
If the card does not exist, resolve based on the slot's resolve_undefined setting.

@param  integer $index
@return mixed
@throws SlotMachine\Exception\NoCardFoundException if the key does not exist and
the undefinedCardResolution property is set to NO_CARD_FOUND_EXCEPTION.
Get a value of a card by its index . If the card does not exist resolve based on the slot s resolve_undefined setting .