Completed
Push — master ( 81ce9d...1672d9 )
by Oleg
03:54
created

EntityNamePluralDecorator   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A decorate() 0 7 2
1
<?php
2
declare(strict_types=1);
3
4
namespace SlayerBirden\DFCodeGeneration\Generator\Controllers;
5
6
use SlayerBirden\DFCodeGeneration\Util\Lexer;
7
8
class EntityNamePluralDecorator implements DataProviderDecoratorInterface
9
{
10 4
    public function decorate(array $data): array
11
    {
12 4
        if (isset($data['entityName'])) {
13 4
            $data['pluralEntityName'] = Lexer::getPluralForm($data['entityName']);
14
        }
15
16 4
        return $data;
17
    }
18
}
19