public function check($data)
    {
        foreach ($this->requiredFields as $field => $type)
        {
            if (! isset($data[$field]) || empty($data[$field]) || ! $this->isValid($data[$field], $type)) {

                throw new ValidatorException(ValidatorException::INVALID_INTEGRITY, $this->debugDump($field, $data));
            }
        }

        foreach ($this->optionalFields as $field => $expectedType)
        {
            if (! isset($data[$field])) {
                continue;
            }

            if (! $this->isValid($data[$field], $expectedType)) {
                throw new ValidatorException(ValidatorException::INVALID_INTEGRITY, $this->debugDump($field, $data));
            }
        }

        return true;
    }