diff --git a/src/Briedis/ApiBuilder/Items/Float.php b/src/Briedis/ApiBuilder/Items/Decimal.php similarity index 85% rename from src/Briedis/ApiBuilder/Items/Float.php rename to src/Briedis/ApiBuilder/Items/Decimal.php index 590395e..83995a7 100644 --- a/src/Briedis/ApiBuilder/Items/Float.php +++ b/src/Briedis/ApiBuilder/Items/Decimal.php @@ -4,7 +4,7 @@ namespace Briedis\ApiBuilder\Items; -class Float extends BaseItem{ +class Decimal extends BaseItem{ const TYPE = 'float'; public function validateValue($value){ diff --git a/src/Briedis/ApiBuilder/StructureBuilder.php b/src/Briedis/ApiBuilder/StructureBuilder.php index b63e71c..5ee7aea 100644 --- a/src/Briedis/ApiBuilder/StructureBuilder.php +++ b/src/Briedis/ApiBuilder/StructureBuilder.php @@ -6,7 +6,7 @@ use Briedis\ApiBuilder\Items\BaseItem; use Briedis\ApiBuilder\Items\Boolean; -use Briedis\ApiBuilder\Items\Float; +use Briedis\ApiBuilder\Items\Decimal; use Briedis\ApiBuilder\Items\Integer; use Briedis\ApiBuilder\Items\Mixed; use Briedis\ApiBuilder\Items\String; @@ -90,7 +90,7 @@ public function str($name, $description = ''){ * @return StructureBuilder */ public function float($name, $description = ''){ - return $this->addItem(new Float($name, $description)); + return $this->addItem(new Decimal($name, $description)); } /** diff --git a/tests/MultiDepthValidatorTest.php b/tests/MultiDepthValidatorTest.php index c80e712..0dff37a 100644 --- a/tests/MultiDepthValidatorTest.php +++ b/tests/MultiDepthValidatorTest.php @@ -2,7 +2,7 @@ use Briedis\ApiBuilder\Exceptions\InvalidStructureException; -use Briedis\ApiBuilder\Items\Float; +use Briedis\ApiBuilder\Items\Decimal; use Briedis\ApiBuilder\StructureBuilder as SB; use Briedis\ApiBuilder\StructureValidator; @@ -64,7 +64,7 @@ public function testInvalidStructure(){ } catch(InvalidStructureException $e){ $caught = true; $fields = $e->getBadFields(); - $this->assertInstanceOf(get_class(new Float), $fields['s11.decimal'], 'Correct field is missing'); + $this->assertInstanceOf(get_class(new Decimal), $fields['s11.decimal'], 'Correct field is missing'); $this->assertEquals(1, count($fields), 'Bad parameter count matches'); } diff --git a/tests/SingleDepthValidatorTest.php b/tests/SingleDepthValidatorTest.php index 7de3e17..2d20625 100644 --- a/tests/SingleDepthValidatorTest.php +++ b/tests/SingleDepthValidatorTest.php @@ -2,7 +2,7 @@ use Briedis\ApiBuilder\Exceptions\InvalidStructureException; -use Briedis\ApiBuilder\Items\Float; +use Briedis\ApiBuilder\Items\Decimal; use Briedis\ApiBuilder\Items\Integer; use Briedis\ApiBuilder\StructureBuilder; use Briedis\ApiBuilder\StructureValidator; @@ -73,7 +73,7 @@ public function testInvalidParam(){ $fields = $e->getBadFields(); $this->assertInstanceOf(get_class(new Integer), $fields['id'], 'Correct field is invalid'); - $this->assertInstanceOf(get_class(new Float), $fields['decimal'], 'Correct field is invalid'); + $this->assertInstanceOf(get_class(new Decimal), $fields['decimal'], 'Correct field is invalid'); $this->assertEquals(2, count($fields), 'Bad parameter count matches'); } diff --git a/tests/TypeTest.php b/tests/TypeTest.php index 713e579..28568ac 100644 --- a/tests/TypeTest.php +++ b/tests/TypeTest.php @@ -2,7 +2,7 @@ use Briedis\ApiBuilder\Items\BaseItem; use Briedis\ApiBuilder\Items\Boolean; -use Briedis\ApiBuilder\Items\Float; +use Briedis\ApiBuilder\Items\Decimal; use Briedis\ApiBuilder\Items\Integer; use Briedis\ApiBuilder\Items\Mixed; use Briedis\ApiBuilder\Items\String; @@ -58,7 +58,7 @@ public function testIsFloat(){ '-1223', 1.234, 1e2, - ], new Float); + ], new Decimal); } public function testIsNotFloat(){ @@ -72,7 +72,7 @@ public function testIsNotFloat(){ '0xf4c3b00c', '0b10100111001', '0777', - ], new Float); + ], new Decimal); } public function testIsString(){