<?php
final class NamingUtils {
  public static function toUpperCamelCase($text) {
    $text = strstr($text, '_') === FALSE ? $text : str_replace(' ', '', ucwords(str_replace('_', ' ', strtolower($text))));
    return strtoupper(substr($text, 0, 1)) . substr($text, 1);
  }
  public static function toLowerSnakeCase($text) {
    $text = strstr($text, '_') === FALSE ? substr(preg_replace('/([A-Z])/', '_${1}', ucfirst($text)), 1) : $text;
    return strtolower($text);
  }
}
//EOF.
