| Total Complexity | 5 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | final class DeprecationProxy extends Proxy |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @param class-string $interface |
||
|
|
|||
| 11 | */ |
||
| 12 | 6 | public function __construct( |
|
| 13 | string $interface, |
||
| 14 | bool $singleton = false, |
||
| 15 | private readonly string|\BackedEnum|null $scope = null, |
||
| 16 | private readonly ?string $version = null, |
||
| 17 | private readonly ?string $message = null, |
||
| 18 | ) { |
||
| 19 | 6 | if (($scope === null || $version === null) && $message === null) { |
|
| 20 | 3 | throw new \InvalidArgumentException('Scope and version or custom message must be provided.'); |
|
| 21 | } |
||
| 22 | |||
| 23 | 3 | parent::__construct($interface, $singleton); |
|
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @return class-string |
||
| 28 | */ |
||
| 29 | 2 | public function getInterface(): string |
|
| 41 | } |
||
| 42 | } |
||
| 43 |