protected function validateUploadedFiles(array $uploadedFiles): void
    {
        foreach ($uploadedFiles as $file) {
            if (\is_array($file)) {
                $this->validateUploadedFiles($file);

                continue;
            }

            if (! $file instanceof UploadedFile) {
                throw new InvalidUploadedFile(
                    'Invalid leaf in uploaded files structure'
                );
            }
        }
    }