09ef1f000f
- Theme: momentry (custom theme with REST API routes) - Plugins: code-snippets (contains all API proxies) - Languages: zh_TW translations - Excludes: cache, backups, uploads, logs
24 lines
618 B
PHP
24 lines
618 B
PHP
<?php
|
|
|
|
namespace WPMailSMTP\Vendor\GuzzleHttp;
|
|
|
|
use WPMailSMTP\Vendor\Psr\Http\Message\MessageInterface;
|
|
final class BodySummarizer implements BodySummarizerInterface
|
|
{
|
|
/**
|
|
* @var int|null
|
|
*/
|
|
private $truncateAt;
|
|
public function __construct(?int $truncateAt = null)
|
|
{
|
|
$this->truncateAt = $truncateAt;
|
|
}
|
|
/**
|
|
* Returns a summarized message body.
|
|
*/
|
|
public function summarize(MessageInterface $message) : ?string
|
|
{
|
|
return $this->truncateAt === null ? Psr7\Message::bodySummary($message) : Psr7\Message::bodySummary($message, $this->truncateAt);
|
|
}
|
|
}
|