承接 ashdevelops/php-case 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ashdevelops/php-case

最新稳定版本:v1.0.0

Composer 安装命令:

composer require ashdevelops/php-case

包简介

Composer package to detect case styles from arbitrary strings and convert them to other styles.

README 文档

README

Contributors Contributors Forks Stargazers Issues MIT License

caseconvert

A simple library for converting arbitrary case style texts to other cases.

Supported cases

  • camelCase
  • PascalCase
  • snake_case
  • kebab-case
  • dot.case

Getting Started

Prerequisites

  • PHP >= 8.1.0

Installation

Get it via composer:

composer require ashdevelops/php-case 

Usage

Detect the case:

<?php

use CaseConverter\CaseDetector;
use CaseConverter\Validators\PascalCaseValidator;

include 'vendor/autoload.php';

$arbitraryString = 'SomeArbitraryString';
$detector = new CaseDetector(new PascalCaseValidator());

echo $detector->detect($arbitraryString)->name; // string(6) "Pascal"

Snake case to camel:

 <?php

 use CaseConverter\CaseType;
 use CaseConverter\Converters\CamelCaseConverter;
 
 include 'vendor/autoload.php';
 
 $camelConverter = new CamelCaseConverter();
 echo $camelConverter->convert('camel_case', CaseType::Snake); // string(9) "camelCase"

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Top contributors:

contrib.rocks image

License

Distributed under the MIT License. See LICENSE.txt for more information.

统计信息

  • 总下载量: 20
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2024-08-14