| Total Complexity | 5 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | final class MultiBinder |
||
| 12 | { |
||
| 13 | /** @var Container */ |
||
| 14 | private $container; |
||
| 15 | |||
| 16 | /** @var array<string, array<int|string, Lazy>> */ |
||
| 17 | private $lazyCollection = []; |
||
| 18 | |||
| 19 | /** @var string */ |
||
| 20 | private $interface; |
||
| 21 | |||
| 22 | private function __construct(AbstractModule $module, string $interface) |
||
| 26 | } |
||
| 27 | |||
| 28 | public static function newInstance(AbstractModule $module, string $interface): self |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @param class-string $class |
||
|
|
|||
| 35 | */ |
||
| 36 | public function add(string $class, ?string $key = null): void |
||
| 37 | { |
||
| 38 | $this->set($class, $key); |
||
| 39 | $bind = (new Bind($this->container, LazyCollection::class))->toInstance(new LazyCollection($this->lazyCollection)); |
||
| 40 | $this->container->add($bind); |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @param class-string $class |
||
| 45 | */ |
||
| 46 | public function set(string $class, ?string $key): void |
||
| 55 | } |
||
| 56 | } |
||
| 57 |