src/Leevel/Di/Container.php
public function alias($alias, $value = null): IContainer
    {
        if (is_array($alias)) {
            foreach ($alias as $key => $item) {
                if (is_int($key)) {
                    continue;
                }

                $this->alias($key, $item);
            }
        } else {
            $value = (array) $value;

            foreach ($value as $item) {
                $this->alias[$item] = $alias;
            }
        }

        return $this;
    }
public function alias($alias, $value = null): IContainer
    {
        if (is_array($alias)) {
            foreach ($alias as $key => $item) {
                if (is_int($key)) {
                    continue;
                }

                $this->alias($key, $item);
            }
        } else {
            $value = (array) $value;

            foreach ($value as $item) {
                $this->alias[$item] = $alias;
            }
        }

        return $this;
    }
设置别名.

@param array|string      $alias
@param null|array|string $value

@return $this