Skip to content

Commit 7643df3

Browse files
added resolve method
1 parent 4a412e9 commit 7643df3

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/Container.php

+14
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,20 @@ public function call(callable|string|array $concrete, array $params = []): mixed
262262
$args = $this->getDependencies($reflector->getParameters(), $params);
263263
return $reflector->invokeArgs($callback, $args);
264264
}
265+
266+
/**
267+
* Resolve all of the bindings.
268+
*
269+
* @return void
270+
*/
271+
public function resolve(): void
272+
{
273+
foreach ($this->bindings as $abstract => $concrete) {
274+
if (!isset($this->resolved[$abstract])) {
275+
$this->make($abstract);
276+
}
277+
}
278+
}
265279

266280
/**
267281
* Parse concrete to array.

0 commit comments

Comments
 (0)