2017 © Pedro Peláez
 

library case-helper

Easily convert between camelCase, PascalCase, kebab-case, snake_case, SCREAMING_SNAKE_CASE, Train-Case, and string case!

image

nabil1337/case-helper

Easily convert between camelCase, PascalCase, kebab-case, snake_case, SCREAMING_SNAKE_CASE, Train-Case, and string case!

  • Tuesday, July 4, 2017
  • by nabil1337
  • Repository
  • 1 Watchers
  • 15 Stars
  • 55,785 Installations
  • PHP
  • 5 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 2 Versions
  • 14 % Grown

The README.md

CaseHelper

Easily convert between camelCase, PascalCase, kebab-case, snake_case, SCREAMING_SNAKE_CASE, Train-Case, and string case!, (*1)

Note about fork

The original package, nabil1337/case-helper, has been abandoned and this repo has taken over ownership., (*2)

How to use

use CaseHelper\CaseHelperFactory;

$ch = CaseHelperFactory::make(CaseHelperFactory::INPUT_TYPE_CAMEL_CASE);

$ch->toPascalCase('myStr');

// => returns 'MyStr'

You need to specify which type your input has when calling the factories' make()-method. To do that, use one of the following constants:, (*3)

  • CaseHelperFactory::INPUT_TYPE_SPACE_CASE for space case
  • CaseHelperFactory::INPUT_TYPE_CAMEL_CASE for camelCase
  • CaseHelperFactory::INPUT_TYPE_PASCAL_CASE for PascalCase
  • CaseHelperFactory::INPUT_TYPE_KEBAB_CASE for kebab-case
  • CaseHelperFactory::INPUT_TYPE_SNAKE_CASE for snake_case
  • CaseHelperFactory::INPUT_TYPE_SCREAMING_SNAKE_CASE for SCREAMING_SNAKE_CASE
  • CaseHelperFactory::INPUT_TYPE_TRAIN_CASE for Train-Case

Twig

Want to use it with Twig? Check out this great example., (*4)

Tests

This project was mainly (although not completely) written using TDD. Tests can be run using phpunit., (*5)

Contributing

If you want to contribute, please follow the used standards and add or extend tests., (*6)

The Versions

04/07 2017

dev-master

9999999-dev

Easily convert between camelCase, PascalCase, kebab-case, snake_case, SCREAMING_SNAKE_CASE, Train-Case, and string case!

  Sources   Download

MIT

The Requires

 

The Development Requires

06/12 2014

0.1.0

0.1.0.0

Easily convert between camelCase, PascalCase, kebab-case, snake_case, SCREAMING_SNAKE_CASE, Train-Case, and string case!

  Sources   Download

MIT

The Development Requires