| Total Complexity | 5 |
| Total Lines | 54 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 3 | ||
| Bugs | 0 | Features | 2 |
| 1 | <?php |
||
| 7 | class Forwarding |
||
| 8 | { |
||
| 9 | public const CONTAINER_KEY = '_forwarding'; |
||
| 10 | |||
| 11 | /** |
||
| 12 | * @var string |
||
| 13 | */ |
||
| 14 | public string $pendingClass; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Initialize the forwarding. |
||
| 18 | * |
||
| 19 | * @return self |
||
| 20 | */ |
||
| 21 | 13 | public static function enable(): self |
|
| 22 | { |
||
| 23 | 13 | return new self(); |
|
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @param string $class |
||
| 28 | * |
||
| 29 | * @return $this |
||
| 30 | */ |
||
| 31 | 13 | public function from(string $class): static |
|
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @param string $destination |
||
| 40 | * |
||
| 41 | * @return $this |
||
| 42 | */ |
||
| 43 | 13 | public function to(string $destination): static |
|
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @param string $class |
||
| 55 | * |
||
| 56 | * @return string |
||
| 57 | */ |
||
| 58 | 13 | protected function resolve(string $class): string |
|
| 63 |