GhostManSec
Server: LiteSpeed
System: Linux premium197.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: parhudrw (1725)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/parhudrw/ve.anqa.it/wp-content/plugins/depicter/modules/GuzzleHttp/BodySummarizer.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);
    }
}