From 5288b150f72b8f0675610b33aa28d802d34bcc31 Mon Sep 17 00:00:00 2001 From: sc0Vu Date: Thu, 11 Jan 2018 15:59:59 +0800 Subject: [PATCH] String formatter. --- src/Formatters/StringFormatter.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/Formatters/StringFormatter.php diff --git a/src/Formatters/StringFormatter.php b/src/Formatters/StringFormatter.php new file mode 100644 index 0000000..ccd1bdd --- /dev/null +++ b/src/Formatters/StringFormatter.php @@ -0,0 +1,30 @@ + + * + * @author Peter Lai + * @license MIT + */ + +namespace Web3\Formatters; + +use InvalidArgumentException; +use Web3\Utils; +use Web3\Formatters\IFormatter; + +class StringFormatter implements IFormatter +{ + /** + * format + * + * @param mixed $value + * @return string + */ + public static function format($value) + { + return Utils::toString($value); + } +} \ No newline at end of file