yakiv-khorunzhyi / value-type
Scalar type as object.
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/yakiv-khorunzhyi/value-type
Requires
- php: ^5.6
Requires (Dev)
This package is auto-updated.
Last update: 2025-10-07 01:50:20 UTC
README
Installation
Install the latest version with:
$ composer require yakiv-khorunzhyi/scalar-type
Examples
$address = new Core\ScalarType('Country,city,street', Core\Types::STRING);
$address->setFormatRule(function ($val) {
return explode(',', $val);
});
var_dump($address->getFormattedValue());
var_dump($address->getValue());
var_dump($address->getType());
/*
1) array(3) {
[0]=>
string(7) "Country"
[1]=>
string(4) "city"
[2]=>
string(6) "street"
}
2) string(19) "Country,city,street"
3) string(6) "string"
*/
License
MIT license.