Total Complexity | 4 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
28 | class RawDefinition |
||
29 | { |
||
30 | /** @var mixed */ |
||
31 | private $service; |
||
32 | |||
33 | /** |
||
34 | * @param mixed $service |
||
35 | */ |
||
36 | 23 | public function __construct($service) |
|
37 | { |
||
38 | 23 | if ($service instanceof self) { |
|
39 | 1 | throw new ContainerResolutionException('unresolvable definition cannot contain itself.'); |
|
40 | } |
||
41 | |||
42 | 23 | $this->service = $service; |
|
43 | 23 | } |
|
44 | |||
45 | /** |
||
46 | * @return mixed $service |
||
47 | */ |
||
48 | 13 | public function __invoke() |
|
49 | { |
||
50 | 13 | return $this->service; |
|
51 | } |
||
52 | |||
53 | /** |
||
54 | * Build the raw definition service. |
||
55 | */ |
||
56 | 3 | public function build(string $id, BuilderFactory $builder): \PhpParser\Builder\Method |
|
60 | } |
||
61 | } |
||
62 |