當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Token::__construct方法代碼示例

本文整理匯總了PHP中Token::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP Token::__construct方法的具體用法?PHP Token::__construct怎麽用?PHP Token::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Token的用法示例。


在下文中一共展示了Token::__construct方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 /**
  * Constructor.
  *
  * @param string $key   The key shared with the authentication provider
  * @param string $user  The user
  * @param Role[] $roles An array of roles
  */
 public function __construct($key, $user, array $roles = array())
 {
     parent::__construct($roles);
     $this->key = $key;
     $this->user = $user;
     parent::setAuthenticated(true);
 }
開發者ID:notbrain,項目名稱:symfony,代碼行數:14,代碼來源:AnonymousToken.php

示例2: __construct

 public function __construct($tokenURL, $redirectURL, $clientID, $clientSecret)
 {
     parent::__construct($tokenURL, $redirectURL);
     // Google OAuth2 has the addition of 'client id' and 'client secret'
     $this->clientID = $clientID;
     $this->clientSecret = $clientSecret;
 }
開發者ID:webds,項目名稱:phpgooglespreadsheetapi,代碼行數:7,代碼來源:googleapi.php

示例3: __construct

 /**
  * Constructs a new conditional token.
  * 
  * @param Token $condition The condition to check
  * @param Token $resultTrue The token to use when the condition returns true
  * @param Token $resultFalse The token to use when the condition returns false
  */
 public function __construct(Token $condition, Token $resultTrue, Token $resultFalse)
 {
     parent::__construct(static::PREC_TERNARY_IF);
     $this->condition = $condition;
     $this->resultTrue = $resultTrue;
     $this->resultFalse = $resultFalse;
 }
開發者ID:Assumeru,項目名稱:php-gettext,代碼行數:14,代碼來源:ConditionalToken.php

示例4: __construct

 public function __construct($lexeme)
 {
     parent::__construct('STRING', $lexeme);
     // if there's a comment in the literal string, it needs to go
     $lexeme = preg_replace('/^\\{!--.*?--\\}$/', '', $lexeme);
     $this->value = preg_replace('/\\s+/', ' ', $lexeme);
 }
開發者ID:vigm,項目名稱:advancedMD,代碼行數:7,代碼來源:String.php

示例5: __construct

 /**
  * Constructor.
  */
 public function __construct($user, $credentials, array $roles = array())
 {
     parent::__construct($roles);
     $this->setUser($user);
     $this->credentials = $credentials;
     parent::setAuthenticated((bool) count($roles));
 }
開發者ID:notbrain,項目名稱:symfony,代碼行數:10,代碼來源:UsernamePasswordToken.php

示例6: __construct

 /**
  * Constructor.
  */
 public function __construct($user, $credentials, array $roles = null)
 {
     parent::__construct(null === $roles ? array() : $roles);
     if (null !== $roles) {
         $this->setAuthenticated(true);
     }
     $this->user = $user;
     $this->credentials = $credentials;
 }
開發者ID:rosstuck,項目名稱:Pok,代碼行數:12,代碼來源:PreAuthenticatedToken.php

示例7: __construct

 /**
  * Create new "Value object" which represent one mathematical operator.
  * 
  * @param string $value string representation of this operator
  * @param integer $priority priority value of this token
  * @param integer $associativity one of Operator associative constants
  * @throws \InvalidArgumentException
  */
 public function __construct($value, $priority, $associativity)
 {
     if (!in_array($associativity, array(self::O_LEFT_ASSOCIATIVE, self::O_NONE_ASSOCIATIVE, self::O_RIGHT_ASSOCIATIVE))) {
         throw new \InvalidArgumentException(sprintf('Invalid associativity: %s', $associativity));
     }
     $this->priority = (int) $priority;
     $this->associativity = (int) $associativity;
     parent::__construct($value, Token::T_OPERATOR);
 }
開發者ID:oat-sa,項目名稱:lib-beeme,代碼行數:17,代碼來源:Operator.php

示例8: __construct

 public function __construct(array $data)
 {
     parent::__construct($data);
     foreach (array('state') as $key) {
         if (!array_key_exists($key, $data)) {
             throw new TokenException(sprintf("missing field '%s'", $key));
         }
     }
     $this->setState($data['state']);
 }
開發者ID:Kistriver,項目名稱:craftengine0,代碼行數:10,代碼來源:State.php

示例9: __construct

 public function __construct($dir, $type, $uid = '', $sid = '', $key = '')
 {
     if (empty($dir)) {
         trigger_error('未指定類目錄', E_USER_ERROR);
     }
     if (empty($type)) {
         trigger_error('未指定接口類型', E_USER_ERROR);
     }
     $this->dir = $dir;
     parent::__construct($type, $uid, $sid, $key);
 }
開發者ID:lz1988,項目名稱:stourwebcms,代碼行數:11,代碼來源:CU.class.php

示例10: __construct

 /**
  * {@inheritdoc}
  */
 public function __construct($id, $rawContent, $context)
 {
     parent::__construct($id, $rawContent, $context);
     foreach (preg_split('/\\s+/', trim($rawContent)) as $tag) {
         $tag = trim($tag);
         if (!$tag) {
             continue;
         }
         $this->tagList[] = new Tag($tag);
     }
 }
開發者ID:instaclick,項目名稱:gherkincs,代碼行數:14,代碼來源:TagLine.php

示例11: __construct

 public function __construct(array $data)
 {
     parent::__construct($data);
     foreach (array('token_type', 'access_token') as $key) {
         if (!array_key_exists($key, $data)) {
             throw new TokenException(sprintf("missing field '%s'", $key));
         }
     }
     $this->setAccessToken($data['access_token']);
     $this->setTokenType($data['token_type']);
     $expiresIn = array_key_exists('expires_in', $data) ? $data['expires_in'] : null;
     $this->setExpiresIn($expiresIn);
 }
開發者ID:Kistriver,項目名稱:craftengine0,代碼行數:13,代碼來源:AccessToken.php

示例12: __construct

 public function __construct($lexeme)
 {
     parent::__construct('MISC', $lexeme);
     // always encode misc
     $this->value = str_replace(array('{', '}'), array('{', '}'), $lexeme);
 }
開發者ID:vigm,項目名稱:advancedMD,代碼行數:6,代碼來源:Other.php

示例13: __construct

 /**
  * @param mixed|null $value
  * @param int|null $lineNumber
  */
 public function __construct($value = 'try', $lineNumber = null)
 {
     parent::__construct(T_TRY, $value, $lineNumber);
 }
開發者ID:aurimasniekis,項目名稱:epwt-codefactory,代碼行數:8,代碼來源:TryToken.php

示例14: __construct

 /**
  * @param mixed|null $value
  * @param int|null $lineNumber
  */
 public function __construct($value = 'endif', $lineNumber = null)
 {
     parent::__construct(T_ENDIF, $value, $lineNumber);
 }
開發者ID:aurimasniekis,項目名稱:epwt-codefactory,代碼行數:8,代碼來源:EndIfToken.php

示例15: __construct

 /**
  * @param mixed|null $value
  * @param int|null $lineNumber
  */
 public function __construct($value = '>=', $lineNumber = null)
 {
     parent::__construct(T_IS_GREATER_OR_EQUAL, $value, $lineNumber);
 }
開發者ID:aurimasniekis,項目名稱:epwt-codefactory,代碼行數:8,代碼來源:IsGreaterOrEqualToken.php


注:本文中的Token::__construct方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。