Skip to content

yakiv-khorunzhyi/scalar-type

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scalar Type

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.

About

Scalar type as object.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages