| Total Complexity | 8 |
| Total Lines | 39 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | final class Binder extends StateBinder |
||
| 16 | { |
||
| 17 | use DestructorTrait; |
||
| 18 | |||
| 19 | private ContainerInterface $container; |
||
| 20 | private Scope $scope; |
||
| 21 | |||
| 22 | 1463 | public function __construct(Registry $constructor) |
|
| 23 | { |
||
| 24 | 1463 | $constructor->set('binder', $this); |
|
| 25 | |||
| 26 | 1463 | $this->container = $constructor->get('container', ContainerInterface::class); |
|
| 27 | 1463 | $this->scope = $constructor->get('scope', Scope::class); |
|
| 28 | |||
| 29 | 1463 | parent::__construct($constructor->get('state', State::class)); |
|
| 30 | } |
||
| 31 | |||
| 32 | 17 | public function hasInstance(string $alias): bool |
|
| 44 | } |
||
| 45 | |||
| 46 | 101 | public function hasBinding(string $alias): bool |
|
| 47 | { |
||
| 48 | 101 | return parent::hasBinding($alias) || ($this->scope->getParent()?->hasBinding($alias) ?? false); |
|
| 49 | } |
||
| 50 | |||
| 51 | 610 | public function destruct(): void |
|
| 54 | } |
||
| 55 | } |
||
| 56 |