src/Factory/UploadedFilesFactory.php
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;
    }
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;
    }
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 ; }
Normalizes the array.

@param array $files The array with specifications of uploaded files

@throws \InvalidArgumentException If invalid value present in
files specification

@return array The normalized array
Normalizes the array .