public function getFactory(string $key)
    {
        if (isset($this->definitions['factory'][$key])) {
            return $this->definitions['factory'][$key];
        }

        return $this->definitions['factory'][$this->aliases[$key]];
    }