Minor fixes during tests

This commit is contained in:
Dennis Eichhorn 2017-08-21 16:04:58 +02:00
parent 886d2beff5
commit adc335d0e6
2 changed files with 7 additions and 2 deletions

View File

@ -24,7 +24,7 @@ namespace phpOMS\Utils;
* @link http://orange-management.com * @link http://orange-management.com
* @since 1.0.0 * @since 1.0.0
*/ */
class JsonBuilder implements \Serializable class JsonBuilder implements \Serializable, \JsonSerializable
{ {
/** /**
@ -110,4 +110,9 @@ class JsonBuilder implements \Serializable
{ {
$this->json = json_decode($serialized); $this->json = json_decode($serialized);
} }
public function jsonSerialize()
{
return $this->json();
}
} }

View File

@ -266,7 +266,7 @@ class StringUtils
*/ */
public static function mb_trim(string $string, string $charlist = ' ') : string public static function mb_trim(string $string, string $charlist = ' ') : string
{ {
if (is_null($charlist)) { if ($charlist === ' ') {
return trim($string); return trim($string);
} else { } else {
$charlist = str_replace('/', '\/', preg_quote($charlist)); $charlist = str_replace('/', '\/', preg_quote($charlist));