PHP code example of misatotremor / case-bundle

1. Go to this page and download the library: Download misatotremor/case-bundle 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/ */

    

misatotremor / case-bundle example snippets



// config/bundles.php

return [
    // ...
    Avro\CaseBundle\AvroCaseBundle::class => ['all' => true],
    // ...
];


use Avro\CaseBundle\Util\CaseConverter;

class SomeClass
{
    private $caseConverter;

    /**
     * @param CaseConverter $caseConverter
     */
    public function __construct(CaseConverter $caseConverter)
    {
        $this->caseConverter = $caseConverter;
    }

    /**
     * @param string $str
     */
    public function foo(string $str)
    {
        $camelCaseFormat = $this->converter->toCamelCase($str);
        $pascalCaseFormat = $this->converter->toPascalCase($str);
        $titleCaseFormat = $this->converter->toTitleCase($str);
        $underscoreCaseFormat = $this->converter->toUnderscoreCase($str);
    }
}