当前位置: 首页>>代码示例>>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;未经允许,请勿转载。