public function setContext($context)
    {
        $contexts = array(self::CONTEXT_CREDITCARD, self::CONTEXT_TOKEN);
        if (!in_array($context, $contexts)) {
            throw new RuntimeException(
                sprintf("Invalid validation context '%s'", $context)
            );
        }

        $this->context = $context;
    }
public function setContext($context)
    {
        $contexts = array(self::CONTEXT_CREDITCARD, self::CONTEXT_TOKEN);
        if (!in_array($context, $contexts)) {
            throw new RuntimeException(
                sprintf("Invalid validation context '%s'", $context)
            );
        }

        $this->context = $context;
    }
public function setContext ( $ context ) { $ contexts = array ( self :: CONTEXT_CREDITCARD , self :: CONTEXT_TOKEN ) ; if ( ! in_array ( $ context , $ contexts ) ) { throw new RuntimeException ( sprintf ( "Invalid validation context '%s'" , $ context ) ) ; } $ this -> context = $ context ; }
Sets the context that the validator will validate a CreditCard.

@param string $context
@return void
Sets the context that the validator will validate a CreditCard .