@param string $name
@param mixed $state

@return HttpContext
506246
public function replaceState(string $name, $state): self
    {
        $this->state[$name] = $state;
        return $this;
    }
1087120
public function setState($state)
    {
        if (!empty($state) && is_string($state) && ctype_print($state)) {
            $this->state = trim($state);
        }

        return $this;
    }
622742
public function getAuthUri($state, $redirectUri, array $scopes = array())
    {
        $params = array(
            'response_type' => 'code',
            'client_id' => $this->credentialsId,
            'scope' => implode(' ', $scopes),
            'redirect_uri' => $redirectUri,
            'state' => $state,
        );
        return $this->authEndpoint . (strpos($this->authEndpoint, '?') === false ? '?' : '&')
            . http_build_query($params, null, '&');
    }
714249
public function getState($state = null)
	{
		if ($state === null) {
			$state = $this->getValue();
		}

		if (!isset($this->states[$state])) {
			return 'default';
		}

		return $this->states[$state];
	}
1059743
public function execute(State $state) {
        $errors = [];
        foreach ($state->functionLookup as $name => $functions) {
            $calls = $state->callFinder->getCallsForFunction($name);
            foreach ($functions as $func) {
                foreach ($calls as $call) {
                    $errors = array_merge($errors, $this->verifyCall($func, $call[0], $state, $name));
                }
            }
        }
        foreach ($state->internalTypeInfo->functions as $name => $arginfo) {
            $calls = $state->callFinder->getCallsForFunction($name);
            foreach ($calls as $call) {
                $errors = array_merge($errors, $this->verifyInternalCall($arginfo, $call[0], $state, $name));
            }
        }
        foreach ($state->methodCalls as $call) {
            if (!$call->name instanceof Operand\Literal) {
                // Variable method call
                continue;
            }
            if (!$call->var->type || $call->var->type->type !== Type::TYPE_OBJECT) {
                // We don't know the type
                continue;
            }
            $name = strtolower($call->var->type->userType);
            if (!isset($state->classResolves[$name])) {
                // Could not find class
                continue;
            }
            foreach ($state->classResolves[$name] as $cn => $class) {
                // For every possible class that can resolve the type
                $method = $this->findMethod($class, $name);
                if (!$method) {
                    // Class does not *directly* implement method
                    continue;
                }
                $errors = array_merge($errors, $this->verifyCall($method, $call, $state, $cn . "->" . $name));
            }
        }
        return $errors;
    }
868392
public function setState(StateInterface $state): StateManagerInterface
    {
        $this->collection->offsetSet($state->getIdentifier()->getId(), $state);
        
        return $this;
    }
592282
public function setState(\Haven\PersonaBundle\Entity\State $state = null)
    {
        $this->state = $state;
    
        return $this;
    }
1172978
public function getSourceContext($name): Twig_Source
    {
        return new Twig_Source(Container::getCache()->get($this->getCacheKey($name)), $name);
    }
1284609
public function pushState($state)
		{
		$r = array_push($this->states, $state);
		$this->state = $this->states[count($this->states) - 1];
		return $r;
		}
760357
public function getPersistentState($name) {
	
		$name = static::getCookiePrefix() . ucfirst($name);
		
		if (array_key_exists($name, $this->persistentState)) {
			return $this->persistentState[$name];
		} else if (isset($_COOKIE[$name])) {
			return json_decode($_COOKIE[$name]);
		} else {
			return NULL;
		}
		
	}
1133295
public function setPushModelSupport($state) {
        if ($this->configured) throw new IllegalStateException('Configuration is frozen');

        $this->pushModelSupport = (bool) $state;

        foreach ($this->nestedTiles as $tile) {
            if ($tile && $tile->isPushModelSupport()===null) {
                $tile->setPushModelSupport($state);
            }
        }
        return $this;
    }
672107
private function determineStartState(InputInterface $input, string $state_name = null): StateInterface
    {
        if (!$state_name) {
            return $this->getInitialState();
        }
        if (!$this->states->has($state_name)) {
            throw new ExecutionError("Trying to start statemachine execution at unknown state: ".$state_name);
        }
        $start_state = $this->states->get($state_name);
        if ($start_state->isFinal()) {
            throw new ExecutionError("Trying to (re)execute statemachine at final state: ".$state_name);
        }
        if ($start_state->isInteractive() && !$input->hasEvent()) {
            throw new ExecutionError("Trying to resume statemachine executing without providing an event/signal.");
        }
        return $start_state->isInteractive()
            ? $this->activateTransition($input, Output::fromInput($start_state->getName(), $input))
            : $start_state;
    }
998662
private function pushCallerStatedClassName(StateInterface $state): ProxyInterface
    {
        $stateClass = \get_class($state);

        if (!isset($this->classesByStates[$stateClass])) {
            throw new \RuntimeException("Error, no original class name defined for $stateClass");
        }

        $this->callerStatedClassesStack->push($this->classesByStates[$stateClass]);

        return $this;
    }
722472
public static function loadPolicyByName($name)
  {
    $list = self::getPolicyList();

    if (!isset($list[$name])) {
      $list = self::getPolicyList(TRUE);
      if (!isset($list[$name])) {
        throw new UnknownPolicyException("$name does not exist.");
      }
      throw new UnavailablePolicyException("$name requires {$list[$name]['class']} but is not available in this environment.");
    }
    $definition = $list[$name];

    try {
      return self::getSource($definition['source'])->load($definition);
    }
    catch (\InvalidArgumentException $e) {
      Container::getLogger()->warning($e->getMessage());
      throw new UnavailablePolicyException("$name requires {$list[$name]['class']} but is not available in this environment.");
    }
  }
1079544
public function getState($name)
    {
        return empty($this->states[$name]) ? null: $this->states[$name];
    }
1235321
public function add(StateInterface $state): self
    {
        $cloned_set = clone $this;
        $cloned_set->internal_set->add($state);

        return $cloned_set;
    }
354420
public function setState(State $state = null): AbstractTable
    {
        $this->current = new State($this->initial->getName());

        if (!empty($state)) {
            $this->current->setName($state->getName());
            $this->current->syncState($state);
        }

        return $this;
    }