Skip to content

Commit

Permalink
getReducedRecord fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
yapro committed May 20, 2024
1 parent c8313d6 commit 0501757
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Handler/JsonToStdErrHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public function getReducedRecord(array &$record, $keyName): string
$excessCharactersInTheRecord = mb_strlen($result) - self::MAX_RECORD_LENGTH;
if ($excessCharactersInTheRecord > 0) {
// находим насколько мы должны подрезать value:
$valueAsString = $this->getJson($value);
$valueAsString = is_string($value) ? $value : $this->getJson($value);
$newValueMaxLength = mb_strlen($valueAsString) - $excessCharactersInTheRecord - $explanationLength;
if ($newValueMaxLength > 0) {// даем пояснение + подрезаем value:
$record[$keyName][$key] = $explanation . mb_substr($valueAsString, 0, $newValueMaxLength);
Expand Down

0 comments on commit 0501757

Please sign in to comment.