for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Class Inflector
*/
namespace EasyRedis\Helpers;
class Inflector
{
* Converts a CamelCase name into space-separated words.
* For example, 'PostTag' will be converted to 'Post Tag'.
* @param string $name the string to be converted
* @param bool $ucwords whether to capitalize the first letter in each word
* @return string the resulting words
public static function camel2words($name, $ucwords = true)
$label = strtolower(trim(str_replace([
'-',
'_',
'.',
], ' ', preg_replace('/(?<![A-Z])[A-Z]/', ' \0', $name))));
return $ucwords ? ucwords($label) : $label;
}