petrenkoanton/key-normalizer

将 snake_case 转换为 camelCase 及反之

v2.0.0 2024-02-20 14:29 UTC

This package is auto-updated.

Last update: 2024-09-20 15:51:15 UTC


README

PHP Version Latest Version on Packagist Total Downloads License

PHP Composer Coverage Status type-coverage psalm-level Build Status

安装 | 功能 | 用法 | 开发者 | 许可 | 相关项目

安装

要求

  • php 7.4 或更高版本

Composer

composer require petrenkoanton/key-normalizer

功能

公共方法

KeyNormalizer

用法

<?php

declare(strict_types=1);

use KeyNormalizer\KeyNormalizer;

KeyNormalizer::toCamelCase('test_test_test'); // testTestTest
KeyNormalizer::toSnakeCase('testTestTest'); // test_test_test

开发者

要求

实用工具

设置

初始化

创建 ./docker/.env

make init 

构建不同 php 版本的容器

php 8.0

make up80

php 8.1

make up81

php 8.2

make up82

php 8.3

make up83

在构建另一个 php 版本的容器之前,您需要运行此命令。它将删除网络和之前创建的容器。

make down

其他命令

进入容器内部

make inside

检查 php 版本

make php-v

检查包版本

make v

运行测试和代码检查器

运行 PHPUnit 测试并生成代码覆盖率

make test-c 

运行 Psalm

make psalm

运行 PHP_CodeSniffer

make phpcs

或者从容器内部运行一站式命令

composer check-all

许可

key-normalizer 库是开源软件,许可协议为 MIT 许可

相关项目