public static function buildKeyValidation(array $options, $name)
    {
        if (!key_exists(Properties::TYPE, $options)) {
            trigger_error($name . ' must have a type');
        }

        switch ($options[Properties::TYPE]) {
            case Types::STR:
            case Types::STRING:
                return new StringValidation($name, $options);
            case Types::INT:
            case Types::INTEGER:
                return new IntegerValidation($name, $options);
            case Types::FLOAT:
                return new FloatValidation($name, $options);
            case Types::BOOLEAN:
                return new BooleanValidation($name, $options);
            case Types::ARRY:
                return new ArrayValidation($name, $options);
            default:
                trigger_error(sprintf('%s is unknown', $options[Properties::TYPE]), E_USER_ERROR);
        }
    }
public static function buildKeyValidation(array $options, $name)
    {
        if (!key_exists(Properties::TYPE, $options)) {
            trigger_error($name . ' must have a type');
        }

        switch ($options[Properties::TYPE]) {
            case Types::STR:
            case Types::STRING:
                return new StringValidation($name, $options);
            case Types::INT:
            case Types::INTEGER:
                return new IntegerValidation($name, $options);
            case Types::FLOAT:
                return new FloatValidation($name, $options);
            case Types::BOOLEAN:
                return new BooleanValidation($name, $options);
            case Types::ARRY:
                return new ArrayValidation($name, $options);
            default:
                trigger_error(sprintf('%s is unknown', $options[Properties::TYPE]), E_USER_ERROR);
        }
    }
public static function buildKeyValidation ( array $ options , $ name ) { if ( ! key_exists ( Properties :: TYPE , $ options ) ) { trigger_error ( $ name . ' must have a type' ) ; } switch ( $ options [ Properties :: TYPE ] ) { case Types :: STR : case Types :: STRING : return new StringValidation ( $ name , $ options ) ; case Types :: INT : case Types :: INTEGER : return new IntegerValidation ( $ name , $ options ) ; case Types :: FLOAT : return new FloatValidation ( $ name , $ options ) ; case Types :: BOOLEAN : return new BooleanValidation ( $ name , $ options ) ; case Types :: ARRY : return new ArrayValidation ( $ name , $ options ) ; default : trigger_error ( sprintf ( '%s is unknown' , $ options [ Properties :: TYPE ] ) , E_USER_ERROR ) ; } }
Builds a KeyValidation

@param array $options
@param string $name
@return \zimtis\arrayvalidation\validations\KeyValidation
Builds a KeyValidation