Create a child Container with a new property scope that
that has the ability to access the parent scope when resolving.

@param   string $name The child name.

@return  static  The new container object.

@since   2.0
971835
public function createChild($name = null)
    {
        $name = $name ?: md5(uniqid('windwalker-di', true));

        $this->children[$name] = new static($this);

        return $this->children[$name];
    }
149101
private function createCache(string $name)
	{
		$builder = $this->getContainerBuilder();

		$cache = $builder->addDefinition($this->prefix('cache.' . $name))
			->setClass(Cache::class)
			->setArguments(['@Nette\Caching\IStorage', $this->debugMode])
			->addSetup('$service->setNamespace(?)', [$this->prefix('cache.' . $name)]);

		return $cache;
	}
889138
public static function createByName($name)
    {
        $constants = self::getConstantsByName();

        if (!array_key_exists($name, $constants)) {
            throw EnumException::invalidName(get_called_class(), $name);
        }

        return new static($constants[$name]);
    }
97964
protected function createComponent(string $name)
    {
        $definition = $this->components[$name];
        $params = $this->getComponentParams($name);

        return \Yii::createObject($definition, $params);
    }
734038
private function createContainer() {
        $container = new Container();

        $container->setDescription($this->getSentence());
        $container->setTitle($this->getTitle());

        return $container;
    }
799631
protected static function resolveFacadeInstance($name)
    {
        if (is_object($name)) {
            return $name;
        }

        if (isset(static::$resolvedInstance[$name])) {
            return static::$resolvedInstance[$name];
        }

        return static::$resolvedInstance[$name] = static::$app->getContainer()->get($name);
    }
631754
public static function attached($name = null) {
		if (!isset(static::$_scopes)) {
			static::_initScopes();
		}
		if ($name === false) {
			$name = '__defaultScope__';
		}
		return static::$_scopes->get($name);
	}
1161915
public function getContainer($name)
    {
        if (!array_key_exists($name, $this->containers)) {
            throw new ContainerNotFoundException("No container with name '{$name}' found");
        }

        return $this->containers[$name];
    }
632225
protected static function createFreshMockInstance($name)
    {
        static::$instance[$name] = $mock = static::createMockByName($name);

        if (isset(static::$container)) {
            static::$container->instance($name, $mock);
        }

        return $mock;
    }
1026443
private function createService($name)
    {
        $entry = &$this->services[$name];

        if (!is_array($entry) || !isset($entry['class'])) {
            throw new ContainerException($name.' service entry must be an array containing a \'class\' key');
        } elseif (!class_exists($entry['class'])) {
            throw new ContainerException($name.' service class does not exist: '.$entry['class']);
        } elseif (isset($entry['lock'])) {
            throw new ContainerException($name.' contains circular reference');
        }

        $entry['lock'] = true;

        $arguments = isset($entry['arguments']) ? $this->resolveArguments($entry['arguments']) : [];

        $reflector = new \ReflectionClass($entry['class']);
        $service = $reflector->newInstanceArgs($arguments);

        if (isset($entry['calls'])) {
            $this->initializeService($service, $name, $entry['calls']);
        }

        return $service;
    }
1359097
static public function instance($name=null)
    {
        $options = $name ? ['name' => $name] : [];
        $name = $name ?: get_called_class();
        
        if (!isset(static::$instances[$name])) {
            static::$instances[$name] = new static($name);
        }
        
        return static::$instances[$name];
    }
1175297
public static function getInstance($name=null) {
		if( !$name ) {
			$name = 'default';
		}
		if( !isset(static::$instances[$name]) ) {
			static::make($name);
		}
		return static::$instances[$name];
	}
927581
public function getProperty($name)
    {
        $m = $this->getReflectionClass()->getProperty($name);
        return PropertyInfo::__internal_create($this, $m);
    }
125586
public function getProperty($name)
    {
        if (!isset($this->properties[$name])) {
            return null;
        }

        if (!($this->properties[$name] instanceof self)) {
            $this->properties[$name]['name'] = $name;
            $this->properties[$name] = new static($this->properties[$name], $this->serviceDescription);
            $this->properties[$name]->setParent($this);
        }

        return $this->properties[$name];
    }
443162
public static function getScope($name, $cls = null)
    {
        if (!$cls) {
            $cls = get_called_class();
        }

        if (!array_key_exists($cls, self::$_scopes)
            || !array_key_exists($name, self::$_scopes[$cls])
        ) {
            return null;
        }

        return self::$_scopes[$cls][$name];
    }
708215
private function resolve($name)
	{
		if (!class_exists($name))
		{
			// Get the scope of the current class and check there too
			$name = $this->getModelNamespace() . '\\' . $name;

			if (!class_exists($name))
			{
				throw new RuntimeException("Relationship '{$name}' not found");
			}
		}

		return new $name;
	}
1335346
public function get($name)
    {
        $selected = null;
        /** @var ElementInterface|ContainerInterface $element */
        foreach ($this as $element) {
            if ($element->getName() == $name) {
                $selected = $element;
                break;
            }

            if ($element instanceof ContainerInterface) {
                $selected = $element->get($name);
                if (null !== $selected) {
                    break;
                }
            }
        }

        return $selected;
    }