Skip to content

Latest commit

 

History

History
59 lines (43 loc) · 838 Bytes

README.md

File metadata and controls

59 lines (43 loc) · 838 Bytes

Back

Format

BestServedCold\PhalueObjects\Format

UML

png

Classes

Byte

BestServedCold\PhalueObjects\Format\Byte\Binary
BestServedCold\PhalueObjects\Format\Byte\Decimal

Usage:

var_dump(Binary::fromString('100 MB')->getValue());
var_dump(Decimal::fromString('100 MB')->getValue());
var_dump(Binary::fromFloat(123456)->toString());
var_dump((string) Binary::fromFloat(1.208925819614629e24)); 

Outputs:

double(104857600)
double(100000000)
string(16) "120.56 Kilobytes"
string(11) "1 Yottabyte"

Csv

BestServedCold\PhalueObjects\Format\Csv

Json

BestServedcold\PhalueObjects\Format\Json

Xml

BestServedCold\PhalueObjects\Format\Xml

Yaml

BestServedCold\PhalueObjects\Format\Yaml