Changeset 537

Show
Ignore:
Timestamp:
04/15/07 12:21:43 (2 years ago)
Author:
schst
Message:

Enclose string parameters in quotes, whitespace fixes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main/php/net/stubbles/ipo/request/stubRequestValueError.php

    r295 r537  
    22/** 
    33 * Class containing error messages for request values. 
    4  *  
     4 * 
    55 * @author      Frank Kleine <mikey@stubbles.net> 
    66 * @package     stubbles 
     
    1010/** 
    1111 * Class containing error messages for request values. 
    12  *  
    13  * This is mainly an internal class for the request package, a container for  
     12 * 
     13 * This is mainly an internal class for the request package, a container for 
    1414 * error messages. The messages itself can contain value keys. These value 
    15  * keys are thought to be replaced with concrete values to customize the error  
     15 * keys are thought to be replaced with concrete values to customize the error 
    1616 * message. 
    1717 * 
    1818 * @package     stubbles 
    1919 * @subpackage  ipo_request 
    20  * @XMLTag(tagName=error
    21  * @XMLMethods[XMLMatcher](pattern=/getId|getMessages/
     20 * @XMLTag(tagName="error"
     21 * @XMLMethods[XMLMatcher](pattern="/getId|getMessages/"
    2222 */ 
    2323class stubRequestValueError extends stubBaseObject 
     
    4141     */ 
    4242    protected $values   = array(); 
    43      
     43 
    4444    /** 
    4545     * constructor 
     
    8080        return isset($this->messages[$locale]); 
    8181    } 
    82      
     82 
    8383    /** 
    8484     * returns the message for the given locale 
     
    9595                $message = str_replace('{' . $key . '}', $this->flattenValue($value), $message); 
    9696            } 
    97              
     97 
    9898            return $message; 
    9999        } 
    100          
     100 
    101101        return null; 
    102102    } 
    103      
     103 
    104104    /** 
    105105     * returns all messages 
    106106     * 
    107107     * @return  array<string,string> 
    108      * @XMLTag(tagName=messages
     108     * @XMLTag(tagName="messages"
    109109     */ 
    110110    public function getMessages() 
     
    115115                $message = str_replace('{' . $key . '}', $this->flattenValue($value), $message); 
    116116            } 
    117              
     117 
    118118            $messages[$locale] = $message; 
    119119        } 
    120          
     120 
    121121        return $messages; 
    122122    } 
    123      
     123 
    124124    /** 
    125125     * flattens the given value to be used within the message 
     
    137137            } 
    138138        } 
    139          
     139 
    140140        return (string) $value; 
    141141    } 
    142      
     142 
    143143    /** 
    144144     * Sets the values that should replace the value keys within the messages. 
    145      *  
    146      * This method could be used in conjunction with the getCriteria() method  
    147      * of a validator: the return values of these mostly fit well to the  
    148      * required value keys. Returns itself for easy use in conjunction with  
     145     * 
     146     * This method could be used in conjunction with the getCriteria() method 
     147     * of a validator: the return values of these mostly fit well to the 
     148     * required value keys. Returns itself for easy use in conjunction with 
    149149     * the factory. 
    150150     * 
     
    160160                throw new stubRequestValueErrorException('Value for key ' . $key . ' is missing.'); 
    161161            } 
    162              
     162 
    163163            $this->values[$key] = $values[$key]; 
    164164        } 
    165          
     165 
    166166        return $this; 
    167167    } 
    168      
     168 
    169169    /** 
    170170     * returns a list of all value keys