private function getBundleDefinitionInstance($bundle): BundleInterface
    {
        if (!is_object($bundle)) {
            $bundle = new $bundle($this);
        }

        if (!$bundle instanceof BundleInterface) {
            throw new BundleDependencyException(get_class($bundle));
        }

        return $bundle;
    }