变更
This commit is contained in:
+14
-1
@@ -12,7 +12,6 @@ namespace Kiri\Di;
|
||||
use Closure;
|
||||
use Exception;
|
||||
use Kiri;
|
||||
use Kiri\Di\ContainerInterface;
|
||||
use ReflectionClass;
|
||||
use ReflectionException;
|
||||
use ReflectionFunction;
|
||||
@@ -78,6 +77,20 @@ class Container implements ContainerInterface
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $id
|
||||
* @return mixed
|
||||
* @throws Exception
|
||||
*/
|
||||
public function copy($id): mixed
|
||||
{
|
||||
if ($id == ContainerInterface::class) {
|
||||
return $this;
|
||||
}
|
||||
return clone $this->make($id, [], []);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return static
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user