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

CorrectCompanyGenerator::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
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