alexskrypnyk / str2name
Convert strings to named formats
Fund package maintenance!
alexskrypnyk
Patreon
Requires
- php: >=8.2
Requires (Dev)
- dealerdirect/phpcodesniffer-composer-installer: ^1
- drupal/coder: ^8.3
- phpmd/phpmd: ^2.13
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^11
- rector/rector: ^1.0.0
README
Convert strings to named formats
Generic formatters
Converters between generic formats
Named formatters
Installation and usage
Str2Name
is a self-contained class that can be included in any PHP
project directly or via Composer. It does not have any dependencies.
There are two ways to include Str2Name
in your project:
Direct download
-
Download the file from the releases page
-
Register the namespace in
composer.json
of your project:
{ "autoload": { "psr-4": { "AlexSkrypnyk\\Str2Name\\": "path/to/src/Str2Name.php" } } }
- Use it in your project:
<php use AlexSkrypnyk\Str2Name\Str2Name; class MyClass { public function myMethod() { $string = 'string to convert'; // Convert string to machine name. $string = Str2Name::machine($string); } }
Composer
- Require the package via Composer:
composer require alexskrypnyk/str2name
- Use it in your project:
<php use AlexSkrypnyk\Str2Name\Str2Name; class MyClass { public function myMethod() { $string = 'string to convert'; // Convert string to machine name. $string = Str2Name::machine($string); } }
Maintenance
composer install
composer lint
composer test
composer docs
Repository created using https://getscaffold.dev/ project scaffold template