glynnforrest/crutches

A PHP utility library

0.4.0 2015-03-27 22:01 UTC

This package is not auto-updated.

Last update: 2024-11-23 14:38:39 UTC


README

A PHP utility library

Build Status Packagist Software License

Included classes:

  • DotArray - Set and get values from complex array structures easily.
  • ItemList - Manipulate a list of objects (arrays with numeric keys). Methods are inspired by functional concepts such as map, filter and take. All methods that operate on the list return a new instance, leaving the original list unchanged.
  • MutableItemList - The same as ItemList, except all methods modify the object instead of returning a new instance.
  • Bitmask - A series of flags used to represent a group of properties (e.g. user permissions).
  • NamedBitmask - An extension of Bitmask that abstracts numeric flags away from the user, instead referring to named flags.
  • Roman - Convert integers to roman numerals and back again.

See the docs/ directory for detailed usage on each.

Installation

Crutches is installed via Composer. To add it to your project, simply add it to your composer.json file:

{
    "require": {
        "glynnforrest/crutches": "0.4.*"
    }
}

And run composer to update your dependencies:

curl -s http://getcomposer.org/installer | php
php composer.phar update

License

MIT