Generates a valid PSR-4 Compliant variable name from a string.
Install Zerotoprod\Psr4VarName
via Composer:
composer require zero-to-prod/psr4-varname
This will add the package to your project’s dependencies and create an autoloader entry for it.
use Zerotoprod\Psr4Classname\VarName;
VarName::generate('weird%characters*in^name'); // 'weird_characters_in_name';
Contributions, issues, and feature requests are welcome! Feel free to check the issues page if you want to contribute.
git checkout -b feature-branch
).git commit -m 'Add some feature'
).git push origin feature-branch
).