Show
Ignore:
Timestamp:
02/11/08 17:31:58 (9 months ago)
Author:
mikey
Message:

enhanced filter api

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/experiments/people/mikey/filterAPI/filterAPI.php

    r1334 r1338  
    11<?php 
    2 /** 
    3  * @todo  make PasswordFilter more fluent 
    4  * @todo  remove min length from PasswordFilter constructor (use LengthFilterDecorator instead?) 
    5  * @todo  remove encoding feature from PasswordFilter, use EncodingFilterDecorator instead 
    6  */ 
    7  
    82$filter = stubFilterFactory::forType('integer')->inRange(1, 4)->asRequired(); 
    93$filter = stubFilterFactory::forType('integer')->using(new MyRVEFactory())->inRange(1, 4)->asRequired(); 
     
    137$filter = stubFilterFactory::forType('string')->length(2, 5)->validatedBy(new stubRegexValidator($regex))->defaultsTo('foo'); 
    148 
    15 $password = stubFilterFactory::forType('password', array($rveFactory))->minLength(5)->minDiffChars(3)->nonAllowedValues(array(1, 2, 3))->encodedWith(new stubMd5Encoder()); 
     9$password = stubFilterFactory::forType('password', array($rveFactory))->length(5, null)->minDiffChars(3)->nonAllowedValues(array(1, 2, 3))->encodedWith(new stubMd5Encoder()); 
    1610 
    1711$http = stubFilterFactory::forType('http', array($rveFactory))->checkDNS(true);