protected static function normalize(array $files)
    {
        $normalized = [];
        foreach ($files as $key => $value) {
            if ($value instanceof UploadedFileInterface) {
                $normalized[$key] = $value;

                continue;
            }

            if (! is_array($value)) {
                throw new InvalidArgumentException(
                    'Invalid value in files specification.'
                );
            }

            if (isset($value['tmp_name'])) {
                $normalized[$key] = static::build($value);

                continue;
            }

            $normalized[$key] = static::normalize($value);
        }

        return $normalized;
    }