Changeset 370

Show
Ignore:
Timestamp:
03/13/07 14:45:43 (2 years ago)
Author:
mikey
Message:

remove exception, a validator should not throw one in its validate() method
removed tabs

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main/php/net/stubbles/util/validators/stubEqualValidator.php

    r151 r370  
    2626     */ 
    2727    protected $expected = null; 
    28      
     28     
    2929    /** 
    3030     * constructor 
     
    3333     * @throws  stubValidatorException 
    3434     */ 
    35    public function __construct($expected) 
    36    
    37        if (is_scalar($expected) == false && null != $expected) { 
    38            throw new stubValidatorException('Can only compare scalar values and null.'); 
    39        } 
    40         
    41        $this->expected = $expected; 
    42    
     35    public function __construct($expected) 
     36   
     37        if (is_scalar($expected) == false && null != $expected) { 
     38            throw new stubValidatorException('Can only compare scalar values and null.'); 
     39        } 
     40         
     41        $this->expected = $expected; 
     42   
    4343 
    4444    /** 
     
    4747     * @param   scalar|null  $value 
    4848     * @return  bool         true if value is equal to expected value, else false 
    49      * @throws  stubValidatorException 
    5049     */ 
    5150    public function validate($value) 
    5251    { 
    53         if (is_scalar($value) == false && null != $value) { 
    54             throw new stubValidatorException('Can only compare scalar values and null.'); 
    55         } 
    56          
    5752        if ($this->expected !== $value) { 
    5853            return false;