src/Util/Validator.php
public function withData(array $data, array $fields = [])
    {
        $clone = clone $this;
        $clone->_fields = !empty($fields) ? \array_intersect_key($data, \array_flip($fields)) : $data;
        $clone->_errors = [];

        return $clone;
    }
public function withData(array $data, array $fields = [])
    {
        $clone = clone $this;
        $clone->_fields = !empty($fields) ? \array_intersect_key($data, \array_flip($fields)) : $data;
        $clone->_errors = [];

        return $clone;
    }
public function withData ( array $ data , array $ fields = [ ] ) { $ clone = clone $ this ; $ clone -> _fields = ! empty ( $ fields ) ? \ array_intersect_key ( $ data , \ array_flip ( $ fields ) ) : $ data ; $ clone -> _errors = [ ] ; return $ clone ; }
Replace data on cloned instance

@param  array $data
@param  array $fields

@return \Hail\Util\Validator
Replace data on cloned instance