/**
 * f\fill_validating_normalizing_or_throw($coll, $paramRules)
 *
 * Combines filling, validating and normalization, throwing if validation fails.
 */
function fill_validating_normalizing_or_throw($coll, $paramRules)
{
    f\validate_coll_or_throw($coll, $paramRules);
    $filled = f\fill($coll, $paramRules);
    return f\normalize_coll($filled, $paramRules);
}
Ejemplo n.º 2
0
/**
 * f\fill_validating_or_throw($coll, $paramRules)
 *
 * Combines filling and validation, throwing if validation fails.
 */
function fill_validating_or_throw($coll, $paramRules)
{
    f\validate_coll_or_throw($coll, $paramRules);
    return f\fill($coll, $paramRules);
}
Ejemplo n.º 3
0
 /**
  * @expectedException \InvalidArgumentException
  */
 public function testItThrowsAnExceptionIfARuleIsNotAnInstanceOfParamRule()
 {
     $coll = array();
     $rules = array('a' => 'is_int');
     f\fill($coll, $rules);
 }