| Conditions | 4 |
| Paths | 6 |
| Total Lines | 10 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | 398 | public function __construct( |
|
| 18 | protected readonly string $interface, |
||
| 19 | public readonly bool $singleton = false, |
||
| 20 | public readonly ?\Closure $fallbackFactory = null, |
||
| 21 | ) { |
||
| 22 | 398 | \interface_exists($interface) or throw new \InvalidArgumentException( |
|
| 23 | 398 | "Interface `{$interface}` does not exist.", |
|
| 24 | 398 | ); |
|
| 25 | 397 | $this->singleton and $this->fallbackFactory !== null and throw new \InvalidArgumentException( |
|
| 26 | 397 | 'Singleton proxies must not have a fallback factory.', |
|
| 27 | 397 | ); |
|
| 53 |