当前位置: 首页>>代码示例>>PHP>>正文


PHP Token::__toString方法代码示例

本文整理汇总了PHP中Token::__toString方法的典型用法代码示例。如果您正苦于以下问题:PHP Token::__toString方法的具体用法?PHP Token::__toString怎么用?PHP Token::__toString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Token的用法示例。


在下文中一共展示了Token::__toString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testReadAccessorsReturnPropertiesValues

 public function testReadAccessorsReturnPropertiesValues()
 {
     $value = 'bob';
     $type = new TokenType(TokenType::DYNAMIC_ARRAY_TYPE);
     $token = new Token($value, $type);
     $this->assertEquals($value, $token->getValue());
     $this->assertEquals($type->getValue(), $token->getType());
     $this->assertEquals('(DYNAMIC_ARRAY_TYPE) bob', $token->__toString());
 }
开发者ID:nelmio,项目名称:alice,代码行数:9,代码来源:TokenTest.php

示例2: testToString

 public function testToString()
 {
     $p = new Position(5, 10);
     $t = new Token(Token::IDENTIFIER, "ident", $p);
     $this->assertEquals("<'ident', IDENTIFIER, (5, 10)>", $t->__toString());
     $p = new Position(5, 10, "/foo/bar.ebnf");
     $t = new Token(Token::IDENTIFIER, "ident", $p);
     $this->assertEquals("<'ident', IDENTIFIER, /foo/bar.ebnf (5, 10)>", $t->__toString());
     $p = new Position(5, 10, "/foo/bar.ebnf");
     $t = new Token(Token::IDENTIFIER, "", $p);
     $this->assertEquals("<IDENTIFIER, /foo/bar.ebnf (5, 10)>", $t->__toString());
     $p = new Position(5, 10, "/foo/bar.ebnf");
     $t = new Token(Token::IDENTIFIER, "a-very-very-very-very-long-identifier", $p);
     $this->assertEquals("<'a-very-very-ver...', IDENTIFIER, /foo/bar.ebnf (5, 10)>", $t->__toString());
 }
开发者ID:bgarrels,项目名称:ebnf,代码行数:15,代码来源:TokenTest.php

示例3: go

 /**
  * Main function: does the backup
  */
 private function go()
 {
     $this->phpflickr = new oPhpFlickr($this->appid, $this->secret, true);
     // Check for Flickr username
     if ($this->flickr_username != false) {
         $this->dialog->info(1, "Looking for Flickr id for username {$this->flickr_username}");
         $r = $this->phpflickr->people_findByUsername($this->flickr_username);
         $this->flickr_id = $r['nsid'];
     }
     // Check for Flickr ID
     if (!$this->flickr_id) {
         $this->dialog->error("Missing Flickr ID");
         exit(1);
     }
     // Create phpFlickr object
     $ini_array = parse_ini_file($this->configuration_file, true);
     if (!is_array($ini_array) || !is_array($ini_array[$this->flickr_id]) || !$ini_array[$this->flickr_id][CONFIG_ACCESS_TOKEN] || !$ini_array[$this->flickr_id][CONFIG_ACCESS_TOKEN_SECRET]) {
         $this->dialog->info(1, "No information about Flickr id {$this->flickr_id} in configuration file {$this->configuration_file}");
         $token = $this->authorize();
     } else {
         $token = new Token($ini_array[$this->flickr_id][CONFIG_ACCESS_TOKEN], $ini_array[$this->flickr_id][CONFIG_ACCESS_TOKEN_SECRET]);
     }
     if (!$token || $token->getToken() == '' || $token->getSecret() == '') {
         $this->dialog->error("No access token for Flickr id {$this->flickr_id} in configuration file {$this->configuration_file}: " . $token->__toString());
         exit(1);
     }
     $this->phpflickr->setToken($token);
     // Do the backup
     if ($this->backup_all_photos) {
         $this->get_photo_list();
     }
     $this->backup_photos();
     if ($this->backup_all_sets) {
         $this->get_set_list();
     }
     $this->backup_sets();
 }
开发者ID:spacelama,项目名称:Offlickr2,代码行数:40,代码来源:Offlickr2.php


注:本文中的Token::__toString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。