Changeset 4072

Show
Ignore:
Timestamp:
03/21/08 23:47:48 (16 months ago)
Author:
jwage
Message:

Formatting.

Location:
branches/0.10/lib/Doctrine/Validator
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/0.10/lib/Doctrine/Validator/Time.php

    r4069 r4072  
    3434{ 
    3535    /** 
     36     * validate 
     37     * 
    3638     * checks if given value is a valid time 
    3739     * 
     
    4446            return true; 
    4547        } 
     48 
    4649        $e = explode(':', $value); 
    4750 
     
    4952            return false; 
    5053        } 
    51          
    52         if (!preg_match('/^ *[0-9]{2}:[0-9]{2}:[0-9]{2} *$/', $value)) { 
     54 
     55        if ( ! preg_match('/^ *[0-9]{2}:[0-9]{2}:[0-9]{2} *$/', $value)) { 
    5356            return false; 
    5457        } 
    55          
     58 
    5659        $hr = intval($e[0], 10); 
    5760        $min = intval($e[1], 10); 
    5861        $sec = intval($e[2], 10); 
    59          
     62 
    6063        return $hr >= 0 && $hr <= 23 && $min >= 0 && $min <= 59 && $sec >= 0 && $sec <= 59;       
    6164    } 
  • branches/0.10/lib/Doctrine/Validator/Timestamp.php

    r4069 r4072  
    4545        } 
    4646 
    47         if (!preg_match('/^ *[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2} *$/', $value)) { 
     47        if ( ! preg_match('/^ *[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2} *$/', $value)) { 
    4848            return false; 
    4949        } 
    50          
     50 
    5151        list($date, $time) = explode(' ', trim($value)); 
    52          
     52 
    5353        $dateValidator = Doctrine_Validator::getValidator('date'); 
    5454        $timeValidator = Doctrine_Validator::getValidator('time'); 
    55          
    56         if (!$dateValidator->validate($date)) { 
     55 
     56        if ( ! $dateValidator->validate($date)) { 
    5757            return false; 
    5858        } 
    59          
    60         if (!$timeValidator->validate($time)) { 
     59 
     60        if ( ! $timeValidator->validate($time)) { 
    6161            return false; 
    6262        }