code style

This commit is contained in:
Tobias Munk
2014-07-03 01:57:22 +02:00
parent 7c04ff048f
commit a799eeb9ce

View File

@@ -331,7 +331,7 @@ class BaseInflector
*/ */
public static function camel2id($name, $separator = '-', $strict = false) public static function camel2id($name, $separator = '-', $strict = false)
{ {
$regex = ($strict)?'/[A-Z]/':'/(?<![A-Z])[A-Z]/'; $regex = $strict ? '/[A-Z]/' : '/(?<![A-Z])[A-Z]/';
if ($separator === '_') { if ($separator === '_') {
return trim(strtolower(preg_replace($regex, '_\0', $name)), '_'); return trim(strtolower(preg_replace($regex, '_\0', $name)), '_');
} else { } else {