@param ContextInterface $context
@param Cursor $cursor

@return bool
330035
public function parse(ContextInterface $context, Cursor $cursor)
    {
        if ($cursor->isIndented()) {
            return false;
        }

        $previousState = $cursor->saveState();
        $cursor->advanceToNextNonSpaceOrNewline();
        $fence = $cursor->match('/^\[TOC\]/');
        if (is_null($fence)) {
            $cursor->restoreState($previousState);

            return false;
        }

        $context->addBlock(new TableOfContents());

        return true;
    }
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;
    }
1306920
protected function _afterAdd(KControllerContextInterface $context)
    {
        $status = $context->result->getStatus();

        if($status == KDatabase::STATUS_CREATED) {
            $this->_getCache()->clean($this->_getGroup());
        }

        return true;
    }
1250055
public function addContext(Context $context) {
    $contexts = $this->get('contextOut');
    $contexts[] = $context;
    $this->add('contextOut', $contexts);
  }
778646
public function initializeContext(Context $context)
    {
        if (false === $context instanceof AliceContextInterface) {
            return;
        }

        /* @var AliceContextInterface $context */
        $fixturesBasePath = $this->fixturesBasePath;
        switch (true) {

            case $context instanceof AliceODMContext:
                $fixturesBasePath .= '/ODM';
                break;

            case $context instanceof AliceORMContext:
                $fixturesBasePath .= '/ORM';
                break;

            case $context instanceof AlicePHPCRContext:
                $fixturesBasePath .= '/PHPCR';
                break;
        }

        if (null === $context->getBasePath()) {
            $context->setBasePath($fixturesBasePath);
        }
    }
1047405
public function evaluate(Context $context)
    {
        /** @var Proposition $operand */
        foreach ($this->getOperands() as $operand) {
            if ($operand->evaluate($context) === true) {
                return true;
            }
        }

        return false;
    }
662367
public function is($context, $original = '')
    {
        return (($this->context === $context) && ($this->original === $original)) ? true : false;
    }
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;
    }
1365565
public function validate(ExecutionContextInterface $context)
    {
        $template = $this;
        while ($template != null) {
            if ($template->getLayout() != null) {
                return;
            }
            $template = $template->getTemplate();
        }

        if ($this->getLayout() == null) {
            $context->buildViolation('data.template.templateform.view.type.template.layout.validator_message')->addViolation();
        }
    }
398939
public function isFeatureEnabled($context, $feature)
    {
        if ($this->hasContext($context) &&
            false !== array_search($feature, $this->getFeaturesForContext($context))
        ) {
            return true;
        }

        return false;
    }
373535
protected function executeProcessors(ContextInterface $context)
    {
        $processors = $this->processorBag->getProcessors($context);
        /** @var ProcessorInterface $processor */
        foreach ($processors as $processor) {
            try {
                $processor->process($context);
            } catch (\Exception $e) {
                throw new ExecutionFailedException(
                    $processors->getProcessorId(),
                    $processors->getAction(),
                    $processors->getGroup(),
                    $e
                );
            }
        }
    }
293197
protected function ensureContext(OperationContextInterface $context = null)
    {
        if ($context === null) {
            $context = $this->getSession()->getDefaultContext();
        }

        return $context;
    }
432403
public function match(Context $context)
    {
        $name = $this->getName($context);

        if ($this->map->hasRoute($name)) {
            return $this->map->getRoute($name);
        }

        return false;
    }
1212949
protected function _processHandler(Context $c, $handler, &$response): bool
  {
    $processed = $handler !== null && !is_string($handler);
    while(is_callable($handler))
    {
      $handler = $handler($c);
    }

    if($handler instanceof ContextAware)
    {
      $handler->setContext($c);
    }

    if($handler instanceof Handler)
    {
      $c->events()->trigger(PreExecuteEvent::i($c, $handler));
      $response = $handler->handle($c);
      return true;
    }

    if($handler)
    {
      $response = $handler;
    }

    return $processed;
  }
939730
public function assemble(ContextInterface $context): bool
    {
        $class = $context->getClass();
        $class->setExtendedClass(Client::class);
        $method = $context->getMethod();
        try {
            $phpMethodName = Normalizer::normalizeMethodName($method->getMethodName());
            $param = $this->createParamsFromContext($context);
            $class->removeMethod($phpMethodName);
            $docblock = $context->isMultiArgument() ?
                $this->generateMultiArgumentDocblock($context) :
                $this->generateSingleArgumentDocblock($context);

            $class->addMethodFromGenerator(
                MethodGenerator::fromArray(
                    [
                        'name' => $phpMethodName,
                        'parameters' => [$param],
                        'visibility' => MethodGenerator::VISIBILITY_PUBLIC,
                        'body' => sprintf(
                            'return $this->call(\'%s\', $%s);',
                            $method->getMethodName(),
                            $param->getName()
                        ),
                        'returntype' => $method->getNamespacedReturnType(),
                        'docblock' => $docblock,
                    ]
                )
            );
        } catch (\Exception $e) {
            throw AssemblerException::fromException($e);
        }

        return true;
    }
1318356
public function assemble(ContextInterface $context)
    {
        $class = $context->getClass();
        $properties = $context->getType()->getProperties();
        $firstProperty = count($properties) ? current($properties) : null;

        try {
            $interfaceAssembler = new InterfaceAssembler(ResultProviderInterface::class);
            if ($interfaceAssembler->canAssemble($context)) {
                $interfaceAssembler->assemble($context);
            }

            if ($firstProperty) {
                $this->implementGetResult($context, $class, $firstProperty);
            }
        } catch (\Exception $e) {
            throw AssemblerException::fromException($e);
        }
    }
744707
public function isDifferentEmail(ExecutionContextInterface $context)
    {
        if ($this->getEmail() == $this->getFrom()->getEmail()) {
            $context->buildViolation('You can\'t invite yourself!')
                    ->atPath('email')
                    ->addViolation();
        }
    }