Returns the effective purpose given a context instance.

@param \context $context
@param int $forcedvalue Use this purposeid value as if this was this context instance purpose.
@return purpose|false
779814
public static function get_effective_context_purpose(\context $context, $forcedvalue = false) {
        if (!data_registry::defaults_set()) {
            return false;
        }

        return data_registry::get_effective_context_value($context, 'purpose', $forcedvalue);
    }
121836
protected function isSafe($context)
	{
		// Test this attribute's filters
		$methodName = 'isSafe' . $context;
		foreach ($this->filterChain as $filter)
		{
			if ($filter->$methodName())
			{
				// If any filter makes it safe, we consider it safe
				return true;
			}
		}

		return !empty($this->markedSafe[$context]);
	}
1335166
public function context(ContextInterface $context)
    {
        if (!empty($this->vary)) {
            $this->varyValue = $context->get($this->vary);
        }
    }
1104203
public function forceValues()
    {
        $forceConfig = $this->config->getSubConfig(self::FORCE);
        foreach ($forceConfig->getArrayCopy() as $key => $value) {
            add_filter("genesis_pre_get_option_{$key}", function () use ($value) {
                return $value;
            });
        }
    }
225614
public function evaluate(Context $context)
    {
        /** @var VariableOperand $left */
        /** @var VariableOperand $right */
        list($left, $right) = $this->getOperands();

        return $left->prepareValue($context)->getSet()->setContains($right->prepareValue($context)) === false;
    }
1085610
protected function evaluteExpressionOrValueInternal($fusionPath, $fusionConfiguration, $cacheContext, $contextObject)
    {
        if ($this->evaluateIfCondition($fusionConfiguration, $fusionPath, $contextObject) === false) {
            $this->finalizePathEvaluation($cacheContext);
            $this->lastEvaluationStatus = self::EVALUATION_SKIPPED;

            return null;
        }

        $evaluatedExpression = $this->evaluateEelExpressionOrSimpleValueWithProcessor($fusionPath, $fusionConfiguration, $contextObject);
        $this->finalizePathEvaluation($cacheContext);

        return $evaluatedExpression;
    }
660546
protected static function evaluateFirstApplicable(
        ContextInterface $context,
        array $optimizedTargets,
        array $encodedItems,
        ?LoggerInterface $logger
    ): array {
        foreach (static::evaluateTargets($context, $optimizedTargets, $logger) as $match => $itemId) {
            $encodedItem      = $encodedItems[$itemId];
            $packedEvaluation = static::evaluateItem($context, $match, $encodedItem, $logger);
            $evaluation       = static::unpackEvaluationValue($packedEvaluation);
            if ($evaluation === EvaluationEnum::PERMIT || $evaluation === EvaluationEnum::DENY) {
                $obligations = static::unpackEvaluationObligations($packedEvaluation);
                $advice      = static::unpackEvaluationAdvice($packedEvaluation);

                return static::packEvaluationResult($evaluation, $obligations, $advice);
            }
        }

        return static::packEvaluationResult(EvaluationEnum::NOT_APPLICABLE);
    }
1204734
public function evaluate( Context $context ) {
		/* @var \Ruler\Variable $left */
		list( $left ) = $this->getOperands();

		return null === $left->prepareValue( $context )->getValue();
	}
1240225
private function connectToTarget($context) {
        $result = file_get_contents($this->url, false, $context);

        if ($result === FALSE):

            $this->result = "Valores Enviados, não houve retorno.";

        else:

            $this->retorno = $result;
            $this->result = "Valores Enviados, valores retornados.";

        endif;
    }
296540
public function getValue($context, $name, $default = null)
    {
        $all = $this->getAll($context);

        if (array_key_exists($name, $all)) {
            return $all[$name];
        }

        return $default;
    }
1112237
public function evaluate(Context $context)
    {
        /** @var VariableOperand $left */
        /** @var VariableOperand $right */
        list($left, $right) = $this->getOperands();

        $left = $left->prepareValue($context);

        if (is_array($left->getValue())) {
            trigger_error('Contains operator is deprecated, please use SetContains', E_USER_DEPRECATED);

            return $left->getSet()->setContains($right->prepareValue($context));
        } else {
            trigger_error('Contains operator is deprecated, please use StringContains', E_USER_DEPRECATED);

            return $left->stringContains($right->prepareValue($context));
        }
    }
1222235
private function getFromCache( $locale, $context )
    {
        if ( isset( $this->contextCache[$locale][$context] ) )
        {
            return $this->contextCache[$locale][$context];
        }
        return null;
    }
1356623
public function setContext(FormContext $context){
		$old = $this->context;
		$this->context = $context;
		return $old;
	}
1205477
public Context toFunctional(Context context) {
		if (context == Context.PURE) {
			return context;
		} else {
			return Context.FUNCTIONAL;
		}
	}
118139
public Object getValue(ELContext context)
    {
        Object base = this.orig.getValue(context);
        if (base != null)
        {
            context.setPropertyResolved(false);
            return context.getELResolver().getValue(context, base, i);
        }
        return null;
    }
768764
protected static function evaluateLogical(ContextInterface $context, array $serializedLogical = null): bool
    {
        if ($serializedLogical === null) {
            return true;
        }

        $evaluation = call_user_func($serializedLogical, $context);
        $result     = $evaluation === true;

        return $result;
    }
669920
public function filter(Context $context)
    {
        $this->index++;
        if(empty($this->m_filters) || $this->index >= count($this->m_filters))
            return;
        $filter=$this->m_filters[$this->index];
        return $filter->filter($context,$this);
    }