protected function createBundles(array $dependencies)
    {
        foreach ($dependencies as $bundleClass) {
            $name = substr($bundleClass, strrpos($bundleClass, '\\') + 1);

            if (false === isset($this->bundles[$name])) {
                $bundle = new $bundleClass();
                $this->bundles[$name] = $bundleClass;
                $this->instances[$name] = $bundle;

                if ($bundle instanceof BundleDependencyInterface) {
                    $this->createBundles($bundle->getBundleDependencies());
                }
            }
        }

        return count($this->instances) > 0;
    }