for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Wandu\Database\Support;
class Helper
{
/**
* @see http://stackoverflow.com/a/1589535
* @param string $text
* @return string
*/
public static function camelCaseToUnderscore($text)
return strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', $text));
}
* @param string $glue
* @param string $input
* @param int $multiplier
* @param string $prefix
* @param string $suffix
public static function stringRepeat($glue, $input, $multiplier, $prefix = '', $suffix = '')
if ($multiplier === 0) {
return $prefix . $suffix;
return $prefix . $input . str_repeat($glue . $input, $multiplier - 1) . $suffix;
* @param array $input
* @param string $itemPrefix
* @param string $itemSuffix
public static function arrayImplode($glue, $input, $itemPrefix = '', $itemSuffix = '')
if (!count($input)) {
return '';
return $itemPrefix . implode($itemSuffix . $glue . $itemPrefix, $input) . $itemSuffix;
* @param string $name
public static function normalizeName($name)
return "`" . implode('`.`', explode('.', $name)) . "`";