petrenkoanton / key-normalizer
Converts snake_case to camelCase and vice versa
v2.0.0
2024-02-20 14:29 UTC
Requires
- php: ^7.4|^8.0
Requires (Dev)
- php-coveralls/php-coveralls: ^2.7
- phpunit/phpunit: ^9.0
- psalm/plugin-phpunit: ^0.18.4
- ramsey/coding-standard: ^2.1
- squizlabs/php_codesniffer: ^3.8
- vimeo/psalm: ^5.16
README
Installation | Functionality | Usage | For developers | License | Related projects
Installation
Requirements
- php 7.4 or higher
Composer
composer require petrenkoanton/key-normalizer
Functionality
Public methods
KeyNormalizer
Method | Exception |
---|---|
toCamelCase(string $key): string | - |
toSnakeCase(string $key): string | - |
Usage
<?php declare(strict_types=1); use KeyNormalizer\KeyNormalizer; KeyNormalizer::toCamelCase('test_test_test'); // testTestTest KeyNormalizer::toSnakeCase('testTestTest'); // test_test_test
For developers
Requirements
Utils:
- make
- docker-compose
Setup
Initialize
Create ./docker/.env
make init
Build container with the different php version
php 8.0
make up80
php 8.1
make up81
php 8.2
make up82
php 8.3
make up83
Also you need to run this command before build container with another php version. It will remove network and previously created container.
make down
Other commands
Go inside of the container
make inside
Check php version
make php-v
Check package version
make v
Run tests and linters
Run PHPUnit tests with code coverage
make test-c
Run Psalm
make psalm
Run PHP_CodeSniffer
make phpcs
Or by all-in-one command from the inside of the container
composer check-all
License
The key-normalizer library is open-sourced software licensed under the MIT license.