Makes async operation sync.

@param array $data
@throws SmartlingApiException
513533
public function wait(array $data) {
        if (!empty($data['matchId'])) {
            $start_time = time();

            do {
                $delta = time() - $start_time;

                if ($delta > $this->getTimeOut()) {
                    throw new SmartlingApiException(vsprintf('Async operation is not completed after %s seconds.', [$delta]));
                }

                sleep(1);

                $result = $this->getMatchStatus($data['matchId']);
            }
            while ($result['status'] != 'COMPLETED');
        }
    }
1169807
public function update(array $data) {
        $sql = $this->grammar()->compileUpdate($this, $data);
        return $this->command()
            ->update($sql, $this->getBindings());
    }
90297
public function setData(array $data)
    {
        $data['TASK'] = $this->task;
        $data['RETRY'] = $this->retry;
        $data['APPLICATION'] = $this->application;

        $this->message = $data;
        return $this;
    }
605818
private function wait($response) {
        if (is_array($response) && !empty($response['url'])) {
            $explodedUrl = explode('/', $response['url']);
            $arrayLength = count($explodedUrl);
            $processId = $explodedUrl[$arrayLength - 1];
            $jobId = $explodedUrl[$arrayLength - 3];
            $start_time = time();

            do {
                $delta = time() - $start_time;

                if ($delta > $this->getSyncTimeOut()) {
                    throw new SmartlingApiException(vsprintf('No response received after %s seconds.', [$delta]));
                }

                sleep(1);
                $result = $this->checkAsynchronousProcessingStatus($jobId, $processId);
            }
            while ($result['processState'] != 'COMPLETED');
        }
    }
895807
public final function load(array $data): self
    {
        foreach ($data as $key => $value) {
            $this->set($key, $value);
        }

        return $this;
    }
154175
public function merge($data)
	{
		foreach ($data as $key => $value) {
			$this->set($key, $value);
		}
	}
1117736
public function write($data)
    {
        if ($this->closed) {
            return;
        }

        $all = $this->tail . $data;
        $messages = $this->getParser()->consumeAll($all);
        $this->tail = $all;

        foreach ($messages as $message) {
            if (isset($message['message'])) {
                $this->emit('data', array($message['message']));
                $this->emit('irc.received', array($message));
            } elseif (isset($message['invalid'])) {
                $this->emit('invalid', array($message['invalid']));
            }
        }
    }
144094
private function processData(array $data): void
    {
        foreach ($data['formatters'] as $locale => $f) {
            if (!isset($this->formatters[$locale])) {
                $this->formatters[$locale] = array();
            }
            
            foreach ($f as $formatter => $d) {
                $calendar = \IntlDateFormatter::GREGORIAN;
                if (isset($d['calendar']) && $d['calendar'] === 'traditional') {
                    $calendar = \IntlDateFormatter::TRADITIONAL;
                }
                
                $this->formatters[$locale][$formatter] = new \IntlDateFormatter($locale, null, null, null, $calendar, $d['pattern']);
            }
        }
    }
109192
public function handleVoiceServerChange(array $data = [])
    {
        $this->logger->debug('voice server has changed, dynamically changing servers in the background', ['data' => $data]);
        $this->reconnecting   = true;
        $this->sentLoginFrame = false;
        $this->pause();

        $this->client->close();
        $this->voiceWebsocket->close();

        $this->loop->cancelTimer($this->heartbeat);
        $this->loop->cancelTimer($this->udpHeartbeat);

        $this->data['token'] = $data['token']; // set the token if it changed
        $this->endpoint      = str_replace([':80', ':443'], '', $data['endpoint']);

        $this->initSockets();

        $this->on('resumed', function () {
            $this->logger->debug('voice client resumed');
            $this->unpause()->then(function () {
                $this->speaking = false;
                $this->setSpeaking(true);
            });
        });
    }
134144
public function setData(array $data)
    {
        parent::setData($data);

        if (isset($data['condition'])) {
            $this->setCondition($data['condition']);
        }

        return $this;
    }
1367861
public function merge($data) {

		if (! is_array($data)) {
			$data = $this->makeArray($data);
		}
		
		$this->_data = array_merge($this->_data, $data);
	}
1230901
public function set(array $data) {
		foreach ($data as $name => $value) {
			$this->__set($name, $value);
		}
	}
426437
public function load(array $data)
    {
        foreach ($data as $index => $value) {
            $this->set($index, $value);
        }
    }
222861
public function mergeData(array $data)
	{
		$args = func_get_args();
		while (list(,$v) = each($args)) {
			if (is_array($v)) {
				$this->data = array_merge($this->data, $v);
			}
		}
	}
1294887
public function setData(array $data)
    {
        foreach ($data as $name => $value) {
            if (is_string($name)) {
                $this->__set($name, $value);
            }
        }

        return $this;
    }
1104629
private static function onReceivedMessage(string $event, $data)
    {
        foreach (self::$onMessage[$event] ?? [] as $callback) {
            asyncCall($callback, $data);
        }
    }
283961
public function create(array $data)
    {
        $data = self::mergeData($data, [
            'finished' => false,
            'smContactTaskReq' => [
                'id' => false,
            ],
        ]);

        return $this->client->doPost('contact/updateTask', $data);
    }