linio/util

Generic component that provides many helper classes, such as JSON parsing, conversion tools, data structures, etc.

4.0.0 2022-02-17 00:08 UTC

README

Latest Stable Version License Build Status Scrutinizer Code Quality

Linio Util is a generic component that provides many helper classes, such as JSON parsing, conversion tools, data structures, etc.

Install

The recommended way to install Linio Util is through composer.

$ composer require linio/util

Tests

To run the test suite, you need install the dependencies via composer, then run PHPUnit.

$ composer install
$ vendor/bin/phpunit

JSON

The library includes a JSON wrapper around json_encode and json_decode, allowing you to handle parsing errors with exceptions.

<?php

Json::encode(['foo' => 'bar']);
Json::decode('{"foo":"bar"}');

Inflector

The library includes a small string manipulation library, with common operations in string datatypes.

<?php

Inflector::pascalize('my-test'); // MyTest
Inflector::camelize('my-test'); // myTest