示例#1
0
 public function __construct(ParsedInput $valid)
 {
     if (!$valid->isValidated()) {
         throw new BadMethodCallException();
     }
     $this->setData($valid->getData());
 }
示例#2
0
 /**
  * @param array data to add
  * @return this
  * @throws BadMethodCallException
  */
 public function addData(ParsedInput $add) : self
 {
     if ($this->isValidated()) {
         throw new BadMethodCallException("Data cannot be added after validation is performed");
     }
     if ($add->isValidated()) {
         throw new BadMethodCallException("Data cannot be added after validation is performed");
     }
     $this->setData(array_merge($add->getData(), $this->getData()));
     return $this;
 }