Skip to content

Commit 5bcf062

Browse files
Merge pull request #104 from solocommand/wordify
Wordify support
2 parents 7587104 + 5442fa1 commit 5bcf062

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

src/Util/Inflector.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public function underscore($word)
2121
}
2222
return strtolower(preg_replace('~(?<=\\w)([A-Z])~', '_$1', $word));
2323
}
24+
2425
/**
2526
* Convert word into dasherized format (e.g. some-name-here).
2627
*
@@ -31,6 +32,7 @@ public function dasherize($word)
3132
{
3233
return str_replace('_', '-', $this->underscore($word));
3334
}
35+
3436
/**
3537
* Convert word into camelized format (e.g. someNameHere).
3638
*
@@ -41,6 +43,7 @@ public function camelize($word)
4143
{
4244
return lcfirst($this->studlify($word));
4345
}
46+
4447
/**
4548
* Convert word into studly caps format (e.g. SomeNameHere).
4649
*
@@ -49,6 +52,17 @@ public function camelize($word)
4952
*/
5053
public function studlify($word)
5154
{
52-
return str_replace(" ", "", ucwords(strtr($this->underscore($word), "_", " ")));
55+
return str_replace(" ", "", $this->wordify($word));
56+
}
57+
58+
/**
59+
* Convert word into wordified format (e.g. Some Name Here).
60+
*
61+
* @param string $word
62+
* @return string
63+
*/
64+
public function wordify($word)
65+
{
66+
return ucwords(strtr($this->underscore($word), "_", " "));
5367
}
5468
}

src/Version.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
*/
1010
class Version
1111
{
12-
const VERSION = '0.3.18';
13-
const ID = 3018;
12+
const VERSION = '0.3.19';
13+
const ID = 3019;
1414
const MAJOR = 0;
1515
const MINOR = 3;
16-
const PATCH = 18;
16+
const PATCH = 19;
1717
const EXTRA = '';
1818
}

0 commit comments

Comments
 (0)