Server IP : 162.213.251.212 / Your IP : 18.221.124.202 [ Web Server : LiteSpeed System : Linux business55.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : allssztx ( 535) PHP Version : 8.1.31 Disable Function : NONE Domains : 1 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/allssztx/www/easybuyer/vendor/facade/flare-client-php/src/Truncation/ |
Upload File : |
<?php namespace Facade\FlareClient\Truncation; class TrimStringsStrategy extends AbstractTruncationStrategy { public static function thresholds() { return [1024, 512, 256]; } public function execute(array $payload): array { foreach (static::thresholds() as $threshold) { if (! $this->reportTrimmer->needsToBeTrimmed($payload)) { break; } $payload = $this->trimPayloadString($payload, $threshold); } return $payload; } protected function trimPayloadString(array $payload, int $threshold): array { array_walk_recursive($payload, function (&$value) use ($threshold) { if (is_string($value) && strlen($value) > $threshold) { $value = substr($value, 0, $threshold); } }); return $payload; } }