Match context sync.

@param $contextUid
@param \Smartling\Context\Params\MatchContextParameters $params

@throws \Smartling\Exceptions\SmartlingApiException
193184
public function matchContextSync($contextUid, MatchContextParameters $params = null)
    {
        $this->wait($this->matchContext($contextUid, $params));
    }
84801
protected function checkContext(Context $context, string $method) : void
    {
        if ($this->context != $context) { // non-strict equality on purpose
            throw MoneyMismatchException::contextMismatch($method);
        }
    }
430525
private function setMatchedQuery( $matches = [ ], $query = '' ) {
        if ( ! is_null( $this->matched_rule ) ) {
            $mathed = \WP_MatchesMapRegex::apply( preg_replace( "!^.+\?!", '', $query ), $matches );
            $this->matched_query = addslashes( $mathed );
            parse_str( $this->matched_query, $this->perma_q_vars );
            if ( '404' === $this->error ) $this->error = NULL;
        }
    }
1097951
private static void match_glob(GlobData mdata, Context cx,
                                   Scriptable scope, int count,
                                   RegExpImpl reImpl)
    {
        if (mdata.arrayobj == null) {
            mdata.arrayobj = cx.newArray(scope, 0);
        }
        SubString matchsub = reImpl.lastMatch;
        String matchstr = matchsub.toString();
        mdata.arrayobj.put(count, mdata.arrayobj, matchstr);
    }
840085
function checkNonceMatch(context) {
    var newNonce1 = Buffer.concat([utility.string2Buffer(context.newNonce, 32), new Buffer([1]), context.authKeyAuxHash]);
    var newNonceHash = utility.buffer2String(utility.createSHAHash(newNonce1).slice(-16));
    var serverNewNonceHash = context.setClientDHParamsAnswer.new_nonce_hash1;
    if (logger.isDebugEnabled()) {
        logger.debug('newNonceHash = %s, new_nonce_hash1 = %s', newNonceHash.toString(), serverNewNonceHash.toString());
    }
    if (newNonceHash !== serverNewNonceHash) {
        logger.warn('\'dh_gen_ok.new_nonce_hash1\' check fails!');
        throw createError(newNonceHash + ' != ' + serverNewNonceHash, 'EREPLAYATTACK');
    }
    return context;
}
244432
@Override
    public void contextualize(Context context) throws ContextException {
        authConfigFactory = new AuthConfigFactory((PlexusContainer) context.get(PlexusConstants.PLEXUS_KEY));
    }
107365
private function checkContextMatch($Input, $Backtrack, $Lookahead, $ignore, $ptr)
	{
		// Input etc are single numbers - GSUB Format 6.1
		// Input starts with (1=>xxx)
		// return false if no match, else an array of ptr for matches (0=>0, 1=>3,...)

		$current_syllable = (isset($this->OTLdata[$ptr]['syllable']) ? $this->OTLdata[$ptr]['syllable'] : 0);

		// BACKTRACK
		$checkpos = $ptr;
		for ($i = 0; $i < count($Backtrack); $i++) {
			$checkpos--;
			while (isset($this->OTLdata[$checkpos]) && strpos($ignore, $this->OTLdata[$checkpos]['hex']) !== false) {
				$checkpos--;
			}
			// If outside scope of current syllable - return no match
			if ($this->restrictToSyllable && isset($this->OTLdata[$checkpos]['syllable']) && $this->OTLdata[$checkpos]['syllable'] != $current_syllable) {
				return false;
			} elseif (!isset($this->OTLdata[$checkpos]) || $this->OTLdata[$checkpos]['uni'] != $Backtrack[$i]) {
				return false;
			}
		}

		// INPUT
		$matched = [0 => $ptr];
		$checkpos = $ptr;
		for ($i = 1; $i < count($Input); $i++) {
			$checkpos++;
			while (isset($this->OTLdata[$checkpos]) && strpos($ignore, $this->OTLdata[$checkpos]['hex']) !== false) {
				$checkpos++;
			}
			// If outside scope of current syllable - return no match
			if ($this->restrictToSyllable && isset($this->OTLdata[$checkpos]['syllable']) && $this->OTLdata[$checkpos]['syllable'] != $current_syllable) {
				return false;
			} elseif (isset($this->OTLdata[$checkpos]) && $this->OTLdata[$checkpos]['uni'] == $Input[$i]) {
				$matched[] = $checkpos;
			} else {
				return false;
			}
		}

		// LOOKAHEAD
		for ($i = 0; $i < count($Lookahead); $i++) {
			$checkpos++;
			while (isset($this->OTLdata[$checkpos]) && strpos($ignore, $this->OTLdata[$checkpos]['hex']) !== false) {
				$checkpos++;
			}
			// If outside scope of current syllable - return no match
			if ($this->restrictToSyllable && isset($this->OTLdata[$checkpos]['syllable']) && $this->OTLdata[$checkpos]['syllable'] != $current_syllable) {
				return false;
			} elseif (!isset($this->OTLdata[$checkpos]) || $this->OTLdata[$checkpos]['uni'] != $Lookahead[$i]) {
				return false;
			}
		}

		return $matched;
	}
423701
private function setMatchContext(array $match)
    {
        if (isset($match['_branding'])) {
            $this->context->setParameter('_branding', $match['_branding']);

            $this->siteContext->setCurrentBranding($this->siteContext->getBranding($match['_branding']));
        }

        if (isset($match['_locale'])) {
            $this->context->setParameter('_locale', $match['_locale']);

            $this->siteContext->setCurrentLocale($match['_locale']);
        }
    }
623573
public function setParams($params, $merge = true)
    {
        $context = $this->_context;

        $context->params = $merge ? array_merge($context->params, $params) : $params;

        return $this;
    }
908699
protected function matchToKeys(array $matches)
    {
        $parameterNames = $this->parameterNames();

        if (count($parameterNames) == 0) {
            return array();
        }

        $parameters = array_intersect_key($matches, array_flip($parameterNames));

        return array_filter($parameters, function ($value)
        {
            return is_string($value) && (strlen($value) > 0);
        });
    }
1319054
protected final boolean anyMatches(ConditionContext context,
			AnnotatedTypeMetadata metadata, Condition... conditions) {
		for (Condition condition : conditions) {
			if (matches(context, metadata, condition)) {
				return true;
			}
		}
		return false;
	}
46550
function bindWith(iContextStream $context)
    {
        $wrapperName = strtolower($context->getWrapperName());
        $this->bindContexts[$wrapperName] = $context;
        return $this;
    }
1322037
protected static function pushToken(&$context, $token) {
        if ($token === '') {
            return;
        }
        if (is_string($token)) {
            if (is_string(end($context['parsed'][0]))) {
                $context['parsed'][0][key($context['parsed'][0])] .= $token;
                return;
            }
        }
        $context['parsed'][0][] = $token;
    }
150746
public function setContext(RequestContext $context)
    {
        foreach ($this->matchers as $matcher) {
            $matcher->setContext($context);
        }

        $this->context = $context;
    }
381500
public function pushContext($key, $context)
    {
        $newContext = $this->getCurrentContext();
        $newContext[$key] = $context;
        $this->contextStack[] = $newContext;
    }
956136
public static function setContextData(array $contextData = [])
    {
        $coroutineId = self::getcoroutine();
        self::$coroutineLocal[$coroutineId][self::COROUTINE_DATA] = $contextData;
    }
1020819
private function addWhereContexts(QueryBuilder $qb, $contexts = null): void
    {
        if (null !== $contexts) {
            $contexts = (array) $contexts;
            $where = 'p.contexts IS NULL';

            foreach ($contexts as $context) {
                $key = 'context_'.$context;
                $where .= sprintf(' OR p.contexts LIKE :%s', $key);
                $qb->setParameter($key, '%"'.$context.'"%');
            }

            $qb->andWhere($where);
        }
    }