instinct/types-autoboxing

This package is abandoned and no longer maintained. No replacement package was suggested.

Wrapping primitive types into objects automatically

v1.0.0-BETA2 2014-02-14 15:05 UTC

This package is auto-updated.

Last update: 2023-04-09 10:13:26 UTC


README

An implementation of the experimental PHP extension SPL Types.

Requirements

PHP 5.3.3 or above (at least 5.3.4 recommended to avoid potential bugs)

Installation

Using Composer, just add the following configuration to your composer.json:

{
    "require": {
        "instinct/types-autoboxing": "1.0.*"
    }
}

If you don't have Composer yet, download it following the instructions on http://getcomposer.org/ or just run the following command:

curl -sS https://getcomposer.org/installer | php

Now tell composer to download it by running the command:

php composer.phar update instinct/types-autoboxing

Examples

Bool::create($var); // Defined a new boolean type
$var = true;       // Assign it a new value
if ($var instanceof Bool) {
    // $var is always a Bool object
}

Contributing

Fork the project, create a feature branch, and send us a pull request.

To ensure a consistent code base, you should make sure the code follows the Coding Standards which we borrowed from Symfony.

If you would like to help take a look at the list of issues.

Contributors

See the list of contributors who participated in this project.

License

This library is licensed under the MIT License - see the LICENSE file for details

Running Tests

You can run the unit tests with the following command:

php composer.phar install --dev
phpunit