3f/tool-bag

A bunch of idempotent static functions organised into categories to be reused in multiple projects.

1.1.4 2018-02-14 14:32 UTC

This package is not auto-updated.

Last update: 2024-09-15 05:01:29 UTC


README

Latest Stable Version Latest Unstable Version Build Status Scrutinizer Code Quality License Total Downloads

ToolBag

A bunch of idempotent static functions organised into categories to be reused in multiple projects.

Composer Installation

To install ToolBag, you first need to install Composer, a Package Manager for PHP, following these few steps:

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

You can run this command to easily access composer from anywhere on your system:

sudo mv composer.phar /usr/local/bin/composer

ToolBag Installation

Once you have installed Composer, it's easy install ToolBag.

  1. Edit your composer.json file, adding ToolBag to the require section:
{
    "require": {
        "3f/tool-bag": "dev-master"
    },
}
  1. Run the following command in your project root dir:
composer update

Usage

The tool bag provides four different helpers:

  • ArrayHelper -> common array methods
  • ClassHelper -> routines to handle classes
  • TextHelper -> routines to process strings
  • TimeHelper -> routines to handle and manipulate time

All the methods are static, so you don't need to create an class instance to use them.

if (ArrayHelper::isAssociative([1, 2, 3]))
  echo "It's an associative array.";
else
  echo "It's not associative array.";

Methods

ArrayHelper

ClassHelper

TextHelper

TimeHelper

Documentation

The documentation can be generated using Doxygen. A Doxyfile is provided for your convenience.

Authors

Filippo F. Fadda - filippo.fadda@programmazione.it - http://www.linkedin.com/in/filippofadda

Copyright

Copyright (c) 2016-2017, Filippo Fadda All rights reserved.

License

ToolBag is licensed under the Apache License, Version 2.0 - see the LICENSE file for details.