private static function encapsulateFiles($files)
    {
        $validFiles = array_filter($files, function ($file) {
            return $file['error'] == UPLOAD_ERR_OK;
        });

        return array_map(function ($file) {
            return new File($file['name'], $file['size'], $file['tmp_name']);
        }, $validFiles);
    }