Supports method calls on primitive types in PHP. Allows you to use Type Hinting on the primitives in your OO project. Values are validated when constructed using there own validators. The project is PSR-1, PSR-2 compatable.
The project is work in progress. I'm still trying to find a nice way to delegate the Operation calls following the Open/Closed Principle. Please take a look at the Open Issues for more information.
String Example:
<?php
require('./vendor/autoload.php');
use Scalar\String;
$string = new String('We love Fruit!');
$string->replace('Fruit', 'Coding');
$string->toUpper();
echo $string->getValue() . PHP_EOL; // results in: WE LOVE CODING!
Float Example:
<?php
require('./vendor/autoload.php');
use Scalar\Float;
$float = new Float(33.3333333);
$float->ceil();
echo $float->getValue() . PHP_EOL; // results in: 34.0
If you got suggestions, idea's or improvements , please fork the project and initialize a pull request.
Happy Coding!!