Changeset 2979

Show
Ignore:
Timestamp:
10/07/08 10:56:57 (3 months ago)
Author:
felix
Message:

- added and fixed docblocks
- along the way, fixed two minor typos

Location:
branches/dominik-validation-argument-sources/src/validator
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • branches/dominik-validation-argument-sources/src/validator/AgaviValidationArgument.class.php

    r2881 r2979  
    1515 
    1616/** 
    17  * AgaviValidationError stores the incidents of an validation run. 
     17 * AgaviValidationArgument is a tupel of argument name and source that specifies  
     18 * the argument to validate. 
    1819 * 
    1920 * @package    agavi 
     
    3031class AgaviValidationArgument 
    3132{ 
     33  /** 
     34   * @var        string the name of the argument 
     35   */ 
    3236  protected $name; 
     37   
     38  /** 
     39   * @var        string the name of the source 
     40   */ 
    3341  protected $source; 
    3442   
     43  /** 
     44   * create a new AgaviValidationArgument 
     45   *  
     46   * @param      string the name of the argument 
     47   * @param      string the name of the source, if null, AgaviRequestDataHolder::SOURCE_PARAMETERS is used 
     48   *  
     49   * @author     Dominik del Bondio <dominik.del.bondio@bitextender.com> 
     50   * @copyright  Authors 
     51   * @copyright  The Agavi Project 
     52   * 
     53   * @since      1.0.0 
     54   */ 
    3555  public function __construct($name, $source = null) 
    3656  { 
     
    4262  } 
    4363   
     64  /** 
     65   * retrieve the name of the argument 
     66   *  
     67   * @return string 
     68   * 
     69   * @author     Dominik del Bondio <dominik.del.bondio@bitextender.com> 
     70   * @copyright  Authors 
     71   * @copyright  The Agavi Project 
     72   * 
     73   * @since      1.0.0 
     74   */ 
    4475  public function getName() 
    4576  { 
     
    4778  } 
    4879   
     80  /** 
     81   * retrieve the name of the source 
     82   *  
     83   * @return string 
     84   * 
     85   * @author     Dominik del Bondio <dominik.del.bondio@bitextender.com> 
     86   * @copyright  Authors 
     87   * @copyright  The Agavi Project 
     88   * 
     89   * @since      1.0.0 
     90   */ 
    4991  public function getSource() 
    5092  { 
     
    5294  } 
    5395   
     96  /** 
     97   * get a unique hash value for this AgaviValidationArgument 
     98   *  
     99   * @return string 
     100   * 
     101   * @author     Dominik del Bondio <dominik.del.bondio@bitextender.com> 
     102   * @copyright  Authors 
     103   * @copyright  The Agavi Project 
     104   * 
     105   * @since      1.0.0 
     106   */ 
    54107  public function getHash() 
    55108  { 
  • branches/dominik-validation-argument-sources/src/validator/AgaviValidationArgumentResult.class.php

    r2881 r2979  
    1515 
    1616/** 
    17  * AgaviValidationError stores the incidents of an validation run. 
     17 * AgaviValidationArgumentResult stores the result of a validation run for the given argument. 
    1818 * 
    1919 * @package    agavi 
     
    3030class AgaviValidationArgumentResult 
    3131{ 
     32  /** 
     33   * @var        AgaviValidationResult the validation result 
     34   */ 
    3235  protected $validationResult; 
     36  /** 
     37   * @var        AgaviValidationArgument the argument 
     38   */ 
    3339  protected $argument; 
    3440   
     41  /** 
     42   * create a new AgaviValidationArgumentResult 
     43   *  
     44   * @param      AgaviValidationResult the result 
     45   * @param      AgaviValidationArgument the argument the result is valid for 
     46   *  
     47   * @author     Dominik del Bondio <dominik.del.bondio@bitextender.com> 
     48   * @copyright  Authors 
     49   * @copyright  The Agavi Project 
     50   * 
     51   * @since      1.0.0 
     52   */ 
    3553  public function __construct(AgaviValidationResult $result, AgaviValidationArgument $argument) 
    3654  { 
     
    3957  } 
    4058   
     59  /** 
     60   * retrieve the argument  
     61   *  
     62   * @return     AgaviValidationArgument 
     63   *  
     64   * @author     Dominik del Bondio <dominik.del.bondio@bitextender.com> 
     65   * @copyright  Authors 
     66   * @copyright  The Agavi Project 
     67   * 
     68   * @since      1.0.0 
     69   */ 
    4170  public function getArgument() 
    4271  { 
     
    4473  } 
    4574   
     75  /** 
     76   * retrieve the results severity  
     77   *  
     78   * @return     integer 
     79   *  
     80   * @author     Dominik del Bondio <dominik.del.bondio@bitextender.com> 
     81   * @copyright  Authors 
     82   * @copyright  The Agavi Project 
     83   * 
     84   * @since      1.0.0 
     85   */ 
    4686  public function getSeverity() 
    4787  { 
     
    4989  } 
    5090   
     91  /** 
     92   * retrieve the incidents for this instances argument 
     93   *  
     94   * @return     array an array of AgaviValidationIncidents 
     95   *  
     96   * @author     Dominik del Bondio <dominik.del.bondio@bitextender.com> 
     97   * @copyright  Authors 
     98   * @copyright  The Agavi Project 
     99   * 
     100   * @since      1.0.0 
     101   */ 
    51102  public function getIncidents() 
    52103  { 
     
    56107      foreach($incident->getErrors() as $error) { 
    57108        if($error->hasArgument($this->argument)) { 
    58           $affectedIncidents = $incident; 
     109          $affectedIncidents[] = $incident; 
    59110        } 
    60111      } 
     
    63114  } 
    64115   
     116  /** 
     117   * retrieve the error messages for this instances argument 
     118   *  
     119   * @return     array an array of error messages (strings) 
     120   *  
     121   * @author     Dominik del Bondio <dominik.del.bondio@bitextender.com> 
     122   * @copyright  Authors 
     123   * @copyright  The Agavi Project 
     124   * 
     125   * @since      1.0.0 
     126   */ 
    65127  public function getErrorMessages() 
    66128  { 
  • branches/dominik-validation-argument-sources/src/validator/AgaviValidationResult.class.php

    r2970 r2979  
    1515 
    1616/** 
    17  * AgaviValidationError stores the incidents of an validation run. 
     17 * AgaviValidationResult stores the result of a validation run. 
    1818 * 
    1919 * @package    agavi 
  • branches/dominik-validation-argument-sources/src/validator/AgaviValidationValidatorResult.class.php

    r2881 r2979  
    1515 
    1616/** 
    17  * AgaviValidationError stores the incidents of an validation run. 
     17 * AgaviValidationValidatorResult provides access to the validation result for a given validator 
    1818 * 
    1919 * @package    agavi 
     
    3030class AgaviValidationValidatorResult 
    3131{ 
     32  /** 
     33   * @var        AgaviValidationResult the result 
     34   */ 
    3235  protected $validationResult; 
     36   
     37  /** 
     38   * @var        string the affected validators name 
     39   */ 
    3340  protected $validatorName; 
    3441   
     42  /** 
     43   * create a new AgaviValidationValidatorResult 
     44   *  
     45   * @param      AgaviValidationResult the validation result 
     46   * @param      string the affected validators name 
     47   *  
     48   * @author     Dominik del Bondio <dominik.del.bondio@bitextender.com> 
     49   * @copyright  Authors 
     50   * @copyright  The Agavi Project 
     51   * 
     52   * @since      1.0.0 
     53   */ 
    3554  public function __construct(AgaviValidationResult $result, $name) 
    3655  { 
     
    3958  } 
    4059   
     60  /** 
     61   * retrieve the affected validators name 
     62   *  
     63   * @return     string the validators name 
     64   *  
     65   * @author     Dominik del Bondio <dominik.del.bondio@bitextender.com> 
     66   * @copyright  Authors 
     67   * @copyright  The Agavi Project 
     68   * 
     69   * @since      1.0.0 
     70   */ 
    4171  public function getValidatorName() 
    4272  { 
     
    4474  } 
    4575   
     76  /** 
     77   * retrieve all AgaviValidationIncidents for this instances' validator 
     78   *  
     79   * @return     array a collection of affected {@see AgaviValidationIncident} 
     80   *  
     81   * @author     Dominik del Bondio <dominik.del.bondio@bitextender.com> 
     82   * @copyright  Authors 
     83   * @copyright  The Agavi Project 
     84   * 
     85   * @since      1.0.0 
     86   */ 
    4687  public function getIncidents() 
    4788  { 
     
    5091    foreach($incidents as $incident) { 
    5192      if($incident->getValidator()->getName() == $this->validatorName) { 
    52         $affectedIncidents = $incident; 
     93        $affectedIncidents[] = $incident; 
    5394      } 
    5495    }