protected function assertUploadedFilesStructure(array $uploadedFiles, $groupKey = null)
    {
        foreach ($uploadedFiles as $key => $item) {
            $parameterKey = isset($groupKey) ? "{$groupKey}[{$key}]" : $key;
            
            if (is_array($item)) {
                $this->assertUploadedFilesStructure($item, $parameterKey);
            } elseif (!$item instanceof UploadedFileInterface) {
                throw new \InvalidArgumentException("'$parameterKey' is not an UploadedFileInterface object, but a "
                    . (is_object($item) ? get_class($item) . ' ' : '') . gettype($item));
            }
        }
    }