ixnode / php-naming-conventions
PHP Naming Conventions
Installs: 1 412
Dependents: 6
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^8.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.13
- ixnode/bash-version-manager: ^0.1.8
- phpmd/phpmd: ^2.13
- phpstan/phpstan: ^1.9
- phpunit/phpunit: ^9.5
- povils/phpmnd: ^3.0
- rector/rector: ^0.15.1
README
This library translate a given string or convention into another convention. The following conventions are supported:
Installation
composer require ixnode/php-naming-conventions
vendor/bin/php-naming-conventions -V
php-naming-conventions 0.1.0 (12-18-2022 01:17:26) - Björn Hempel <bjoern@hempel.li>
Usage
use Ixnode\PhpNamingConventions\NamingConventions;
$rawString = 'Group Private'; print (new NamingConventions($rawString))->getTitle(); // (string) Group Private print (new NamingConventions($rawString))->getPascalCase(); // (string) GroupPrivate print (new NamingConventions($rawString))->getCamelCase(); // (string) groupPrivate print (new NamingConventions($rawString))->getUnderscored(); // (string) group_private print (new NamingConventions($rawString))->getConstant(); // (string) GROUP_PRIVATE print (new NamingConventions($rawString))->getConfig(); // (string) group.private print (new NamingConventions($rawString))->getSeparated(); // (string) group-private print (new NamingConventions($rawString))->getRaw(); // (string) Group Private print (new NamingConventions($rawString))->getWords(); // (array) [[0] => group, [1] => private]
Development
git clone git@github.com:ixnode/php-naming-conventions.git && cd php-naming-conventions
composer install
composer test
License
This tool is licensed under the MIT License - see the LICENSE file for details