Skip to content

Commit

Permalink
Add i() to data handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
bajb committed Jan 22, 2020
1 parent 77b71f8 commit bf77ea5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/DataHandlers/AbstractDataHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ abstract class AbstractDataHandler implements DataHandler
protected $_validators = [];
private $_isValidatorSetUp = false;

public static function i()
{
if(func_num_args() > 0)
{
return new static(...func_get_args());
}
return new static();
}

public function addError(ValidationException ...$errors)
{
$this->_errors = array_merge($this->_errors, $errors);
Expand Down

0 comments on commit bf77ea5

Please sign in to comment.