From 4d3ed88b7b92405237abcc4e8db05a68109c7b82 Mon Sep 17 00:00:00 2001 From: sc0Vu Date: Fri, 12 Jan 2018 12:22:32 +0800 Subject: [PATCH] Remove boolean formatter. --- src/Formatters/Boolean.php | 33 ------------------------------ test/unit/BooleanFormatterTest.php | 4 ++-- 2 files changed, 2 insertions(+), 35 deletions(-) delete mode 100644 src/Formatters/Boolean.php diff --git a/src/Formatters/Boolean.php b/src/Formatters/Boolean.php deleted file mode 100644 index 652190e..0000000 --- a/src/Formatters/Boolean.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * @author Peter Lai - * @license MIT - */ - -namespace Web3\Formatters; - -use InvalidArgumentException; -use Web3\Utils; -use Web3\Formatters\IFormatter; - -class Boolean implements IFormatter -{ - /** - * format - * - * @param mixed $value - * @return int - */ - public static function format($value) - { - if (!is_bool($value)) { - throw new InvalidArgumentException('The value to inputFormat function must be boolean.'); - } - return (int) $value; - } -} \ No newline at end of file diff --git a/test/unit/BooleanFormatterTest.php b/test/unit/BooleanFormatterTest.php index f5dff3b..2522092 100644 --- a/test/unit/BooleanFormatterTest.php +++ b/test/unit/BooleanFormatterTest.php @@ -3,7 +3,7 @@ namespace Test\Unit; use Test\TestCase; -use Web3\Formatters\Boolean; +use Web3\Formatters\BooleanFormatter; class BooleanFormatterTest extends TestCase { @@ -22,7 +22,7 @@ class BooleanFormatterTest extends TestCase public function setUp() { parent::setUp(); - $this->formatter = new Boolean; + $this->formatter = new BooleanFormatter; } /**