cve / naming-convention-converter
This little package includes string utils which for example can convert underscore_string to camelCased and vice-versa
dev-master / 1.0.x-dev
2016-07-25 22:32 UTC
Requires
- php: ~5.6|~7.0
Requires (Dev)
- phpspec/phpspec: ^3.0
- squizlabs/php_codesniffer: ~2.3
This package is not auto-updated.
Last update: 2025-01-02 04:34:34 UTC
README
This library ships with simple naming convention converters.
Install
Via Composer
$ composer require cve/naming-convention-converter
Usage
use Cve\Naming\Validator\Argument; use Cve\Naming\Converter\CamelCaseToUnderscore; use Cve\Naming\Converter\UnderscoreToCamelCase; $validator = new Argument(); $camelCaseToUnderscoreConverter = new CamelCaseToUnderscore($validator); $underscoreToCamelCaseConverter = new UnderscoreToCamelCase($validator); // CamelCase --> camel_case $underscore = $camelCaseToUnderscoreConverter->convert('CamelCase'); // underscore_convention --> UderscoreConvention $camelCase = $underscoreToCamelCaseConverter->convert('underscore_convention');
Testing
$ composer test
Contributing
Please see CONTRIBUTING and CONDUCT for details.
Credits
License
The MIT License (MIT). Please see License File for more information.