Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
huangzhhui committed Jun 14, 2018
1 parent 0d2dade commit 290a2f4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Helper/StringHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,16 @@ public static function ascii($value)
* Convert a value to camel case.
*
* @param string $value
* @param bool $lcfirst
* @return string
*/
public static function camel($value)
public static function camel($value, $lcfirst = true)
{
if (isset(static::$camelCache[$value])) {
return static::$camelCache[$value];
}

return static::$camelCache[$value] = lcfirst(static::studly($value));
return static::$camelCache[$value] = ($lcfirst ? lcfirst(static::studly($value)) : static::studly($value));
}

/**
Expand Down

0 comments on commit 290a2f4

Please sign in to comment.