astrXbian/www/multitube/vendor/mattketmo/camel
qo-op c6bb759a7a multitube php-ipfs 2021-03-20 01:33:02 +01:00
..
src/Camel multitube php-ipfs 2021-03-20 01:33:02 +01:00
tests multitube php-ipfs 2021-03-20 01:33:02 +01:00
.gitignore multitube php-ipfs 2021-03-20 01:33:02 +01:00
.travis.yml multitube php-ipfs 2021-03-20 01:33:02 +01:00
LICENSE multitube php-ipfs 2021-03-20 01:33:02 +01:00
README.md multitube php-ipfs 2021-03-20 01:33:02 +01:00
composer.json multitube php-ipfs 2021-03-20 01:33:02 +01:00
phpunit.xml.dist multitube php-ipfs 2021-03-20 01:33:02 +01:00

README.md

Camel

Build status... Code quality... License MIT Packagist

Tiny library to handle words case transformation.

The main idea is to split the given word into several words and assemble them in another format.

Example: camelCase => [camel, Case] => camel_case

Installation

composer require mattketmo/camel

Usage

<?php

require __DIR__.'/vendor/autoload.php';

use Camel\CaseTransformer;
use Camel\Format;

$transformer1 = new CaseTransformer(new Format\SnakeCase, new Format\CamelCase);
$transformer2 = new CaseTransformer(new Format\CamelCase, new Format\ScreamingSnakeCase);

echo $transformer1->transform('hello_world'); // helloWorld
echo $transformer2->transform('helloWorld');  // HELLO_WORLD

Supported formats

  • camelCase
  • StudlyCaps
  • snake_case
  • SCREAMING_SNAKE_CASE
  • spinal-case

Unit Tests

Install phpunit via Composer:

composer install

Once installed, run the following command:

vendor/bin/phpunit

License

Camel is released under the MIT License. See the bundled LICENSE file for details.