Jump to interaction.

@throws \InvalidArgumentException
541070
public static function jump(): void
    {
        /** @var Manager $conversation */
        $conversation = resolve(Manager::class);
        $conversation->converse(resolve(static::class));
        $conversation->markAsTransitioned();
    }
371097
public function begin() {
        if($this->isInTransaction()) {
            throw new \Exception('You cannot start a new transaction once you are already in one (Originally started at: ' . self::$stackTrace . ')');
        } else {
            $e = new \Exception();
            self::$stackTrace = $e->getTraceAsString();
        }
        $transactionManager = new TransactionManager();
        $transactionManager->setDbService($this->getDbService());
        $this->setTransaction($transactionManager->get());
    }
131388
public void
jump(int index) {
	if (index >= byteBuffer.capacity()) {
		throw new IllegalArgumentException("cannot jump past " +
						   "end of input");
	}
	byteBuffer.position(index);
	byteBuffer.limit(byteBuffer.capacity());
}
958662
public function run()
    {
        try
        {
            $this['triggers']->callTrigger('before-match-request', $this);

            $this['request']->attributes->add(
                $this['router']->matchRequest($this['request'])
            );

            $this['triggers']->callTrigger('before-controller-resolver', $this);

            $this['response'] = $this->controllerResolver();
        }
        catch (ResourceNotFoundException $e)
        {
            $this['response'] = (new Controller($this))->serve404();
        }
        catch (\Exception $e)
        {
            $this['response'] = new Response();
            $this['response']->headers->set('Content-Type', 'text/plain');
            $this['response']->setStatusCode(Response::HTTP_INTERNAL_SERVER_ERROR);
            $this['response']->setContent($e->getMessage());
        }

        if ($this['x-frame-options']) {
            $this['response']->headers->set('x-frame-options', $this['x-frame-options']);
        }

        $this['response']->prepare($this['request']);

        $this['triggers']->callTrigger('before-send-response', $this);

        $this['response']->send();
    }
1061360
protected function interact(InputInterface $input, OutputInterface $output)
    {
        $this->setInputAndOutput($input, $output);

        $welcomeText = $this->getWelcomeText();
        if (!empty($welcomeText)) {
            $this->assistant->writeSection($this->getWelcomeText());
        }

        $this->doInteract();
    }
1188286
public function doInit()
    {
        //extension hook
        $this->extend('onBeforeInit');

        // Safety call
        $this->baseInitCalled = false;
        $this->init();
        if (!$this->baseInitCalled) {
            $class = static::class;
            user_error(
                "init() method on class '{$class}' doesn't call Controller::init()."
                . "Make sure that you have parent::init() included.",
                E_USER_WARNING
            );
        }

        $this->extend('onAfterInit');
    }
402732
protected function initInstances()
    {
        if (empty($this->instances)) {
            foreach ($this->servers as $server) {
                if ($server instanceof \Redis) {
                    if ($server->isConnected()) {
                        $redis = $server;
                    } else {
                        throw new \InvalidArgumentException("If you use \\Redis objects as argument, the object must be connected.");
                    }
                } else {
                    if (empty($server[0])) {
                        throw new \InvalidArgumentException("A server hostname or IP is required");
                    }

                    if (empty($server[1])) {
                        $server[1] = 6379;
                    }
                    if (empty($server[2])) {
                        $server[2] = 0;
                    }
                    list($host, $port, $timeout) = $server;
                    $redis = new \Redis();
                    $redis->connect($host, $port, $timeout);
                }
                $this->instances[] = $redis;
            }
        }
    }
626746
public function configure()
    {
        switch (count($options = func_get_args())) {
            case 0:
                break;

            case 1:
                $this->configureInstance($options[0]);
                break;

            case 2:
                $this->configureInstanceAssoc(
                    static::authorize($options[0], $options[1])
                );
                break;

            default:
                throw new \InvalidArgumentException('invalid argument count');
                break;
        }

        return $this;
    }
1000980
private function byOption()
    {
        $option = new OptionForCli($this->interactor);
        $option->setOption($this->option);
        $option->execute();
    }
913735
public function interactConfigureBehat(
    InputInterface $input,
    OutputInterface $output,
    AnnotationData $annotationData
  ) {
    /** @var \Acquia\Blt\Robo\Wizards\TestsWizard $tests_wizard */
    $tests_wizard = $this->getContainer()->get(TestsWizard::class);
    $tests_wizard->wizardConfigureBehat();
  }
505664
public function setClient()
    {
        if(empty($this->apiKey))
        {
            throw new InvalidArgumentException('Api key can not be empty');
        }

        $this->client = new Client($this->apiKey);
    }
52679
public function intercept()
    {
        if (!$this->isIntercepting) {
            stream_wrapper_unregister(self::PROTOCOL);
            $this->isIntercepting = stream_wrapper_register(self::PROTOCOL, __CLASS__);
        }
    }
653219
public function setStep($step)
    {
        if (is_int($step)) {
            $this->step = $step;
        } else {
            $msg = "'Step' must be an integer, '" . gettype($step) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
145815
public function activate(): void
    {
        if ($this->stopBuffering) {
            $this->buffering = false;
        }
        if (!$this->handler instanceof HandlerInterface) {
            $record = end($this->buffer) ?: null;

            $this->handler = call_user_func($this->handler, $record, $this);
            if (!$this->handler instanceof HandlerInterface) {
                throw new \RuntimeException("The factory callable should return a HandlerInterface");
            }
        }
        $this->handler->handleBatch($this->buffer);
        $this->buffer = [];
    }
134235
public function addInteraction(Interaction $interaction)
    {
        $response = $this
            ->httpClient
            ->get(
                sprintf(
                    '/%s/interactions',
                    $this->getAppUUID()->composeUUID()
                ),
                'post',
                [],
                $interaction->toArray(),
                Http::getApisearchHeaders($this)
            );

        self::throwTransportableExceptionIfNeeded($response);
    }
1337898
public function onRun()
    {
        if (!$this->checkUserSecurity()) {
            if (empty($this->property('redirect'))) {
                throw new \InvalidArgumentException('Redirect property is empty');
            }
            
            $redirectUrl = $this->controller->pageUrl($this->property('redirect'));
            return Redirect::guest($redirectUrl);
        }

        $this->page['user'] = $this->user();
    }
335408
protected function initChildren()
    {
        foreach ($this->datas as $name => $data) {
            $fields = $data->getDefinition()->getFieldNames();
            foreach ($fields as $field) {
                if ($data->getDefinition()->getType($field) == 'reference') {
                    $this->datas[$data->getDefinition()->getSubTypeField($field, 'reference', 'entity')]->getDefinition()->addChild($data->getDefinition()->getTable(), $field, $name);
                }
            }
        }
    }