protected static function validUploadedFiles(array $uploadedFiles, string $index = ""){
        foreach($uploadedFiles as $key => $file){
            $_index = "" === $index ? $key : ($index . "." . $key);

            if(is_array($file)){
                self::validUploadedFiles($file, $_index);
                continue;
            }

            if(!is_subclass_of($file, UploadedFileInterface::class)){
                $class  = UploadedFileInterface::class;

                throw new \InvalidArgumentException(
                    "Of the uploaded files, '{$_index}' is not an instance of"
                    . " the class implementing {$class}"
                );
            }
        }
    }