PluginProbe
AutomatorWP – No-Code Workflow Automation, Integration & Webhooks Plugin, now with AI / 6.0.3
AutomatorWP – No-Code Workflow Automation, Integration & Webhooks Plugin, now with AI v6.0.3
6.0.3 6.0.2 6.0.1 6.0.0 5.8.6 5.8.5 5.8.4 5.8.3 5.8.2 5.8.1 5.8.0 5.7.9.2 5.7.9.1 5.7.8 5.7.9 5.7.6 5.7.7 5.7.5 5.7.4 5.7.3 5.7.2 5.7.1 trunk 5.6.0 5.6.1 All 34 releases
automatorwp / integrations / mailchimp / vendor / guzzlehttp / guzzle / src / BodySummarizer.php

BodySummarizer.php in AutomatorWP – No-Code Workflow Automation, Integration & Webhooks Plugin, now with AI 6.0.3, at integrations/mailchimp/vendor/guzzlehttp/guzzle/src/BodySummarizer.php

29 lines 608 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace GuzzleHttp;
4
5 use Psr\Http\Message\MessageInterface;
6
7 final class BodySummarizer implements BodySummarizerInterface
8 {
9 /**
10 * @var int|null
11 */
12 private $truncateAt;
13
14 public function __construct(?int $truncateAt = null)
15 {
16 $this->truncateAt = $truncateAt;
17 }
18
19 /**
20 * Returns a summarized message body.
21 */
22 public function summarize(MessageInterface $message): ?string
23 {
24 return $this->truncateAt === null
25 ? Psr7\Message::bodySummary($message)
26 : Psr7\Message::bodySummary($message, $this->truncateAt);
27 }
28 }
29