Skip to content
forked from jlinn/caseformat

A PHP case formatting tool inspired by Google Guava's CaseFormat.

License

Notifications You must be signed in to change notification settings

tmatei/caseformat

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

caseformat

Build Status

A PHP case formatting tool inspired by Google Guava's CaseFormat.

Installation Using Composer

Assuming composer.phar is located in your project's root directory, run the following command:

php composer.phar require jlinn/caseformat:~1.0

Usage

The following case formats are supported:

Format Example
LOWER_HYPHEN foo-bar
LOWER_UNDERSCORE foo_bar
LOWER_CAMEL fooBar
UPPER_CAMEL FooBar
UPPER_UNDERSCORE FOO_BAR

Conversion from LOWER_UNDERSCORE to UPPER_CAMEL, for example, is done like so:

use CaseFormat\CaseFormat;

$converted = CaseFormat::LOWER_UNDERSCORE("test_string")->to(CaseFormat::UPPER_CAMEL);

In the example above, the value of $converted would be "TestString".

About

A PHP case formatting tool inspired by Google Guava's CaseFormat.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published