src/Leevel/Http/FileBag.php
protected function normalizeFile(array $data): array
    {
        $result = [];

        foreach ($data as $key => $value) {
            if (in_array($key, static::$fileKeys, true)) {
                $result[$key] = $value;
            }
        }

        $keys = $this->normalizeKey($result);

        if ($keys !== static::$fileKeys) {
            $e = sprintf('An array uploaded file must be contain keys %s.', implode(',', static::$fileKeys));

            throw new InvalidArgumentException($e);
        }

        return $result;
    }
protected function normalizeFile(array $data): array
    {
        $result = [];

        foreach ($data as $key => $value) {
            if (in_array($key, static::$fileKeys, true)) {
                $result[$key] = $value;
            }
        }

        $keys = $this->normalizeKey($result);

        if ($keys !== static::$fileKeys) {
            $e = sprintf('An array uploaded file must be contain keys %s.', implode(',', static::$fileKeys));

            throw new InvalidArgumentException($e);
        }

        return $result;
    }
格式化 $_FILES 数组.

@param array $data

@return array