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