This commit is contained in:
2021-10-26 10:22:56 +08:00
parent f4b9d57358
commit 3d92d3b07f
+5 -1
View File
@@ -112,8 +112,12 @@ class Container extends BaseObject implements ContainerInterface
*/
public function setBindings(string $interface, $object)
{
$this->_singletons[$interface] = $object;
if (is_string($object)) {
$this->_interfaces[$interface] = $object;
} else {
$this->_interfaces[$interface] = get_class($object);
$this->_singletons[$interface] = $object;
}
}