Remove boolean formatter.
This commit is contained in:
parent
2cbb1fe860
commit
4d3ed88b7b
@ -1,33 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of web3.php package.
|
||||
*
|
||||
* (c) Kuan-Cheng,Lai <alk03073135@gmail.com>
|
||||
*
|
||||
* @author Peter Lai <alk03073135@gmail.com>
|
||||
* @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;
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user