PHP code example of ixnode / php-naming-conventions

1. Go to this page and download the library: Download ixnode/php-naming-conventions library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ixnode / php-naming-conventions example snippets


use Ixnode\PhpNamingConventions\NamingConventions;

$rawString = 'Group Private';

print (new NamingConventions($rawString))->getTitle();
// (string) Group Private

print (new NamingConventions($rawString))->getPascalCase();
// (string) GroupPrivate

print (new NamingConventions($rawString))->getCamelCase();
// (string) groupPrivate

print (new NamingConventions($rawString))->getUnderscored();
// (string) group_private

print (new NamingConventions($rawString))->getConstant();
// (string) GROUP_PRIVATE

print (new NamingConventions($rawString))->getConfig();
// (string) group.private

print (new NamingConventions($rawString))->getSeparated();
// (string) group-private

print (new NamingConventions($rawString))->getRaw();
// (string) Group Private

print (new NamingConventions($rawString))->getWords();
// (array) [[0] => group, [1] => private]
bash
composer 
bash
vendor/bin/php-naming-conventions -V
bash
php-naming-conventions 0.1.0 (12-18-2022 01:17:26) - Björn Hempel <[email protected]>
bash
git clone [email protected]:ixnode/php-naming-conventions.git && cd php-naming-conventions