mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-23 19:39:10 -04:00
ALPHA 3.0.2a
This commit is contained in:
@@ -20,6 +20,16 @@ use Prophecy\Call\Call;
|
||||
*/
|
||||
class StringUtil
|
||||
{
|
||||
private $verbose;
|
||||
|
||||
/**
|
||||
* @param bool $verbose
|
||||
*/
|
||||
public function __construct($verbose = true)
|
||||
{
|
||||
$this->verbose = $verbose;
|
||||
}
|
||||
|
||||
/**
|
||||
* Stringifies any provided value.
|
||||
*
|
||||
@@ -54,7 +64,7 @@ class StringUtil
|
||||
if (is_string($value)) {
|
||||
$str = sprintf('"%s"', str_replace("\n", '\\n', $value));
|
||||
|
||||
if (50 <= strlen($str)) {
|
||||
if (!$this->verbose && 50 <= strlen($str)) {
|
||||
return substr($str, 0, 50).'"...';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user