@param ContextInterface $context

@return bool
979786
private function skip(ContextInterface $context)
    {
        $dataStack = $context->getDataStack();
        $metadataStack = $context->getMetadataStack();
        $references = [];
        $depth = 0;

        for ($index = count($metadataStack) - 1; $index >= 0; --$index) {
            $metadata = $metadataStack[$index];
            $data = $dataStack[$index];

            if ($metadata instanceof ClassMetadataInterface) {
                $hash = spl_object_hash($data);

                if (!isset($references[$hash])) {
                    $references[$hash] = 0;
                }

                if (++$references[$hash] > $this->circularReferenceLimit) {
                    return true;
                }
            }

            if ($metadata instanceof TypeMetadataInterface) {
                ++$depth;
            }

            if (!$metadata instanceof PropertyMetadataInterface) {
                continue;
            }

            ++$depth;

            if (!$metadata->hasMaxDepth()) {
                continue;
            }

            if ($depth > $metadata->getMaxDepth()) {
                return true;
            }
        }

        return false;
    }
603693
protected function _afterReset(ModelContextInterface $context)
    {
        if($context->modified == 'sort' && strpos($context->state->sort, ',') !== false)
        {
            $context->state->sort = explode(',', $context->state->sort);

            foreach($context->state->sort as $key => $value)
            {
                if(strtoupper($value) == 'DESC' || strtoupper($value) == 'ASC')
                {
                    unset($context->state->sort[$key]);
                    $context->state->direction = $value;
                }
            }
        }
    }
1335166
public function context(ContextInterface $context)
    {
        if (!empty($this->vary)) {
            $this->varyValue = $context->get($this->vary);
        }
    }
1311175
protected static function ctxHasCurrentAccount(ContextInterface $context): bool
    {
        /** @var AccountManagerInterface $manager */
        $container = static::ctxGetContainer($context);
        $manager   = $container->get(AccountManagerInterface::class);
        $account   = $manager->getAccount();

        return $account !== null;
    }
59100
protected static function getCurrentUserIdentity(ContextInterface $context)
    {
        $userId = null;

        /** @var PassportAccountInterface $account */
        if (self::ctxHasCurrentAccount($context) === true &&
            ($account = self::ctxGetCurrentAccount($context)) !== null &&
            $account->hasUserIdentity() === true
        ) {
            $userId = $account->getUserIdentity();
        }

        return $userId;
    }
416160
public function context($context = NULL)
	{
		if ( ! func_num_args())
		{
			return $this->_context;
		}
		$this->_context = $context;
		return $this;
	}
474660
public function evaluate( Context $context ) {
		/* @var \Ruler\Variable $left */
		list( $left ) = $this->getOperands();

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

		if ( is_null( $value ) ) {
			return true;
		}

		if ( is_string( $value ) ) {
			return trim( $value ) === '';
		}

		if ( $value instanceof \Countable ) {
			return count( $value ) === 0;
		}

		return empty( $value );
	}
69520
public function vote(FeatureInterface $feature, Context $context)
    {
        if (!$feature->isEnabled()) {
            return false;
        }

        $context->setName($feature->getName());

        $breaker = $feature->getBreaker();
        if ($breaker->hasFilter() && $this->voter->vote($breaker->getFilterGroups(), $context)) {
            return false;
        }

        $filter = $feature->getFilter();

        return $filter->hasFilter() ? $this->voter->vote($filter->getFilterGroups(), $context) : true;
    }
94762
private function atLeastOneConditionHolds(Context $context)
    {
        foreach ($this->conditions as $condition) {
            if ($condition->holdsFor($context)) {
                return true;
            }
        }

        return false;
    }
1144317
public function assemble(ContextInterface $context)
    {
        try {
            $interfaceAssembler = new InterfaceAssembler(ResultInterface::class);
            if ($interfaceAssembler->canAssemble($context)) {
                $interfaceAssembler->assemble($context);
            }
        } catch (\Exception $e) {
            throw AssemblerException::fromException($e);
        }
    }
537154
private function firstRunner(ContextInterface $context)
    {
        foreach ($this->bagHandler as $handler) {
            if ($handler->canInvoke($context)) {
                return $handler;
            };
        }

        return null;
    }
842796
public function isTargetValid(ExecutionContextInterface $context)
    {
        // Menu is not root and has no url or Article linked
        if ($this->getParent() != $this && !$this->getUrl() && !$this->getArticle()) {
            $context->addViolationAt('url', 'This value should not be blank.');
        }
    }
691511
public function assemble(ContextInterface $context)
    {
        try {
            $interfaceAssembler = new InterfaceAssembler(JsonSerializable::class);
            if ($interfaceAssembler->canAssemble($context)) {
                $interfaceAssembler->assemble($context);
            }

            $this->implementJsonSerialize($context->getType(), $context->getClass());
        } catch (\Exception $e) {
            throw AssemblerException::fromException($e);
        }
    }
1244649
public function matches_all_filters(\context $context) {
        $filters = helper::get_all_filters();

        // All filters must match.
        // If any one filter fails to match, we return false.
        foreach ($filters as $filterclass) {
            if (!$filterclass::filter_matches($this, $context)) {
                return false;
            }
        }

        return true;
    }
1119933
public function context($context = null)
    {
        if (is_null($context)) {
            return $this->context;
        }

        $this->context = $context;

        return $this;
    }
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;
    }
395563
public function inContext($context)
    {
        $length = count($this->context);

        return $length < 2 ? false : $this->context[$length - 1] === $context;
    }