setContext($context); } public function getContext() { return $this->context; } public function setContext($context) { if (false === in_array($context, [static::CONTEXT_OAUTH2_NATIVE, static::CONTEXT_OAUTH2_TOKEN, static::CONTEXT_NATIVE, static::CONTEXT_GUEST], true)) { throw new InvalidArgumentException(sprintf('`%s` is not a valid context', $context)); } $this->context = $context; return $this; } }