Refactor, use a Collection

wip
This commit is contained in:
Oliver Davies 2020-02-09 14:27:12 +00:00
parent 9418ba4ee7
commit b773e0f76f
6 changed files with 174 additions and 80 deletions

View file

@ -0,0 +1,17 @@
<?php
namespace Opdavies\DrupalModuleGenerator\Service;
class TestNameConverter
{
public function __invoke(string $moduleName)
{
$parts = explode('_', $moduleName);
$parts = array_map(function ($part) {
return ucfirst($part);
}, $parts);
return implode('', $parts).'Test';
}
}