コード例 #1
0
ファイル: AnonymousToken.php プロジェクト: acappel01/opencall
 /**
  * Constructor.
  *
  * @param string          $key   The key shared with the authentication provider
  * @param string          $user  The user
  * @param RoleInterface[] $roles An array of roles
  */
 public function __construct($key, $user, array $roles = array())
 {
     parent::__construct($roles);
     $this->key = $key;
     $this->setUser($user);
     $this->setAuthenticated(true);
 }
コード例 #2
0
ファイル: ComposedToken.php プロジェクト: Webapper/ParzRKit
 /**
  * Constructor
  * @param string $stream
  * @param AbstractToken $initialToken
  */
 public function __construct($stream, AbstractToken $initialToken)
 {
     parent::__construct($stream);
     $this->processed = '';
     $this->remaining = '';
     $this->setParent($initialToken->getParent());
     $this->addToken($initialToken);
 }
コード例 #3
0
 /**
  * Constructor.
  *
  * @param string          $user        The username (like a nickname, email address, etc.), or a UserInterface instance or an object implementing a __toString method.
  * @param string          $credentials This usually is the password of the user
  * @param string          $providerKey The provider key
  * @param RoleInterface[] $roles       An array of roles
  *
  * @throws \InvalidArgumentException
  */
 public function __construct($user, $credentials, $providerKey, array $roles = array())
 {
     parent::__construct($roles);
     if (empty($providerKey)) {
         throw new \InvalidArgumentException('$providerKey must not be empty.');
     }
     $this->setUser($user);
     $this->credentials = $credentials;
     $this->providerKey = $providerKey;
     parent::setAuthenticated(count($roles) > 0);
 }
コード例 #4
0
 /**
  * @param $tokenValue
  * @param null $tokenType
  * @param null $expiresIn
  * @param null $scope
  * @param null $state
  */
 public function __construct($tokenValue, $tokenType = null, $expiresIn = null, $scope = null, $state = null)
 {
     parent::__construct($tokenValue);
     if (is_null($tokenType)) {
         $tokenType = self::TOKEN_TYPE_BEARER;
     }
     $tokenTypeLCase = strtolower($tokenType);
     if (!$this->verifyTokenType($tokenTypeLCase)) {
         throw new \InvalidArgumentException("'{$tokenType}' is not a valid Token Type");
     }
     if (!is_null($expiresIn) && !is_int($expiresIn)) {
         throw new \InvalidArgumentException("'{$expiresIn}' is not a valid time value for 'expiresIn' property");
     }
     if (!is_null($scope) && !$this->isAValidStringType($scope)) {
         throw new \InvalidArgumentException("'{$scope}' is not a valid scope value, it must be a string");
     }
     $this->tokenType = $tokenTypeLCase;
     $this->expiresIn = $expiresIn;
     $this->scope = $scope;
     $this->state = $state;
 }
コード例 #5
0
ファイル: Date.php プロジェクト: marcbp/invoice-finder
 public function __construct($start, $length, \DateTime $date)
 {
     parent::__construct($start, $length);
     $this->date = $date;
 }
コード例 #6
0
 /**
  * {@inheritdoc}
  *
  * @param string $redirectUri
  */
 public function __construct($uuid = null, $token, Client $client, UserInterface $user = null, $scopes = null, $redirectUri)
 {
     parent::__construct($uuid, $token, $client, $user, $scopes);
     $this->setRedirectUri($redirectUri);
 }
コード例 #7
0
ファイル: Money.php プロジェクト: marcbp/invoice-finder
 public function __construct($start, $length, $amount)
 {
     parent::__construct($start, $length);
     $this->amount = $amount;
 }
コード例 #8
0
ファイル: Word.php プロジェクト: marcbp/invoice-finder
 public function __construct($start, $word)
 {
     parent::__construct($start, strlen($word));
     $this->word = $word;
     $this->ascii = iconv('UTF-8', 'ASCII//TRANSLIT', $word);
 }
コード例 #9
0
ファイル: InvoiceId.php プロジェクト: marcbp/invoice-finder
 public function __construct($start, $id)
 {
     parent::__construct($start, strlen($id));
     $this->id = $id;
 }