Accessor for context requests

@return ContextRequests
549713
public function contexts()
    {
        if (is_null($this->contextRequests)) {
            $this->contextRequests = new ContextRequests($this->client);
        }

        return $this->contextRequests;
    }
1338019
public function getMethods()
    {
        $requestMethod = $this->request->getAccessControlRequestMethod();
        if (in_array('*', $this->methods) && $requestMethod) {
            return $requestMethod;
        }

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

        return $this->context;
    }
664439
public function getContext(): Context
    {
        if ($this->context === null) {
            $this->context = new Context;
        }

        return $this->context;
    }
580687
public function requestAccessToken()
    {
        try {
            $this->session->requestAccessToken($_GET['code']);
            return $this;
        } catch (Exception $e) {
            $this->redirectToSpotifyAuthorizeUrl();
        }
    }
167253
public function accessTokens()
    {
        if (is_null($this->accessTokenRequests)) {
            $this->accessTokenRequests = new AccessTokenRequest($this->client);
        }

        return $this->accessTokenRequests;
    }
1181398
public function getContext() {
        return new StepContextContext(
            $this->version,
            $this->solution['flowSid'],
            $this->solution['engagementSid'],
            $this->solution['stepSid']
        );
    }
721171
public function getContext()
    {

        if (is_null($this->context) && !is_null($this->contextId)) {
            $this->context = Context::fromRecordId($this->contextId, $this->getDataConnector());
        }

        return $this->context;

    }
827104
final protected function getContext() : array
    {
        $context = [
            'request' => empty($this->contexts['request']) ? $this->generateRequest() : $this->contexts['request']
        ];

        // Add User Context
        if (empty($this->contexts['user']) === false) {
            $context['user'] = $this->contexts['user'];
        }

        // Add Custom Context
        if (empty($this->contexts['custom']) === false) {
            $context['custom'] = $this->contexts['custom'];
        }

        // Add Tags Context
        if (empty($this->contexts['tags']) === false) {
            $context['tags'] = $this->contexts['tags'];
        }

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

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

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

        return $this->context;
    }
607208
protected function _actionGetaccesstoken($context)
    {
        $this->getAPI()->requestAccessToken($this->getRequest());

        $token = (array) $this->getAPI()->getToken();
        $consumer = (array) $this->_consumer;

        AnRequest::set('session.oauth', array(
                            'api' => $this->getAPI()->getName(),
                            'token' => $token,
                            'consumer' => $consumer
                        ));

        $return = AnRequest::get('session.return', 'raw', null);

        if ($return) {
            $context->append(array('data' => array('return' => $return)));
        }
    }
1176863
public function getCommandContext()
    {
        $context = parent::getCommandContext();
        $context->response = $this->getResponse();
        $context->request = $this->getRequest();

        return $context;
    }
510065
final protected function getContextChoices()
    {
        $contextChoices = [];
        /* @var ContextInterface $context */
        foreach ($this->contextManager->findAll() as $context) {
            $contextChoices[$context->getId()] = $context->getName();
        }

        return $contextChoices;
    }
516322
public function authenticateRequest(DispatcherContext $context)
    {
        $request = $context->request;

        if($request->headers->has('Authorization'))
        {
            $authorization = $request->headers->get('Authorization');

            if(stripos($authorization, 'basic') === 0)
            {
                $exploded = explode(':', base64_decode(substr($authorization , 6)));
                if (count($exploded) == 2) {
                    list($username, $password) = $exploded;
                }

                if($username)
                {
                    $user = $this->getObject('user.provider')->getUser($username);

                    if($user->getId())
                    {
                        //Check user password
                        if (!$user->verifyPassword($password)) {
                            throw new ControllerExceptionRequestNotAuthenticated('Wrong password');
                        }

                        //Check user enabled
                        if (!$user->isEnabled()) {
                            throw new ControllerExceptionRequestNotAuthenticated('Account disabled');
                        }

                        //Login the user
                        $this->loginUser($user->getId());

                        return true;
                    }
                    else throw new ControllerExceptionRequestNotAuthenticated('Wrong username');
                }
                else throw new ControllerExceptionRequestNotAuthenticated('Invalid username');
            }
        }
    }
1372655
public function contextAction()
    {
        $tokenStorage = $this->get('security.token_storage');

        $token = $tokenStorage->getToken();
        $user = $token->getUser();

        $output = '<pre>';
        $output .= 'Token class: '.get_class($token).PHP_EOL;
        $output .= 'User class:  '.(is_object($user) ? get_class($user) : $user).PHP_EOL;
        $output .= PHP_EOL;
        $output .= 'Token username: ';
        $output .= print_r($token->getUsername(), 1).PHP_EOL;
        $output .= 'Token attributes: ';
        $output .= print_r($token->getAttributes(), 1).PHP_EOL;
        $output .= 'Token credentials: ';
        $output .= print_r($token->getCredentials(), 1).PHP_EOL;
        $output .= 'Token roles: ';
        $output .= print_r($token->getRoles(), 1).PHP_EOL;

        return new Response($output);
    }