GetServiceStdClassFactory::__construct()   A
last analyzed

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
dl 0
loc 3
rs 10
c 1
b 0
f 0
eloc 1
nc 1
nop 2
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
     * @param array<mixed>|null $factoryOptions
15
     */
16
    public function __construct(private readonly mixed $dependency, array $factoryOptions = null)
17
    {
18
        parent::__construct($factoryOptions);
19
    }
20
21
    /**
22
     * @throws ContainerExceptionInterface
23
     */
24
    public function __invoke(ContainerInterface $container, string $requestedName, array $options = null): \stdClass
25
    {
26
        $dependency = $this->getService($container, $this->dependency, $requestedName);
27
28
        $service = new \stdClass();
29
        $service->dependency = $dependency;
30
31
        return $service;
32
    }
33
}
34