Adds instances to the Statical Manager

@param string[] $aliases
@param \RunBB\Core\Statical\Manager $manager
@param object $instance
11998
protected static function addInstances($aliases, $manager, $instance)
    {
        foreach ($aliases as $alias) {
            $proxy = __NAMESPACE__.'\\'.$alias;
            $manager->addProxyInstance($alias, $proxy, $instance);
        }
    }
577783
public function instance($abstract, $instance)
        {
            if (is_array($abstract)) {
                list($abstract, $alias) = $this->extractAlias($abstract);
                $this->alias($abstract, $alias);
            }
            $this->instances[$abstract] = $instance;
        }
659569
private function createManagerDefinition()
    {
        $id = $this->getServiceId('manager');
        if (!$this->container->has($id)) {
            $this->container->setAlias($id, new Alias($this->getManagerServiceId()));
        }
    }
489648
public function addSharedInstanceWithParameters($instance, $classOrAlias, array $params)
        {
            ksort($params);
            $hashKey = $this->createHashForKeys($classOrAlias, array_keys($params));
            $hashValue = $this->createHashForValues($classOrAlias, $params);

            if (!isset($this->sharedInstancesWithParams[$hashKey])
                || !is_array($this->sharedInstancesWithParams[$hashKey])) {
                $this->sharedInstancesWithParams[$hashKey] = [];
            }

            $this->sharedInstancesWithParams['hashShort'][$hashKey] = true;
            $this->sharedInstancesWithParams['hashLong'][$hashKey . '/' . $hashValue] = $instance;
        }
1236071
public function store($instance, string $name = null): void
    {
        if ($name === null) {
            $name = get_class($instance);
        }

        $name = $this->getDefinitiveName($name);

        $this->instances[$name] = $instance;
    }
1269805
protected function registerInstance($instance, array $parameters)
    {
        //Declarative singletons (only when class received via direct get)
        if (empty($parameters) && $instance instanceof SingletonInterface) {
            $alias = get_class($instance);

            if (!isset($this->bindings[$alias])) {
                $this->bindings[$alias] = $instance;
            }
        }

        //Your code can go here (for example LoggerAwareInterface, custom hydration and etc)

        return $instance;
    }
605420
public function add($manager)
    {
        if (!is_string($manager)) {
            throw new \InvalidArgumentException('ManagerList::add requires $manager to be a string.');
        }

        $this->managerList[$manager] = $manager;
        $this->managerStatus[self::FLAG_AVAILABLE][$manager] = $manager;

        return $this;
    }
226336
public function setInstances(Manager $manager, DataContainer $data, FlashContainer $flash)
	{
		$this->manager = $manager;
		$this->data = $data;
		$this->flash = $flash;
	}
177003
public function instance($abstract, $instance)
    {
        $abstract = $this->normalize($abstract);
        if (is_array($abstract)) {
            list($abstract, $alias) = $this->extractAlias($abstract);
            $this->alias($abstract, $alias);
        }
        unset($this->aliases[$abstract]);
        $bound = $this->bound($abstract);

        $this->instances[$abstract] = $instance;
        if ($bound) {
            $this->rebound($abstract);
        }
    }
826249
public function alias($alias, $name) {
		if (is_array($alias)) {
			foreach ($alias as $key) {
				$this->alias($key, $name);
			}

			return;
		}

		$this->aliases[$alias] = $name;
	}
99716
public function alias(array $class = [], string $alias = null) : Manager
    {
        if (!is_array($class)) {
            $this->set($class, $alias);

            return $this;
        }

        $this->aliases = array_merge($this->get(), $class);

        return $this;
    }
813078
public static function setInstance($instance = "") {
		
		if (empty($instance) || !method_exists($instance,'addGlobal')) {
			Console::writeError("please set the instance");
		}
		
		self::$instance = $instance;

	}
1288439
public function withFacades($aliases = true, $custom = [])
    {
        Facade::setFacadeApplication($this);

        if ($aliases) {
            $this->withAliases($custom);
        }

        return $this;
    }
186407
public function createAlias($reference, $alias = null)
    {
        //if reference is array look for array(alias=>reference);
        if (is_array($reference)) {
            foreach ($reference as $key => $class) {
                $this->createAlias($class, $key);
            }

            return true;
        }

        //store in this->alias as an associative array of class to an array of aliases;
        foreach ((!is_array($alias) ? [$alias] : $alias) as $key) {
            $this->aliases[$key] = $reference;
        }
    }
740158
protected static function setProperties($parser, $instance): void
    {
        $instance->malId = $parser->getMalId();
        $instance->url = $parser->getUrl();
        $instance->name = $parser->getName();
        $instance->imageUrl = $parser->getImage();
        $instance->role = $parser->getRole();
    }
1240829
public function addSingleton( string $name, $singleton ): self
	{
		$name = Str::studly($name);
		if( isset($this->ci[$name]) )
		{
			throw new \InvalidArgumentException("Duplicated class name '{$name}' for singleton instance object");
		}

		$this->ci[$name] = $singleton;
		return $this;
	}
1150618
public function instance($abstract, $instance)
		{
			// First, we will extract the alias from the abstract if it is an array so we
			// are using the correct name when binding the type. If we get an alias it
			// will be registered with the container so we can resolve it out later.
			if (Arrays::is($abstract)) {
				list($abstract, $alias) = $this->extractAlias($abstract);
				$this->alias($abstract, $alias);
			}

			unset($this->aliases[$abstract]);

			// We'll check to determine if this type has been bound before, and if it has
			// we will fire the rebound callbacks registered with the container and it
			// can be updated with consuming classes that have gotten resolved here.
			$bound = $this->bound($abstract);
			$this->instances[$abstract] = $instance;
			if ($bound) {
				$this->rebound($abstract);
			}
		}