PHPackages                             void-sector/scalar-objects - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. void-sector/scalar-objects

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

void-sector/scalar-objects
==========================

Scalar Objects in PHP

613[2 issues](https://github.com/void-sector/scalar-objects/issues)PHP

Since Feb 7Pushed 11y ago2 watchersCompare

[ Source](https://github.com/void-sector/scalar-objects)[ Packagist](https://packagist.org/packages/void-sector/scalar-objects)[ RSS](/packages/void-sector-scalar-objects/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Scalar-objects
==============

[](#scalar-objects)

[![Build Status](https://camo.githubusercontent.com/008a44a38c49f26e64c52d289e5f76bc58e4fb784c5638735de8b65ec709f487/68747470733a2f2f7472617669732d63692e6f72672f766f69642d736563746f722f7363616c61722d6f626a656374732e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/void-sector/scalar-objects)[![Coverage Status](https://camo.githubusercontent.com/82397503e6d9b06f4f9c5e9018e386e7e4ceb299d9f3d73c46eb86e6a566c3bf/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f766f69642d736563746f722f7363616c61722d6f626a656374732f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/r/void-sector/scalar-objects?branch=master)[![Scrutinizer Quality Score](https://camo.githubusercontent.com/21b9fc51b36c3308ed3d62d04346e256b4b15afb25d29fe51f30f8125d27ad6f/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f766f69642d736563746f722f7363616c61722d6f626a656374732f6261646765732f7175616c6974792d73636f72652e706e673f733d65613733663035613636363038643938656139353363313064383936646138306232623737616132)](https://scrutinizer-ci.com/g/void-sector/scalar-objects/)

Supports method calls on primitive types in PHP. Allows you to use [Type Hinting](http://www.php.net/manual/en/language.oop5.typehinting.php) on the primitives in your OO project. Values are validated when constructed using there own validators. The project is [PSR-1](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md), [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) 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](http://en.wikipedia.org/wiki/Open/closed_principle). Please take a look at the [Open Issues](https://github.com/void-sector/scalar-objects/issues?state=open) for more information.

Examples
--------

[](#examples)

**String Example:**

```
