Cookie
2 years ago
Exception
2 years ago
Handler
2 years ago
BodySummarizer.php
2 years ago
BodySummarizerInterface.php
2 years ago
Client.php
2 years ago
ClientInterface.php
2 years ago
ClientTrait.php
2 years ago
HandlerStack.php
2 years ago
MessageFormatter.php
2 years ago
MessageFormatterInterface.php
2 years ago
Middleware.php
2 years ago
Pool.php
2 years ago
PrepareBodyMiddleware.php
2 years ago
RedirectMiddleware.php
2 years ago
RequestOptions.php
2 years ago
RetryMiddleware.php
2 years ago
TransferStats.php
2 years ago
Utils.php
2 years ago
functions.php
2 years ago
functions_include.php
2 years ago
BodySummarizer.php
24 lines
| 1 | <?php |
| 2 | |
| 3 | namespace YoastSEO_Vendor\GuzzleHttp; |
| 4 | |
| 5 | use YoastSEO_Vendor\Psr\Http\Message\MessageInterface; |
| 6 | final class BodySummarizer implements \YoastSEO_Vendor\GuzzleHttp\BodySummarizerInterface |
| 7 | { |
| 8 | /** |
| 9 | * @var int|null |
| 10 | */ |
| 11 | private $truncateAt; |
| 12 | public function __construct(int $truncateAt = null) |
| 13 | { |
| 14 | $this->truncateAt = $truncateAt; |
| 15 | } |
| 16 | /** |
| 17 | * Returns a summarized message body. |
| 18 | */ |
| 19 | public function summarize(\YoastSEO_Vendor\Psr\Http\Message\MessageInterface $message) : ?string |
| 20 | { |
| 21 | return $this->truncateAt === null ? \YoastSEO_Vendor\GuzzleHttp\Psr7\Message::bodySummary($message) : \YoastSEO_Vendor\GuzzleHttp\Psr7\Message::bodySummary($message, $this->truncateAt); |
| 22 | } |
| 23 | } |
| 24 |