We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c23ae13 commit 9cc333bCopy full SHA for 9cc333b
src/Container.php
@@ -29,6 +29,10 @@ public function set(string $id, $concrete = null)
29
$concrete = $id;
30
}
31
32
+ if (is_string($concrete) && class_exists($concrete)) {
33
+ $concrete = $this->resolve($concrete);
34
+ }
35
+
36
return $this->instance[$id] = $concrete;
37
38
@@ -40,16 +44,8 @@ public function get(string $id)
40
44
if(!$this->has($id)){
41
45
$this->set($id);
42
46
43
- $instance = $this->instance[$id];
- if (is_object($instance)) {
- return $instance;
- }
47
-
48
- if (is_string($instance) && class_exists($instance)) {
49
- return $this->set($id, $this->resolve($instance));
50
51
52
+ return $this->instance[$id];
53
54
55
/**
0 commit comments