Add key based genericConfig
This commit is contained in:
@ -2,7 +2,6 @@
|
||||
|
||||
namespace Ardent\Undercurrent\Container;
|
||||
|
||||
use Ardent\Undercurrent\Http\RouteConfig;
|
||||
use Ardent\Undercurrent\Logger\LogContainer;
|
||||
use Ardent\Undercurrent\Logger\LoggerInterface;
|
||||
use Exception;
|
||||
@ -41,6 +40,10 @@ class GenericContainer implements ContainerInterface
|
||||
|
||||
public function alias(string $alias, string $className): self
|
||||
{
|
||||
if (isset($this->aliases[$alias])) {
|
||||
throw new Exception(sprintf('Class %s already defined', $className));
|
||||
}
|
||||
|
||||
$this->aliases[$alias] = $className;
|
||||
|
||||
return $this;
|
||||
|
Reference in New Issue
Block a user