private function createUploadedFile($data)
    {
        if (array_key_exists('tmp_name', $data)) {
            return UploadedFile::create($data);
        }

        $result = [];
        foreach ($data as $key => $datum) {
            $result[$key] = $this->createUploadedFile($datum);
        }
        return $result;
    }
private function createUploadedFile($data)
    {
        if (array_key_exists('tmp_name', $data)) {
            return UploadedFile::create($data);
        }

        $result = [];
        foreach ($data as $key => $datum) {
            $result[$key] = $this->createUploadedFile($datum);
        }
        return $result;
    }
private function createUploadedFile ( $ data ) { if ( array_key_exists ( 'tmp_name' , $ data ) ) { return UploadedFile :: create ( $ data ) ; } $ result = [ ] ; foreach ( $ data as $ key => $ datum ) { $ result [ $ key ] = $ this -> createUploadedFile ( $ datum ) ; } return $ result ; }
Helper function to recursively create UploadedFile objects

@param array $data

@return array|UploadedFile
Helper function to recursively create UploadedFile objects