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


PHP StreamInterface::__toString方法代码示例

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


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

示例1: let

 function let(ServerRequestInterface $request, StreamInterface $stream, EventDispatcherInterface $dispatcher)
 {
     $payload = '
     {
       "object": "page",
       "entry": [
         {
           "id": "PAGE_ID",
           "time": 1473204787206,
           "messaging": [
             {
               "sender":{
                 "id":"USER_ID"
               },
               "recipient":{
                 "id":"PAGE_ID"
               },
               "timestamp":1458692752478,
               "message":{
                 "mid":"mid.1457764197618:41d102a3e1ae206a38",
                 "seq":73,
                 "text":"hello, world!",
                 "quick_reply": {
                   "payload": "DEVELOPER_DEFINED_PAYLOAD"
                 }
               }
             }   
           ]
         }
       ]
     } 
     ';
     $stream->__toString()->willReturn($payload);
     $signature = XHubSignature::compute($payload, 'secret');
     $request->getBody()->willReturn($stream);
     $request->getHeader('X-Hub-Signature')->willReturn(['sha1=' . $signature]);
     $this->beConstructedWith('secret', 'verify_token', $request, $dispatcher);
 }
开发者ID:tgallice,项目名称:fb-messenger-sdk,代码行数:38,代码来源:WebhookRequestHandlerSpec.php

示例2: testNullToString

 public function testNullToString()
 {
     $this->assertSame('', $this->stream->__toString());
 }
开发者ID:Golpha,项目名称:Http,代码行数:4,代码来源:StreamTestTrait.php

示例3: __toString

 public function __toString()
 {
     return $this->stream->__toString();
 }
开发者ID:Hikariii,项目名称:php-box-view,代码行数:4,代码来源:AbstractDecoratorStream.php

示例4: __toString

 /**
  * @return string
  */
 public function __toString()
 {
     return $this->responseData->__toString();
 }
开发者ID:caseyamcl,项目名称:wosclient,代码行数:7,代码来源:WosObject.php

示例5:

 function it_returns_an_APOD_object_with_the_same_date_the_response_has(Client $httpClient, ResponseInterface $response, StreamInterface $responseBodyStream)
 {
     $date = '2016-01-01';
     $responseBody = $this->defaultResponseBody;
     $responseBody['date'] = $date;
     $responseBodyStream->__toString()->willReturn(json_encode($responseBody));
     $response->getBody()->willReturn($responseBodyStream);
     $apod = $this->get();
     $datetime = $apod->getDateTime();
     $datetime->format('Y-m-d')->shouldBe($date);
 }
开发者ID:rodrigodiez,项目名称:how-i-code-php,代码行数:11,代码来源:ClientSpec.php

示例6: withBody

 public function withBody(StreamInterface $body)
 {
     $this->body = $body->__toString();
     return $this;
 }
开发者ID:fuelphp,项目名称:foundation,代码行数:5,代码来源:Cli.php


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