futape/array-utility

A library of array utilities

2.0.0 2019-12-30 13:33 UTC

This package is auto-updated.

Last update: 2024-05-29 04:34:47 UTC


README

This library offers a set of array utilities.

Utility functions are implemented as static functions in an abstract class, which is never expected to be instantiated.

Install

composer require futape/array-utility

Usage

use Futape\Utility\ArrayUtility\Arrays;

print_r(
    Arrays::flatten(
        [
            'foo',
            [
                'bar'
            ]
        ]
    )
); // ["foo", "bar"]

Testing

The library is tested by unit tests using PHP Unit.

To execute the tests, install the composer dependencies (including the dev-dependencies), switch into the tests directory and run the following command:

../vendor/bin/phpunit