private static function stripEmptyFiles($data)
    {
        if (!\is_array($data)) {
            return $data;
        }

        $keys = array_keys($data);
        sort($keys);

        if (self::$fileKeys === $keys) {
            if (UPLOAD_ERR_NO_FILE === $data['error']) {
                return null;
            }

            return $data;
        }

        foreach ($data as $key => $value) {
            $data[$key] = self::stripEmptyFiles($value);
        }

        return $data;
    }
private static function stripEmptyFiles($data)
    {
        if (!\is_array($data)) {
            return $data;
        }

        $keys = array_keys($data);
        sort($keys);

        if (self::$fileKeys === $keys) {
            if (UPLOAD_ERR_NO_FILE === $data['error']) {
                return null;
            }

            return $data;
        }

        foreach ($data as $key => $value) {
            $data[$key] = self::stripEmptyFiles($value);
        }

        return $data;
    }
private static function stripEmptyFiles ( $ data ) { if ( ! \ is_array ( $ data ) ) { return $ data ; } $ keys = array_keys ( $ data ) ; sort ( $ keys ) ; if ( self :: $ fileKeys === $ keys ) { if ( UPLOAD_ERR_NO_FILE === $ data [ 'error' ] ) { return null ; } return $ data ; } foreach ( $ data as $ key => $ value ) { $ data [ $ key ] = self :: stripEmptyFiles ( $ value ) ; } return $ data ; }
Sets empty uploaded files to NULL in the given uploaded files array.

@param mixed $data The file upload data

@return array|null Returns the stripped upload data
Sets empty uploaded files to NULL in the given uploaded files array .