Get the current context
@return AclContextContract
197638
public function getContext()
    {
        if (!isset($this->currentContext)) {
            $this->initiateContext();
        }
        return $this->contexts[$this->currentContext];
    }
655973
protected function proxy() {
        if (!$this->context) {
            $this->context = new DialogueContext(
                $this->version,
                $this->solution['assistantSid'],
                $this->solution['sid']
            );
        }

        return $this->context;
    }
1272684
public function getContext()
    {
        if (empty($this->context)) {
            return;
        }

        array_unshift($this->context, "<?php \$context = array(); \n");
        $this->context[] = "return \$context;";
        $context = implode(null, $this->context);

        // Erases context to make sure the next template context won't append to
        $this->context = null;

        return eval('?>' . $context);
    }
713375
private function getContext()
    {
        if (!$this->context) {
            $key = isset($this->options['key']) ? $this->options['key'] : null;
            $this->context = hash_init(
                $this->algo,
                $key ? HASH_HMAC : 0,
                $key
            );
        }

        return $this->context;
    }
195162
public function getStreamContext()
    {
        return ($this->getSoapClient() && isset($this->getSoapClient()->_stream_context) && is_resource($this->getSoapClient()->_stream_context)) ? $this->getSoapClient()->_stream_context : null;
    }
606965
public static Context getContext() {
        Context context = LOCAL.get();
        if (context == null) {
            context = new Context(null, null);
            LOCAL.set(context);
        }
        return context;
    }
1352117
public function getContext()
    {
        if (!$this->locked) {
            throw new Exception\LogicException(
                'Context is not yet available. You must first call handleRequest()'
            );
        }

        if (null === $this->context) {
            $this->context = new Context\Context();
            $this->context
                ->setVisibleColumns(array_keys($this->columns))
                ->setMaxPerPage($this->config->getPerPageChoices()[0]);
        }

        return $this->context;
    }
1133085
public function get_context() {
        if (isset($this->context)) {
            return $this->context;
        }
        $this->context = \context::instance_by_id($this->data['contextid'], IGNORE_MISSING);
        return $this->context;
    }
791007
protected function proxy() {
        if (!$this->context) {
            $this->context = new ConfigurationContext($this->version);
        }

        return $this->context;
    }
380065
public function content(): Context
    {
        if (!$this->content)
        {
            $this->setContent(new Context(
                new Helper(),
                new Extensions()
            ));
        }

        return $this->content;
    }
65327
private function createDocBlockContext()
    {
        $file = $this->descriptor->getFile();
        $namespaceAliases = $file ? $file->getNamespaceAliases()->getAll() : array();

        return new Context($this->descriptor->getNamespace(), $namespaceAliases);
    }
1232213
public function get_context() {
        if ($this->itemtype == 'mod') {
            $modinfo = get_fast_modinfo($this->courseid);
            // Sometimes the course module cache is out of date and needs to be rebuilt.
            if (!isset($modinfo->instances[$this->itemmodule][$this->iteminstance])) {
                rebuild_course_cache($this->courseid, true);
                $modinfo = get_fast_modinfo($this->courseid);
            }
            // Even with a rebuilt cache the module does not exist. This means the
            // database is in an invalid state - we will log an error and return
            // the course context but the calling code should be updated.
            if (!isset($modinfo->instances[$this->itemmodule][$this->iteminstance])) {
                mtrace(get_string('moduleinstancedoesnotexist', 'error'));
                $context = \context_course::instance($this->courseid);
            } else {
                $cm = $modinfo->instances[$this->itemmodule][$this->iteminstance];
                $context = \context_module::instance($cm->id);
            }
        } else {
            $context = \context_course::instance($this->courseid);
        }
        return $context;
    }
310075
public function spanContext()
    {
        $context = Context::current();
        return new SpanContext(
            $context->value('traceId'),
            $context->value('spanId'),
            $context->value('enabled'),
            $context->value('fromHeader')
        );
    }
1259339
protected function proxy() {
        if (!$this->context) {
            $this->context = new AwsContext($this->version, $this->solution['sid']);
        }

        return $this->context;
    }
725041
public function contextObject()
    {
        if ($this->contextObject === null) {
            $this->contextObject = $this->createGenericContext();
        }

        return $this->contextObject;
    }
334259
public function getContext()
    {
        if ($this->context === null) {
            $this->context = array_map(
                'League\JsonGuard\as_string',
                [
                    self::KEYWORD     => $this->keyword,
                    self::PARAMETER   => $this->parameter,
                    self::DATA        => $this->data,
                    self::DATA_PATH   => $this->dataPath,
                    self::SCHEMA      => $this->schema,
                    self::SCHEMA_PATH => $this->schemaPath,
                    self::CAUSE       => $this->getCause(),
                ]
            );
        }

        return $this->context;
    }
441889
protected function proxy() {
        if (!$this->context) {
            $this->context = new AssetContext(
                $this->version,
                $this->solution['serviceSid'],
                $this->solution['sid']
            );
        }

        return $this->context;
    }