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

Simplify humanize

This commit is contained in:
Lucas Michot
2014-09-29 13:08:57 +02:00
parent c31e41f57a
commit f00e3d5d80

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();
}