Changeset 678

Show
Ignore:
Timestamp:
05/27/07 22:46:10 (1 year ago)
Author:
schst
Message:

Tons of whitespace fixes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main/php/info/phing/tasks/stubUnzipTask.php

    r349 r678  
    3232 */ 
    3333class stubUnzipTask extends ExtractBaseTask { 
    34      
     34 
    3535    protected function extractArchive(PhingFile $zipfile) 
    3636    { 
     
    4040            $extractParams['remove_path'] = $this->removepath; 
    4141        } 
    42          
     42 
    4343        $this->log("Extracting zip: " . $zipfile->__toString() . ' to ' . $this->todir->__toString(), PROJECT_MSG_INFO); 
    4444        $targetDir = $this->todir->__toString() . '/' . substr($zipfile->getName(), 0, strrpos($zipfile->getName(), '.')); 
    45          
    46        try { 
    47            $zip = zip_open($zipfile->getAbsolutePath()); 
    48            if (false == $zip) { 
    49                throw new BuildException('Could not open zip file ' . $zipfile->getAbsolutePath()); 
    50            
    51              
     45 
     46        try { 
     47            $zip = zip_open($zipfile->getAbsolutePath()); 
     48            if (false == $zip) { 
     49                throw new BuildException('Could not open zip file ' . $zipfile->getAbsolutePath()); 
     50           
     51 
    5252            while($zipEntry = zip_read($zip)) { 
    5353                $entry    = zip_entry_open($zip, $zipEntry); 
     
    6767        } 
    6868    } 
    69      
     69 
    7070    protected function listArchiveContent(PhingFile $zipfile) 
    7171    { 
  • trunk/src/main/php/net/stubbles/ipo/request/filters/stubAbstractStringFilter.php

    r151 r678  
    22/** 
    33 * Base class for filtering strings. 
    4  *  
     4 * 
    55 * @author      Frank Kleine <mikey@stubbles.net> 
    66 * @package     stubbles 
     
    1010/** 
    1111 * Base class for filtering strings. 
    12  *  
    13  * This is a base class for string filtering. It provides methods to check the  
    14  * minimum and maximum length of a string using validators, but both are  
     12 * 
     13 * This is a base class for string filtering. It provides methods to check the 
     14 * minimum and maximum length of a string using validators, but both are 
    1515 * optional checks. 
    1616 * 
     
    3333     */ 
    3434    protected $maxLength = null; 
    35      
    36    /** 
    37     * set a min length validator 
    38    
    39     * @param  stubValidator  $minLength 
    40     */ 
    41    public function setMinLengthValidator(stubValidator $minLength) 
    42    
    43        $this->minLength = $minLength; 
    44    
    45      
    46    /** 
    47     * set a max length validator 
    48    
    49     * @param  stubValidator  $maxLength 
    50     */ 
    51    public function setMaxLengthValidator(stubValidator $maxLength) 
    52    
    53        $this->maxLength = $maxLength; 
    54    
     35 
     36    /** 
     37    * set a min length validator 
     38   
     39    * @param  stubValidator  $minLength 
     40    */ 
     41    public function setMinLengthValidator(stubValidator $minLength) 
     42   
     43        $this->minLength = $minLength; 
     44   
     45 
     46    /** 
     47    * set a max length validator 
     48   
     49    * @param  stubValidator  $maxLength 
     50    */ 
     51    public function setMaxLengthValidator(stubValidator $maxLength) 
     52   
     53        $this->maxLength = $maxLength; 
     54   
    5555 
    5656    /** 
     
    6363    public function execute($value) 
    6464    { 
    65        $value = $this->doExecute($value); 
    66          
     65        $value = $this->doExecute($value); 
     66 
    6767        // if input length is zero but input is required 
    68        if ((null == $value || strlen($value) == 0) && true == $this->isRequired) { 
     68        if ((null == $value || strlen($value) == 0) && true == $this->isRequired) { 
    6969            throw new stubFilterException($this->rveFactory->create('FIELD_EMPTY')); 
    7070        // if input is shorter than maximal allowed length 
     
    7575            throw new stubFilterException($this->rveFactory->create('STRING_TOO_LONG')->setValues($this->maxLength->getCriteria())); 
    7676        } 
    77          
     77 
    7878        return $value; 
    7979    } 
    80      
     80 
    8181    /** 
    8282     * specialized filtering 
  • trunk/src/main/php/net/stubbles/ipo/request/filters/stubIntegerFilter.php

    r151 r678  
    22/** 
    33 * Basic class for filters on request variables of type integer. 
    4  *  
     4 * 
    55 * @author      Frank Kleine <mikey@stubbles.net> 
    66 * @package     stubbles 
     
    1010/** 
    1111 * Basic class for filters on request variables of type integer. 
    12  *  
    13  * This filter takes any value, casts it to int and checks if it complies  
     12 * 
     13 * This filter takes any value, casts it to int and checks if it complies 
    1414 * with the min and/or the max validator. 
    1515 * 
     
    2727     * @param  stubValidator                 $max  validator for maximum values 
    2828     */ 
    29    public function __construct(stubRequestValueErrorFactory $rveFactory, stubValidator $min = null, stubValidator $max = null) 
    30    
    31        parent::__construct($rveFactory, $min, $max); 
    32    
     29    public function __construct(stubRequestValueErrorFactory $rveFactory, stubValidator $min = null, stubValidator $max = null) 
     30   
     31        parent::__construct($rveFactory, $min, $max); 
     32   
    3333 
    3434    /** 
     
    3939     * @throws  stubFilterException  in case $value has errors 
    4040     */ 
    41    function execute($value) 
    42    
    43        if ((strlen($value) > 0 && true == $this->isRequired) || false == $this->isRequired || false === $value) { 
     41    function execute($value) 
     42   
     43        if ((strlen($value) > 0 && true == $this->isRequired) || false == $this->isRequired || false === $value) { 
    4444            settype($value, 'integer'); 
    45        } 
    46          
     45        } 
     46 
    4747        return parent::doExecute($value); 
    48    
     48   
    4949} 
    5050?> 
  • trunk/src/main/php/net/stubbles/ipo/request/filters/stubMailFilter.php

    r337 r678  
    22/** 
    33 * Class for filtering mail addresses. 
    4  *  
     4 * 
    55 * @author      Frank Kleine <mikey@stubbles.net> 
    66 * @package     stubbles 
     
    2323     */ 
    2424    protected $mailValidator; 
    25      
     25 
    2626    /** 
    2727     * constructor 
    28      *  
     28     * 
    2929     * @param  stubRequestValueErrorFactory  $rveFactory    factory to create stubRequestValueErrors 
    3030     * @param  stubValidator                 $mailValidator  validator to check the mail address 
    3131     */ 
    32    public function __construct(stubRequestValueErrorFactory $rveFactory, stubValidator $mailValidator) 
    33    
    34        $this->rveFactory    = $rveFactory; 
    35        $this->mailValidator = $mailValidator; 
    36    
     32    public function __construct(stubRequestValueErrorFactory $rveFactory, stubValidator $mailValidator) 
     33   
     34        $this->rveFactory    = $rveFactory; 
     35        $this->mailValidator = $mailValidator; 
     36   
    3737 
    3838    /** 
     
    4848            throw new stubFilterException($this->rveFactory->create('MAILADDRESS_INCORRECT')); 
    4949        } 
    50          
     50 
    5151        return $value; 
    5252    } 
  • trunk/src/main/php/net/stubbles/ipo/request/filters/stubNumberFilter.php

    r151 r678  
    22/** 
    33 * Basic class for filters on variables of type number. 
    4  *  
     4 * 
    55 * @author      Frank Kleine <mikey@stubbles.net> 
    66 * @package     stubbles 
     
    1313/** 
    1414 * Basic class for filters on variables of type number. 
    15  *  
    16  * This filter takes any value, casts it to float and checks if it complies  
     15 * 
     16 * This filter takes any value, casts it to float and checks if it complies 
    1717 * with the min and/or the max validator. 
    1818 * 
     
    3535     */ 
    3636    protected $maxValidator = null; 
    37      
     37 
    3838    /** 
    3939     * constructor 
     
    4343     * @param  stubValidator                 $max  validator for maximum values 
    4444     */ 
    45    public function __construct(stubRequestValueErrorFactory $rveFactory, stubValidator $min = null, stubValidator $max = null) 
    46    
    47        $this->rveFactory   = $rveFactory; 
    48        $this->minValidator = $min; 
    49        $this->maxValidator = $max; 
    50    
    51      
     45    public function __construct(stubRequestValueErrorFactory $rveFactory, stubValidator $min = null, stubValidator $max = null) 
     46   
     47        $this->rveFactory   = $rveFactory; 
     48        $this->minValidator = $min; 
     49        $this->maxValidator = $max; 
     50   
     51 
    5252    /** 
    5353     * checks if given value exceeds borders 
     
    5757     * @throws  stubFilterException  in case $value has errors 
    5858     */ 
    59    public function execute($value) 
    60    
    61        settype($value, 'float'); 
     59    public function execute($value) 
     60   
     61        settype($value, 'float'); 
    6262        return $this->doExecute($value); 
    63    
    64      
    65    /** 
     63   
     64 
     65    /** 
    6666     * checks if given value exceeds borders 
    6767     * 
     
    7070     * @throws  stubFilterException  in case $value has errors 
    7171     */ 
    72    protected function doExecute($value) 
    73    
     72    protected function doExecute($value) 
     73   
    7474        if ((null === $value || strlen($value) == 0) && true == $this->isRequired) { 
    75            // add error message if there is no input and input is needed 
     75            // add error message if there is no input and input is needed 
    7676            throw new stubFilterException($this->rveFactory->create('FIELD_EMPTY')); 
    7777        } elseif (null !== $value && null != $this->minValidator && $this->minValidator->validate($value) != true) { 
    78            // add error message if input is smaller than minimum value 
     78             // add error message if input is smaller than minimum value 
    7979            throw new stubFilterException($this->rveFactory->create('VALUE_TOO_SMALL')->setValues($this->minValidator->getCriteria())); 
    8080        } elseif (null !== $value && null != $this->maxValidator && $this->maxValidator->validate($value) != true) { 
    81            // add error message if input is greater than maximum value 
     81            // add error message if input is greater than maximum value 
    8282            throw new stubFilterException($this->rveFactory->create('VALUE_TOO_GREAT')->setValues($this->maxValidator->getCriteria())); 
    8383        } 
    84          
     84 
    8585        return $value; 
    86    
     86   
    8787} 
    8888?> 
  • trunk/src/main/php/net/stubbles/ipo/request/filters/stubPassThruFilter.php

    r410 r678  
    22/** 
    33 * Filter that filters nothing. 
    4  *  
     4 * 
    55 * Use this filter only when you know what you are doing. 
    6  *  
     6 * 
    77 * @author      Frank Kleine <mikey@stubbles.net> 
    88 * @package     stubbles 
     
    1212/** 
    1313 * Filter that filters nothing. 
    14  *  
     14 * 
    1515 * Use this filter only when you know what you are doing. 
    1616 * 
     
    2222    /** 
    2323     * constructor 
    24      *  
     24     * 
    2525     * @param  stubRequestValueErrorFactory  $rveFactory  factory to create stubRequestValueErrors 
    2626     */ 
    27    public function __construct(stubRequestValueErrorFactory $rveFactory) 
    28    
    29        $this->rveFactory = $rveFactory; 
    30    
     27    public function __construct(stubRequestValueErrorFactory $rveFactory) 
     28   
     29        $this->rveFactory = $rveFactory; 
     30   
    3131 
    3232    /** 
     
    4242            throw new stubFilterException($this->rveFactory->create('FIELD_EMPTY')); 
    4343        } 
    44          
     44 
    4545        return $value; 
    4646    } 
  • trunk/src/main/php/net/stubbles/ipo/request/filters/stubPasswordFilter.php

    r151 r678  
    22/** 
    33 * Class for filtering passwords. 
    4  *  
     4 * 
    55 * @author      Frank Kleine <mikey@stubbles.net> 
    66 * @package     stubbles 
     
    1010/** 
    1111 * Class for filtering passwords. 
    12  *  
    13  * This filter allows to check password inputs and if they comply with the rules  
     12 * 
     13 * This filter allows to check password inputs and if they comply with the rules 
    1414 * for a password. A minimum length validator can check the length of the password. 
    15  * Additionally its possible to check against a list of non-allowed passwords  
     15 * Additionally its possible to check against a list of non-allowed passwords 
    1616 * (e.g. the username or the login name). The returned value is a md5- 
    1717 * representation of the password. 
    1818 * If the value is an array the fields with key 0 and 1 are compared. If they are 
    19  * not equal the password is not allowed (can be used to prevent mistyped  
     19 * not equal the password is not allowed (can be used to prevent mistyped 
    2020 * passwords in register or password change forms). 
    2121 * 
     
    3838     */ 
    3939    protected $nonAllowedValues = array(); 
    40      
     40 
    4141    /** 
    4242     * constructor 
    43      *  
     43     * 
    4444     * @param  stubRequestValueErrorFactory  $rveFactory  factory to create stubRequestValueErrors 
    4545     * @param  stubValidator                 $minLength   validator to checking the minimum length 
    4646     */ 
    47    public function __construct(stubRequestValueErrorFactory $rveFactory, stubValidator $minLength) 
    48    
    49        $this->rveFactory = $rveFactory; 
    50        $this->minLength  = $minLength; 
    51    
    52      
    53    /** 
    54     * set a list of values that are not allowed as password 
    55    
    56     * @param  array  $values  list of values that are not allowed as password 
    57     */ 
    58    public function setNonAllowedValues(array $values) 
    59    
    60        $this->nonAllowedValues = $values; 
    61    
     47    public function __construct(stubRequestValueErrorFactory $rveFactory, stubValidator $minLength) 
     48   
     49        $this->rveFactory = $rveFactory; 
     50        $this->minLength  = $minLength; 
     51   
     52 
     53    /** 
     54    * set a list of values that are not allowed as password 
     55   
     56    * @param  array  $values  list of values that are not allowed as password 
     57    */ 
     58    public function setNonAllowedValues(array $values) 
     59   
     60        $this->nonAllowedValues = $values; 
     61   
    6262 
    6363    /** 
     
    7474                throw new stubFilterException($this->rveFactory->create('PASSWORDS_NOT_EQUAL')); 
    7575            } 
    76              
     76 
    7777            $value = $value[0]; 
    7878        } 
    79          
     79 
    8080        if (false == $this->isRequired && strlen($value) == 0) { 
    8181            return null; 
    8282        } 
    83          
     83 
    8484        if ($this->minLength->validate($value) == false) { 
    8585            throw new stubFilterException($this->rveFactory->create('STRING_TOO_SHORT')->setValues($this->minLength->getCriteria())); 
    8686        } 
    87          
     87 
    8888        if (in_array($value, $this->nonAllowedValues) == true) { 
    8989            throw new stubFilterException($this->rveFactory->create('PASSWORD_INVALID')); 
    9090        } 
    91          
     91 
    9292        return $this->secure($value); 
    9393    } 
    94      
     94 
    9595    /** 
    9696     * turns input into a secure value 
     
    9999     * @return  string  secure password 
    100100     */ 
    101    protected function secure($password) 
    102    
    103        return md5($password); 
    104    
     101    protected function secure($password) 
     102   
     103        return md5($password); 
     104   
    105105} 
    106106?> 
  • trunk/src/main/php/net/stubbles/ipo/request/filters/stubStringFilter.php

    r151 r678  
    22/** 
    33 * Class for filtering strings (singe line). 
    4  *  
     4 * 
    55 * @author      Frank Kleine <mikey@stubbles.net> 
    66 * @package     stubbles 
     
    1010/** 
    1111 * Class for filtering strings (singe line). 
    12  *  
     12 * 
    1313 * This filter removes all line breaks. With a regex validator the contents of the 
    1414 * string can be checked (applied after all line breaks have been removed). 
     
    2626     */ 
    2727    protected $regex; 
    28      
     28 
    2929    /** 
    3030     * constructor 
    31      *  
     31     * 
    3232     * @param  stubRequestValueErrorFactory  $rveFactory  factory to create RequestValueErrors 
    3333     * @param  stubValidator                 $regex       validator to use for checking the string 
    3434     */ 
    35    public function __construct(stubRequestValueErrorFactory $rveFactory, stubValidator $regex) 
    36    
    37        $this->rveFactory = $rveFactory; 
    38        $this->regex      = $regex; 
    39    
     35    public function __construct(stubRequestValueErrorFactory $rveFactory, stubValidator $regex) 
     36   
     37        $this->rveFactory = $rveFactory; 
     38        $this->regex      = $regex; 
     39   
    4040 
    4141    /** 
     
    4848    protected function doExecute($value) 
    4949    { 
    50        if (null != $value) { 
    51            // remove line feeds, HTML and all added slashes from magic_gpc_quote 
    52            $value = str_replace(chr(10), '', str_replace(chr(13), '', stripslashes($value))); 
    53            $value = strip_tags($value); 
    54              
    55            if ($this->regex->validate($value) == false) { 
    56                throw new stubFilterException($this->rveFactory->create('FIELD_WRONG_VALUE')); 
    57            } 
    58        } 
    59          
     50        if (null != $value) { 
     51            // remove line feeds, HTML and all added slashes from magic_gpc_quote 
     52            $value = str_replace(chr(10), '', str_replace(chr(13), '', stripslashes($value))); 
     53            $value = strip_tags($value); 
     54 
     55            if ($this->regex->validate($value) == false) { 
     56                throw new stubFilterException($this->rveFactory->create('FIELD_WRONG_VALUE')); 
     57            } 
     58        } 
     59 
    6060        return $value; 
    6161    } 
  • trunk/src/main/php/net/stubbles/ipo/request/filters/stubTextFilter.php

    r151 r678  
    22/** 
    33 * Class for filtering texts (strings containing line feeds). 
    4  *  
     4 * 
    55 * @author      Frank Kleine <mikey@stubbles.net> 
    66 * @package     stubbles 
     
    2828     */ 
    2929    protected $allowedTags = array(); 
    30      
     30 
    3131    /** 
    3232     * constructor 
    33      *  
     33     * 
    3434     * @param  stubRequestValueErrorFactory  $rveFactory  factory to create RequestValueErrors 
    3535     */ 
    36    public function __construct(stubRequestValueErrorFactory $rveFactory) 
    37    
    38        $this->rveFactory = $rveFactory; 
    39    
    40      
    41    /** 
    42     * set the list of allowed tags 
    43      *  
    44     * Use this option very careful. It does not protect you against 
     36    public function __construct(stubRequestValueErrorFactory $rveFactory) 
     37   
     38        $this->rveFactory = $rveFactory; 
     39   
     40 
     41    /** 
     42    * set the list of allowed tags 
     43     * 
     44    * Use this option very careful. It does not protect you against 
    4545     * possible XSS attacks! 
    46    
    47     * @param  array<string>  $allowedTags 
    48     */ 
    49    public function setAllowedTags(array $allowedTags) 
    50    
    51        $this->allowedTags = $allowedTags; 
    52    
     46   
     47    * @param  array<string>  $allowedTags 
     48    */ 
     49    public function setAllowedTags(array $allowedTags) 
     50   
     51        $this->allowedTags = $allowedTags; 
     52   
    5353 
    5454    /** 
     
    6161    protected function doExecute($value) 
    6262    { 
    63        if (null != $value) { 
    64            // remove carriage return and all added slashes from magic_gpc_quote 
    65            $value = str_replace(chr(13), '', stripslashes($value)); 
    66            $value = strip_tags($value, ((count($this->allowedTags) > 0) ? ('<' . join('><', $this->allowedTags) . '>') : (''))); 
    67        } 
    68          
     63        if (null != $value) { 
     64            // remove carriage return and all added slashes from magic_gpc_quote 
     65            $value = str_replace(chr(13), '', stripslashes($value)); 
     66            $value = strip_tags($value, ((count($this->allowedTags) > 0) ? ('<' . join('><', $this->allowedTags) . '>') : (''))); 
     67        } 
     68 
    6969        return $value; 
    7070    } 
  • trunk/src/main/php/net/stubbles/rdbms/querybuilder/stubDatabaseTableJoin.php

    r482 r678  
    7878        $types = explode(' ', $type); 
    7979        foreach ($types as $typeTest) { 
    80            if (in_array($typeTest, self::$types) == false) { 
     80            if (in_array($typeTest, self::$types) == false) { 
    8181                throw new stubIllegalArgumentException('The given join type ' . $type . ' is not an allowed join type. Allowed join types are ' . join(', ', self::$types)); 
    8282            } 
    8383        } 
    84          
     84 
    8585        $this->type = $type; 
    8686    } 
     
    108108            throw new stubIllegalArgumentException('The given join condition type ' . $conditionType . ' is not an allowed join type. Allowed join condition types are ' . join(', ', $conditionTypes)); 
    109109        } 
    110          
     110 
    111111        $this->conditionType = $conditionType; 
    112112    } 
  • trunk/src/main/php/net/stubbles/reflection/annotations/parser/stubAnnotationStateParser.php

    r491 r678  
    8383            throw new ReflectionException('Unknown state ' . $state); 
    8484        } 
    85          
     85 
    8686        $this->currentState = $this->states[$state]; 
    8787        $this->currentState->selected(); 
     
    106106            $this->currentState->process($docBlock{$i}); 
    107107        } 
    108          
     108 
    109109        if (($this->currentState instanceof stubAnnotationDocblockState) == false 
    110110          && ($this->currentState instanceof stubAnnotationTextState) == false) { 
    111111            throw new ReflectionException('Annotation parser finished in wrong state, last annotation probably closed incorrectly, last state was ' . $this->currentState->getClassName()); 
    112112        } 
    113          
     113 
    114114        return $this->annotations; 
    115115    } 
     
    148148            throw new ReflectionException('Error parsing annotation ' . $this->currentAnnotation); 
    149149        } 
    150          
     150 
    151151        $this->annotations[$this->currentAnnotation]['params']['value'] = $value; 
    152152    } 
     
    185185            return (string) $value; 
    186186        } 
    187          
     187 
    188188        if ('true' === $value) { 
    189189            return true; 
    190190        } 
    191          
     191 
    192192        if ('false' === $value) { 
    193193            return false; 
    194194        } 
    195          
     195 
    196196        if ('null' === strtolower($value)) { 
    197197            return null; 
    198198        } 
    199          
    200         if (preg_match('/^[+-]?[0-9]+$/', $value) != false) {           
     199 
     200        if (preg_match('/^[+-]?[0-9]+$/', $value) != false) { 
    201201            return (integer) $value; 
    202202        } 
    203          
    204         if (preg_match('/^[+-]?[0-9]+\.[0-9]+$/', $value) != false) {           
     203 
     204        if (preg_match('/^[+-]?[0-9]+\.[0-9]+$/', $value) != false) { 
    205205            return (double) $value; 
    206206        } 
    207          
     207 
    208208        $matches = array(); 
    209209        if (preg_match('/^([a-zA-Z_]{1}[a-zA-Z\.0-9_]*)\.class/', $value, $matches) != false) { 
    210210            return new stubReflectionClass($matches[1]); 
    211211        } 
    212          
     212 
    213213        if (defined($value) == true) { 
    214214            return constant($value); 
    215215        } 
    216          
     216 
    217217        return (string) $value; 
    218218    } 
  • trunk/src/main/php/net/stubbles/util/ext/stubXPClassLoader.php

    r630 r678  
    5959            $version = '0.0.0'; 
    6060            foreach ($dir as $file) { 
    61                if (substr($file->getFilename(), 0, 6) != 'xp-rt-') { 
    62                    continue; 
    63                
     61                if (substr($file->getFilename(), 0, 6) != 'xp-rt-') { 
     62                    continue; 
     63               
    6464 
    65                $testVersion = str_replace('xp-rt-', '', str_replace('.xar', '', $file->getFilename())); 
    66                if (version_compare($testVersion, $version, '>') == true) { 
    67                    $version = $testVersion; 
    68                
     65                $testVersion = str_replace('xp-rt-', '', str_replace('.xar', '', $file->getFilename())); 
     66                if (version_compare($testVersion, $version, '>') == true) { 
     67                    $version = $testVersion; 
     68               
    6969            } 
    7070 
  • trunk/src/main/php/net/stubbles/util/validators/stubMaxNumberValidator.php

    r151 r678  
    22/** 
    33 * Validator to ensure that a value is not greater than a given maximum value. 
    4  *  
     4 * 
    55 * @author      Frank Kleine <mikey@stubbles.net> 
    66 * @package     stubbles 
     
    2222     */ 
    2323    protected $maxValue; 
    24      
     24 
    2525    /** 
    2626     * constructor 
     
    3232        $this->maxValue = $maxValue; 
    3333    } 
    34      
     34 
    3535    /** 
    3636     * validate that the given value is smaller than or equal to the maximum value 
     
    4141    public function validate($value) 
    4242    { 
    43        if ($value > $this->maxValue) { 
    44            return false; 
    45        } 
    46          
    47        return true; 
     43        if ($value > $this->maxValue) { 
     44            return false; 
     45        } 
     46 
     47        return true; 
    4848    } 
    49      
     49 
    5050    /** 
    5151     * returns a list of criteria for the validator 
    52      *  
     52     * 
    5353     * <code> 
    5454     * array('maxNumber' => [maximum_value]); 
  • trunk/src/main/php/net/stubbles/util/validators/stubMinLengthValidator.php

    r151 r678  
    22/** 
    33 * Validator to ensure that a string is not shorter than a given minimum length. 
    4  *  
     4 * 
    55 * @author      Frank Kleine <mikey@stubbles.net> 
    66 * @package     stubbles 
     
    2222     */ 
    2323    protected $minLength; 
    24      
     24 
    2525    /** 
    2626     * constructor 
     
    3232        $this->minLength = $minLength; 
    3333    } 
    34      
     34 
    3535    /** 
    3636     * validate that the given value is not shorter than the maximum length 
     
    4141    public function validate($value) 
    4242    { 
    43        if (strlen($value) < $this->minLength) { 
    44            return false; 
    45        } 
    46          
    47        return true; 
     43        if (strlen($value) < $this->minLength) { 
     44            return false; 
     45        } 
     46 
     47        return true; 
    4848    } 
    49      
     49 
    5050    /** 
    5151     * returns a list of criteria for the validator 
  • trunk/src/main/php/net/stubbles/util/validators/stubMinNumberValidator.php

    r151 r678  
    22/** 
    33 * Validator to ensure that a value is not smaller than a given minimum value. 
    4  *  
     4 * 
    55 * @author      Frank Kleine <mikey@stubbles.net> 
    66 * @package     stubbles 
     
    2222     */ 
    2323    protected $minValue; 
    24      
     24 
    2525    /** 
    2626     * constructor 
     
    3232        $this->minValue = $minValue; 
    3333    } 
    34      
     34 
    3535    /** 
    3636     * validate that the given value is greater than or equal to the maximum value 
     
    4141    public function validate($value) 
    4242    { 
    43        if ($value < $this->minValue) { 
    44            return false; 
    45        } 
    46          
    47        return true; 
     43        if ($value < $this->minValue) { 
     44            return false; 
     45        } 
     46 
     47        return true; 
    4848    } 
    49      
     49 
    5050    /** 
    5151     * returns a list of criteria for the validator 
  • trunk/src/main/php/net/stubbles/util/validators/stubPassThruValidator.php

    r497 r678  
    2424    public function validate($value) 
    2525    { 
    26        return true; 
     26        return true; 
    2727    } 
    2828 
  • trunk/src/main/php/net/stubbles/util/validators/stubRegexValidator.php

    r151 r678  
    22/** 
    33 * Validator to ensure a value complies to a given regular expression. 
    4  *  
     4 * 
    55 * @author      Frank Kleine <mikey@stubbles.net> 
    66 * @package     stubbles 
     
    1010