Files
drmaterac.pl/modules/pshowsso/deps/guzzlehttp/guzzle/src/BodySummarizer.php
Jacek Pyziak 778ee26fe4 Add Symfony Deprecation Contracts package
- Created CHANGELOG.md to maintain version history.
- Added README.md with usage instructions for the trigger_deprecation() function.
- Initialized composer.json for the Symfony Deprecation Contracts library, specifying dependencies and autoloading.
2025-12-15 08:43:18 +01:00

23 lines
664 B
PHP

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