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;
    }
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;
    }
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 ; }
Creating the instances of bundle dependencies.

@param array $dependencies

@return bool Has new instances or not.
Creating the instances of bundle dependencies .