| Total Complexity | 4 |
| Total Lines | 24 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | final class Reference implements ReferenceInterface |
||
| 29 | { |
||
| 30 | private string $id; |
||
| 31 | |||
| 32 | 27 | private function __construct(string $id) |
|
| 33 | { |
||
| 34 | 27 | $this->id = $id; |
|
| 35 | 27 | } |
|
| 36 | |||
| 37 | /** |
||
| 38 | * @throws InvalidConfigException If ID is not string. |
||
| 39 | */ |
||
| 40 | 28 | public static function to($id): self |
|
| 41 | { |
||
| 42 | 28 | if (!is_string($id)) { |
|
| 43 | 1 | throw new InvalidConfigException('Reference ID must be string.'); |
|
| 44 | } |
||
| 45 | |||
| 46 | 27 | return new self($id); |
|
| 47 | } |
||
| 48 | |||
| 49 | 27 | public function resolve(DependencyResolverInterface $container) |
|
| 52 | } |
||
| 53 | } |
||
| 54 |