for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the Borobudur-DependencyInjection package.
*
* (c) Hexacodelabs <http://hexacodelabs.com>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
if (!function_exists('convert_to_snake_case')) {
/**
* Convert camel case style to snake case (underscore).
* @param string $camelCase
* @return string
* @author Iqbal Maulana <[email protected]>
* @created 8/13/15
function convert_to_snake_case($camelCase)
{
preg_match_all('!([A-Z][A-Z0-9]*(?=$|[A-Z][a-z0-9])|[0-9A-Za-z][a-z0-9]+)!', $camelCase, $matches);
return implode('_', array_map('strtolower', $matches[0]));
}
if (!function_exists('convert_to_camel_case')) {
* Convert snake case (underscore) style to camel case.
* @param string $snakeCase
* @created 9/8/15
function convert_to_camel_case($snakeCase)
return lcfirst(str_replace(' ', '', ucwords(str_replace('_', ' ', $snakeCase))));