# depicter/2.0.0/modules/GuzzleHttp/BodySummarizer.php

Depicter — Popup &amp; Slider Builder, version 2.0.0. 29 lines.

- Page: https://pluginprobe.com/plugins/depicter/2.0.0/code/modules/GuzzleHttp/BodySummarizer.php
- Raw: https://pluginprobe.com/plugins/depicter/2.0.0/raw/modules/GuzzleHttp/BodySummarizer.php
- Modified: 2022-06-01T06:26:20+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/depicter/2.0.0/code/modules/GuzzleHttp/BodySummarizer.php#L10-L20`.

```php
<?php

namespace Depicter\GuzzleHttp;

use Depicter\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
            ? \Depicter\GuzzleHttp\Psr7\Message::bodySummary($message)
            : \Depicter\GuzzleHttp\Psr7\Message::bodySummary($message, $this->truncateAt);
    }
}

```
