• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Payload\PayloadInterface类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中CL\Slack\Payload\PayloadInterface的典型用法代码示例。如果您正苦于以下问题:PHP PayloadInterface类的具体用法?PHP PayloadInterface怎么用?PHP PayloadInterface使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: serialize

 /**
  * @param PayloadInterface $payload
  *
  * @return array The serialized payload data
  */
 public function serialize(PayloadInterface $payload)
 {
     if ($payload instanceof AdvancedSerializeInterface) {
         $payload->beforeSerialize($this->serializer);
     }
     $serializedPayload = $this->serializer->serialize($payload, 'json');
     if (!$serializedPayload || !is_string($serializedPayload)) {
         throw new \RuntimeException(sprintf('Failed to serialize payload; expected it to be a string, got: %s', var_export($serializedPayload, true)));
     }
     return json_decode($serializedPayload, true);
 }
开发者ID:benoitgeerinck,项目名称:slack,代码行数:16,代码来源:PayloadSerializer.php


示例2: getExpectedPayloadData

 /**
  * @inheritdoc
  *
  * @param ImHistoryPayload $payload
  */
 protected function getExpectedPayloadData(PayloadInterface $payload)
 {
     return ['channel' => $payload->getImId(), 'latest' => $payload->getLatest(), 'oldest' => $payload->getOldest(), 'count' => $payload->getCount()];
 }
开发者ID:salt-lick,项目名称:slack,代码行数:9,代码来源:ImHistoryPayloadTest.php


示例3: getExpectedPayloadData

 /**
  * @inheritdoc
  *
  * @param ChannelsKickPayload $payload
  */
 protected function getExpectedPayloadData(PayloadInterface $payload)
 {
     return ['channel' => $payload->getChannelId(), 'user' => $payload->getUserId()];
 }
开发者ID:salt-lick,项目名称:slack,代码行数:9,代码来源:ChannelsKickPayloadTest.php


示例4: getExpectedPayloadData

 /**
  * @inheritdoc
  *
  * @param OauthAccessPayload $payload
  */
 protected function getExpectedPayloadData(PayloadInterface $payload)
 {
     return ['client_id' => $payload->getClientId(), 'client_secret' => $payload->getClientSecret(), 'code' => $payload->getCode(), 'redirect_uri' => $payload->getRedirectUri()];
 }
开发者ID:salt-lick,项目名称:slack,代码行数:9,代码来源:OauthAccessPayloadTest.php


示例5: getExpectedPayloadData

 /**
  * @inheritdoc
  *
  * @param ApiTestPayload $payload
  */
 protected function getExpectedPayloadData(PayloadInterface $payload)
 {
     return ['error' => $payload->getError(), 'foo' => $payload->getArgument('foo')];
 }
开发者ID:salt-lick,项目名称:slack,代码行数:9,代码来源:ApiTestPayloadTest.php


示例6: getExpectedPayloadData

 /**
  * {@inheritdoc}
  *
  * @param ChatPostMessagePayload $payload
  */
 protected function getExpectedPayloadData(PayloadInterface $payload)
 {
     /** @var Attachment $attachment */
     $attachment = $payload->getAttachments()->first();
     /** @var AttachmentField $attachmentField */
     $attachmentField = $attachment->getFields()->first();
     return ['channel' => $payload->getChannel(), 'text' => $payload->getText(), 'username' => $payload->getUsername(), 'icon_emoji' => $payload->getIconEmoji(), 'icon_url' => $payload->getIconUrl(), 'unfurl_media' => $payload->getUnfurlMedia(), 'unfurl_links' => $payload->getUnfurlLinks(), 'link_names' => $payload->getLinkNames(), 'parse' => $payload->getParse(), 'attachments' => json_encode([['title' => $attachment->getTitle(), 'title_link' => $attachment->getTitleLink(), 'image_url' => $attachment->getImageUrl(), 'author_name' => $attachment->getAuthorName(), 'author_link' => $attachment->getAuthorLink(), 'author_icon' => $attachment->getAuthorIcon(), 'pre_text' => $attachment->getPreText(), 'text' => $attachment->getText(), 'color' => $attachment->getColor(), 'fallback' => $attachment->getFallback(), 'fields' => [['title' => $attachmentField->getTitle(), 'value' => $attachmentField->getValue(), 'short' => $attachmentField->isShort()]]]])];
 }
开发者ID:benoitgeerinck,项目名称:slack,代码行数:13,代码来源:ChatPostMessagePayloadTest.php


示例7: getExpectedPayloadData

 /**
  * @inheritdoc
  *
  * @param ImListPayload $payload
  */
 protected function getExpectedPayloadData(PayloadInterface $payload)
 {
     return ['exclude_archived' => $payload->isExcludeArchived()];
 }
开发者ID:salt-lick,项目名称:slack,代码行数:9,代码来源:ImListPayloadTest.php


示例8: getExpectedPayloadData

 /**
  * @inheritdoc
  *
  * @param AbstractSearchPayload $payload
  */
 protected function getExpectedPayloadData(PayloadInterface $payload)
 {
     return ['query' => $payload->getQuery(), 'page' => $payload->getPage(), 'count' => $payload->getCount(), 'highlight' => $payload->getHighlight(), 'sort' => $payload->getSort(), 'sort_dir' => $payload->getSortDir()];
 }
开发者ID:salt-lick,项目名称:slack,代码行数:9,代码来源:AbstractSearchPayloadTest.php


示例9: getExpectedPayloadData

 /**
  * {@inheritdoc}
  *
  * @param FilesListPayload $payload
  */
 protected function getExpectedPayloadData(PayloadInterface $payload)
 {
     return ['page' => $payload->getPage(), 'count' => $payload->getCount(), 'types' => $payload->getTypes(), 'user' => $payload->getUserId(), 'ts_from' => $payload->getTimestampFrom()->format('U'), 'ts_to' => $payload->getTimestampTo()->format('U')];
 }
开发者ID:benoitgeerinck,项目名称:slack,代码行数:9,代码来源:FilesListPayloadTest.php


示例10: getExpectedPayloadData

 /**
  * @inheritdoc
  *
  * @param UsersSetPresencePayload $payload
  */
 protected function getExpectedPayloadData(PayloadInterface $payload)
 {
     return ['presence' => $payload->getPresence()];
 }
开发者ID:salt-lick,项目名称:slack,代码行数:9,代码来源:UsersSetPresencePayloadTest.php


示例11: getExpectedPayloadData

 /**
  * @inheritdoc
  *
  * @param FilesUploadPayload $payload
  */
 protected function getExpectedPayloadData(PayloadInterface $payload)
 {
     return ['title' => $payload->getTitle(), 'content' => $payload->getContent(), 'filename' => $payload->getFilename(), 'file_type' => $payload->getFileType(), 'channels' => $payload->getChannelsAsString()];
 }
开发者ID:salt-lick,项目名称:slack,代码行数:9,代码来源:FilesUploadPayloadTest.php


示例12: getExpectedPayloadData

 /**
  * {@inheritdoc}
  *
  * @param StarsListPayload $payload
  */
 protected function getExpectedPayloadData(PayloadInterface $payload)
 {
     return ['count' => $payload->getCount(), 'page' => $payload->getPage(), 'user' => $payload->getUserId()];
 }
开发者ID:wogsland,项目名称:slack,代码行数:9,代码来源:StarsListPayloadTest.php


示例13: getExpectedPayloadData

 /**
  * @inheritdoc
  *
  * @param ChannelsSetTopicPayload $payload
  */
 protected function getExpectedPayloadData(PayloadInterface $payload)
 {
     return ['channel' => $payload->getChannelId(), 'topic' => $payload->getTopic()];
 }
开发者ID:salt-lick,项目名称:slack,代码行数:9,代码来源:ChannelsSetTopicPayloadTest.php


示例14: getExpectedPayloadData

 /**
  * {@inheritdoc}
  *
  * @param ChannelsSetPurposePayload $payload
  */
 protected function getExpectedPayloadData(PayloadInterface $payload)
 {
     return ['channel' => $payload->getChannelId(), 'purpose' => $payload->getPurpose()];
 }
开发者ID:benoitgeerinck,项目名称:slack,代码行数:9,代码来源:ChannelsSetPurposePayloadTest.php


示例15: getExpectedPayloadData

 /**
  * {@inheritdoc}
  *
  * @param GroupsClosePayload $payload
  */
 protected function getExpectedPayloadData(PayloadInterface $payload)
 {
     return ['channel' => $payload->getGroupId()];
 }
开发者ID:wogsland,项目名称:slack,代码行数:9,代码来源:GroupsClosePayloadTest.php


示例16: getExpectedPayloadData

 /**
  * {@inheritdoc}
  *
  * @param GroupsCreatePayload $payload
  */
 protected function getExpectedPayloadData(PayloadInterface $payload)
 {
     return ['name' => $payload->getName()];
 }
开发者ID:benoitgeerinck,项目名称:slack,代码行数:9,代码来源:GroupsCreatePayloadTest.php


示例17: getExpectedPayloadData

 /**
  * {@inheritdoc}
  *
  * @param ImMarkPayload $payload
  */
 protected function getExpectedPayloadData(PayloadInterface $payload)
 {
     return ['ts' => $payload->getSlackTimestamp(), 'channel' => $payload->getImId()];
 }
开发者ID:wogsland,项目名称:slack,代码行数:9,代码来源:ImMarkPayloadTest.php


示例18: getExpectedPayloadData

 /**
  * {@inheritdoc}
  *
  * @param UsersAdminInvitePayload $payload
  */
 protected function getExpectedPayloadData(PayloadInterface $payload)
 {
     return ['email' => $payload->getEmail()];
 }
开发者ID:salt-lick,项目名称:slack,代码行数:9,代码来源:UsersAdminInvitePayloadTest.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Entity\User类代码示例发布时间:2022-05-23
下一篇:
PHP Filesystem\Path类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap