Get the command chain context

This functions inserts a 'caller' variable in the context which contains
the mixer object.

@return  AnCommandContext
544763
public function getCommandContext()
    {
        $context = $this->_command_chain->getContext();
        $context->caller = $this->_mixer;
        
        return $context;
    }
604991
public static function spanContext()
    {
        if (!isset(self::$instance)) {
            return new SpanContext(null, null, false);
        }
        return self::$instance->tracer()->spanContext();
    }
487447
public function getContext()
    {
        return array_filter(array(
            'subject' => $this->getSubject(),
            'from' => $this->addressToString((array) $this->getSender()),
            'to' => $this->addressToString((array) $this->getRecipients()),
            'cc' => $this->addressToString((array) $this->getCc()),
            'bcc' => $this->addressToString((array) $this->getBcc())
        ));
    }
1102507
public function getContextChain()
    {
        $block_chain = array();

        // This should return all of our before hooks in the order they *should*
        // have been invoked.
        $this->traversePost(function ($block) use (&$block_chain) {
            // Ensure ordering - even if the test defininition interleaves
            // before_all with before DSL invocations, we traverse the context
            // according to the 'before_alls before befores' convention.
            $befores = array_merge($block->beforeAlls(), $block->befores());
            $block_chain = array_merge($block_chain, $befores);
        });

        return array_filter(
            array_map(
                function ($block) {
                    return $block->getContext();
                },
                $block_chain
            )
        );
    }
722099
public function getContext()
    {
        $context = new KModelContext();
        $context->setSubject($this);
        $context->setState($this->getState());
        $context->setIdentityKey($this->_identity_key);

        return $context;
    }
1214103
public function get_context() {
        if ($this->coursecontext === null) {
            $this->coursecontext = \context_course::instance($this->course->id);
        }
        return $this->coursecontext;
    }
819202
protected function _afterControllerGet(AnCommandContext $context)
    {
        $flash = $this->_mixer->getState()->flash;
        $message = $flash->getMessage();

        if ($message) {
            $message['message'] = AnTranslator::_($message['message']);
            $this->storeValue('message', $message, true);
        }
    }
758229
public function getContext() {
        return new ExecutionStepContextContext(
            $this->version,
            $this->solution['flowSid'],
            $this->solution['executionSid'],
            $this->solution['stepSid']
        );
    }
1048609
protected function proxy() {
        if (!$this->context) {
            $this->context = new ExecutionContext(
                $this->version,
                $this->solution['flowSid'],
                $this->solution['sid']
            );
        }

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

        return $this->context;
    }
305661
public function helpStubCommand()
    {
        $context = $this->bootstrap->getContext();
        $applicationPackage = $this->packageManager->getPackage($this->applicationPackageKey);
        $this->outputLine('<b>%s %s ("%s" context)</b>', [$this->applicationName, $applicationPackage->getInstalledVersion() ?: 'dev', $context]);
        $this->outputLine('<i>usage: %s <command identifier></i>', [$this->getFlowInvocationString()]);
        $this->outputLine();
        $this->outputLine('See "%s help" for a list of all available commands.', [$this->getFlowInvocationString()]);
        $this->outputLine();
    }
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);
    }
1278821
public function getContext()
    {
        $context = [
            'log_cmd_insert'    => [$this, 'onInsert'],
            'log_cmd_delete'    => [$this, 'onDelete'],
            'log_cmd_update'    => [$this, 'onUpdate'],
            'log_insert'        => [$this, 'onInsert'],
            'log_delete'        => [$this, 'onDelete'],
            'log_update'        => [$this, 'onUpdate'],
            'log_batchinsert'   => [$this, 'onBatchInsert'],
            'log_write_batch'   => [$this, 'onBatchInsert'],
            'log_query'         => [$this, 'onQuery']
        ];
        return $context;
    }
946442
protected function proxy() {
        if (!$this->context) {
            $this->context = new ChannelContext(
                $this->version,
                $this->solution['serviceSid'],
                $this->solution['sid']
            );
        }

        return $this->context;
    }
416160
public function context($context = NULL)
	{
		if ( ! func_num_args())
		{
			return $this->_context;
		}
		$this->_context = $context;
		return $this;
	}
1033829
public function getCommand()
    {
        $command = $this->getCommandName();

        if (is_null($command)) {
            throw new \RuntimeException("commandName must be specified to build a subcommand");
        }

        $command .= ' ';
        $args = $this->getCommandArguments();
        if (count($args) > 0) {
            $command .= $this->extractArguments($args);
            $command .= ' ';
        }
        $subjects = $this->getCommandSubjects();
        if (count($subjects) > 0) {
            $command .= implode(' ', array_map('escapeshellarg', $subjects));
        }
        $command = preg_replace('/\\s{2,}/', ' ', $command);

        return trim($command);
    }
152822
protected function _actionGetsettings(AnCommandContext $context)
    {
        $entity = $this->getItem();
        $this->getToolbar('actorbar')->setActor($entity);
        $this->getToolbar('actorbar')
             ->setTitle(
                 sprintf(AnTranslator::_('COM-ACTORS-PROFILE-HEADER-EDIT'),
                 $entity->name));
        $dispatcher = $this->getService('anahita:event.dispatcher');
        $entity->components->registerEventDispatcher($dispatcher);
        $dispatcher->addEventListener('onSettingDisplay', $this->_mixer);
    }