コード例 #1
0
 /**
  * @param string $secondFactorId
  * @return ProofOfPossessionResult
  */
 public static function secondFactorCreated($secondFactorId)
 {
     if (!is_string($secondFactorId)) {
         throw InvalidArgumentException::invalidType('string', 'secondFactorId', $secondFactorId);
     }
     return new self(self::STATUS_CHALLENGE_OK, $secondFactorId);
 }
コード例 #2
0
 /**
  * @param string $secondFactorId
  * @return ProofOfPossessionResult
  */
 public static function secondFactorCreated($secondFactorId)
 {
     if (!is_string($secondFactorId)) {
         throw InvalidArgumentException::invalidType('string', 'secondFactorId', $secondFactorId);
     }
     $result = new self();
     $result->secondFactorId = $secondFactorId;
     return $result;
 }
 /**
  * @param RequestStack $requestStack
  * @param string $defaultLocale
  * @param string[] $supportedLocales
  */
 public function __construct(RequestStack $requestStack, $defaultLocale, $supportedLocales)
 {
     if (!is_string($defaultLocale)) {
         throw InvalidArgumentException::invalidType('string', 'defaultLocale', $defaultLocale);
     }
     foreach ($supportedLocales as $key => $supportedLocale) {
         if (!is_string($supportedLocale)) {
             $parameterName = sprintf('supportedLocales[%s]', $key);
             throw InvalidArgumentException::invalidType('string', $parameterName, $supportedLocale);
         }
     }
     $this->requestStack = $requestStack;
     $this->defaultLocale = $defaultLocale;
     $this->supportedLocales = $supportedLocales;
 }