Changeset View
Changeset View
Standalone View
Standalone View
src/xsprintf/PhutilTerminalString.php
Show All 9 Lines | final class PhutilTerminalString extends Phobject { | ||||
public function __construct($string) { | public function __construct($string) { | ||||
$this->string = $string; | $this->string = $string; | ||||
} | } | ||||
public function __toString() { | public function __toString() { | ||||
return $this->string; | return $this->string; | ||||
} | } | ||||
public function applyWrap() { | |||||
$string = (string)$this; | |||||
$string = phutil_console_wrap($string); | |||||
return new self($string); | |||||
} | |||||
public function applyIndent($depth, $with_prefix = true) { | |||||
$string = (string)$this; | |||||
$string = phutil_console_wrap($string, $depth, $with_prefix); | |||||
return new self($string); | |||||
} | |||||
public static function escapeStringValue($value, $allow_whitespace) { | public static function escapeStringValue($value, $allow_whitespace) { | ||||
if ($value instanceof PhutilTerminalString) { | if ($value instanceof PhutilTerminalString) { | ||||
return (string)$value; | return (string)$value; | ||||
} | } | ||||
$value = (string)$value; | $value = (string)$value; | ||||
static $escape_map; | static $escape_map; | ||||
Show All 38 Lines |