protected function getCustomValidator(UploadedFile $file, $rules)
    {
        if (null === $rules) {
            return null;
        }

        if ( ! is_array($rules)) {
            $rules = explode('|', $rules);
        }

        return Validator::make(['file' => $file], ['file' => $rules]);
    }