php common utility library

1.3.0 2018-08-02 04:13 UTC

This package is not auto-updated.

Last update: 2024-12-22 08:14:18 UTC


README

PHP Common Utility Library

Collection

Collection is an object that wrap associative array, and work like an associative array.

Collection is json serializer aware. See, JsonKit.

Example

use ROH\Util\Collection;

// instantiate empty collection
$collection = new Collection();

// instantiate filled collection
$filledCollection = new Collection([
    'foo' => 'bar'
]);

// define attribute
$collection['subCollection'] = $filledCollection;

// get foo of sub collection attribute from parent collection attribute
echo $collection['subCollection']['foo'];

Composition

Compose array of callable / function to be called later as sequence of function call.

Inflector

Inflection library

Injector

Simple dependency injector

Options

Compose options from array, or configuration files

StringFormatter

Format string from string template