/** * 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); }
/** * 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); }
/** * 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); }
/** * @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; }
public function __construct($start, $length, \DateTime $date) { parent::__construct($start, $length); $this->date = $date; }
/** * {@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); }
public function __construct($start, $length, $amount) { parent::__construct($start, $length); $this->amount = $amount; }
public function __construct($start, $word) { parent::__construct($start, strlen($word)); $this->word = $word; $this->ascii = iconv('UTF-8', 'ASCII//TRANSLIT', $word); }
public function __construct($start, $id) { parent::__construct($start, strlen($id)); $this->id = $id; }