Esempio n. 1
0
 /**
  * Add one or more fields to the list of fields that are required.
  *
  * @param string|string[] $fields
  *
  * @throws InvalidArgumentException
  * @return $this
  */
 public function required($fields)
 {
     Arguments::define(Boa::either(Boa::string(), Boa::arrOf(Boa::string())))->check($fields);
     if (!is_array($fields)) {
         $fields = [$fields];
     }
     $this->required = $this->required->append(ArrayList::of($fields));
     return $this;
 }