2017 © Pedro Peláez
 

library scalar-objects

Scalar Objects in PHP

image

void-sector/scalar-objects

Scalar Objects in PHP

  • Saturday, February 7, 2015
  • by mikoweb
  • Repository
  • 2 Watchers
  • 5 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 2 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Scalar-objects

Build Status Coverage Status Scrutinizer Quality Score, (*1)

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., (*2)

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., (*3)

Examples

String Example:, (*4)

<?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:, (*5)

<?php

require('./vendor/autoload.php');

use Scalar\Float;

$float = new Float(33.3333333);

$float->ceil();

echo $float->getValue() . PHP_EOL; // results in: 34.0

Contribute

If you got suggestions, idea's or improvements , please fork the project and initialize a pull request., (*6)

Happy Coding!!, (*7)

The Versions

07/02 2015

dev-master

9999999-dev

Scalar Objects in PHP

  Sources   Download

MIT

The Development Requires

by void-sector

php objects scalar