Ejemplo n.º 1
0
 /**
  * Create
  * @param \Closure $function
  * @return Custom
  * @throws \InvalidArgumentException
  */
 public static function create($function)
 {
     $validator = parent::create();
     if (!is_callable($function)) {
         throw new \InvalidArgumentException('Function must be collable');
     }
     $validator->function = $function;
     return $validator;
 }