Source of file UnderscoreToCamelcase.php
Size: 0,979 Bytes - Last Modified: 2015-12-22T09:42:40-05:00
../src/Filter/UnderscoreToCamelcase.php
123456789101112131415161718192021222324252627282930313233
Covered by 5 test(s):
3435
Covered by 5 test(s):
36
Covered by 5 test(s):
37
Covered by 5 test(s):
38
Covered by 5 test(s):
3940
Covered by 5 test(s):
41
Covered by 5 test(s):
4243
Covered by 5 test(s):
444546
| <?php /** * string to upper filter * * @category PHP * @package MvcLite * @subpackage Filter * @since File available since release 1.1.x * @author Cory Collier <corycollier@corycollier.com> */ namespace MvcLite\Filter; use MvcLite\FilterAbstract as FilterAbstract; /** * string to upper filter * * @category PHP * @package MvcLite * @subpackage Filter * @since Class available since release 1.1.x * @author Cory Collier <corycollier@corycollier.com> */ class UnderscoreToCamelcase extends FilterAbstract { /** * (non-PHPdoc) * @see \MvcLite\FilterAbstract::filter() */ public function filter($word = '') { $words = explode('_', $word); foreach ($words as $i => $word) { if (! $i) { $words[$i] = strtolower($word); continue; } $words[$i] = ucwords($word); } return implode('', $words); } } |