PluginProbe
Gmail SMTP / trunk
Gmail SMTP vtrunk
1.2.3.21 1.2.3.20 trunk 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.9 1.2.0 1.2.3.14 1.2.3.15 1.2.3.16 1.2.3.18 1.2.3.5
gmail-smtp / google-api-php-client / vendor / guzzlehttp / guzzle / src / BodySummarizer.php

BodySummarizer.php in Gmail SMTP trunk, at google-api-php-client/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