Refactor, use a Collection
wip
This commit is contained in:
parent
9418ba4ee7
commit
b773e0f76f
6 changed files with 174 additions and 80 deletions
17
src/Service/TestNameConverter.php
Normal file
17
src/Service/TestNameConverter.php
Normal 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';
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue