Changeset View
Changeset View
Standalone View
Standalone View
src/readableserializer/PhutilReadableSerializer.php
Context not available. | |||||
// yet. | // yet. | ||||
$limit = 1024; | $limit = 1024; | ||||
$str = self::printableValue($value); | $str = self::printableValue($value); | ||||
if (strlen($str) > $limit) { | if (@strlen($str) > $limit) { | ||||
if (is_string($value)) { | if (is_string($value)) { | ||||
$str = "'".substr($str, 1, $limit)."...'"; | $str = "'".@substr($str, 1, $limit)."...'"; | ||||
} else { | } else { | ||||
$str = substr($str, 0, $limit).'...'; | $str = @substr($str, 0, $limit).'...'; | ||||
} | } | ||||
} | } | ||||
Context not available. | |||||
* @task internal | * @task internal | ||||
*/ | */ | ||||
private static function addIndentation($value, $indent, $first_line) { | private static function addIndentation($value, $indent, $first_line) { | ||||
$lines = explode("\n", $value); | $lines = @explode("\n", $value); | ||||
$out = array(); | $out = array(); | ||||
foreach ($lines as $index => $line) { | foreach ($lines as $index => $line) { | ||||
$out[] = $index >= $first_line ? $indent.$line : $line; | $out[] = $index >= $first_line ? $indent.$line : $line; | ||||
Context not available. |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0