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

        if (isset($this->aliases[$key])) {
            return isset($this->definitions['instance'][$this->aliases[$key]]);
        }

        return false;
    }