ixnode/php-naming-conventions
最新稳定版本:0.1.3
Composer 安装命令:
composer require ixnode/php-naming-conventions
包简介
PHP Naming Conventions
关键字:
README 文档
README
This library translate a given string or convention into another convention. The following conventions are supported:
| Convention | Representation |
|---|---|
raw |
A raw string |
words |
['a', 'raw', 'string'] |
title |
A Raw String |
pascalCase |
ARawString |
camelCase |
aRawString |
under_scored |
a_raw_string |
config |
a.raw.string |
constant |
A_RAW_STRING |
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
统计信息
- 总下载量: 5.36k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 6
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-12-18