Deploy on 2026-06-05 02:05:17
This commit is contained in:
@@ -38,20 +38,21 @@ class Container implements ContainerInterface
|
||||
return $this->instances[$id];
|
||||
}
|
||||
|
||||
if (!$this->has($id)) {
|
||||
return $this->resolve($id);
|
||||
if (isset($this->bindings[$id])) {
|
||||
$binding = $this->bindings[$id];
|
||||
$concrete = $binding['concrete'];
|
||||
|
||||
$object = $this->resolve($concrete);
|
||||
|
||||
if ($binding['singleton']) {
|
||||
$this->instances[$id] = $object;
|
||||
}
|
||||
|
||||
return $object;
|
||||
}
|
||||
|
||||
$binding = $this->bindings[$id];
|
||||
$concrete = $binding['concrete'];
|
||||
|
||||
$object = $this->resolve($concrete);
|
||||
|
||||
if ($binding['singleton']) {
|
||||
$this->instances[$id] = $object;
|
||||
}
|
||||
|
||||
return $object;
|
||||
// Not bound, auto-resolve using Reflection
|
||||
return $this->resolve($id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user