1
0
mirror of https://github.com/danielstjules/Stringy.git synced 2025-08-12 16:24:00 +02:00

Merge pull request #47 from lucasmichot/factorize-humanize

Factorize humanize
This commit is contained in:
Daniel St. Jules
2014-09-29 07:43:43 -07:00

View File

@@ -365,8 +365,7 @@ class Stringy implements \Countable, \IteratorAggregate, \ArrayAccess
*/
public function humanize()
{
$str = str_replace('_id', '', $this->str);
$str = str_replace('_', ' ', $str);
$str = str_replace(array('_id', '_'), array('', ' '), $this->str);
return self::create($str, $this->encoding)->trim()->upperCaseFirst();
}