Test Failed
Push — feature/gacela-config-callable ( f0c396 )
by Chema
04:24
created

CorrectCompanyGenerator   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 18
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A company() 0 5 1
A __construct() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GacelaTest\Feature\Framework\UsingGacelaConfigFn\LocalConfig\Domain\Greeter;
6
7
use GacelaTest\Feature\Framework\BindingInterfacesWithInnerDependencies\LocalConfig\Domain\GreeterGeneratorInterface;
8
9
final class CorrectCompanyGenerator implements GreeterGeneratorInterface
10
{
11
    private CustomNameGenerator $nameGenerator;
12
13
    /**
14
     * @param CustomNameGenerator $nameGenerator This will be automagically resolved.
15
     *                                           See gacela.php in this Feature test.
16
     */
17
    public function __construct(CustomNameGenerator $nameGenerator)
18
    {
19
        $this->nameGenerator = $nameGenerator;
20
    }
21
22
    public function company(string $name): string
23
    {
24
        $names = $this->nameGenerator->getNames();
25
26
        return "Hello {$name}! Name: {$names}";
27
    }
28
}
29