Passed
Pull Request — master (#9)
by Alex
08:16
created

GetServiceStdClassFactory::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
nc 1
nop 3
dl 0
loc 8
rs 10
c 1
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ArpTest\LaminasFactory\TestDouble;
6
7
use Arp\LaminasFactory\AbstractFactory;
8
use Psr\Container\ContainerExceptionInterface;
9
use Psr\Container\ContainerInterface;
10
11
class GetServiceStdClassFactory extends AbstractFactory
12
{
13
    /**
14
     * @var mixed
15
     */
16
    private $dependency;
17
18
    /**
19
     * @param mixed $dependency
20
     */
21
    public function __construct($dependency)
22
    {
23
        $this->dependency = $dependency;
24
25
        parent::__construct();
26
    }
27
28
    /**
29
     * @throws ContainerExceptionInterface
30
     */
31
    public function __invoke(ContainerInterface $container, string $requestedName, array $options = null): \stdClass
32
    {
33
        $dependency = $this->getService($container, $this->dependency, $requestedName);
34
35
        $service = new \stdClass();
36
        $service->dependency = $dependency;
37
38
        return $service;
39
    }
40
}
41