<?php

namespace Yolo;

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Yolo\DependencyInjection\YoloExtension;
use Yolo\Compiler\EventSubscriberPass;

class Factory
{
    public static function createContainer(array $parameters = [], array $extensions = [])
    {
        $container = new ContainerBuilder();
        $container->registerExtension(new YoloExtension());
        foreach ($extensions as $extension) {
            $container->registerExtension($extension);
        }

        $container->getParameterBag()->add($parameters);

        foreach ($container->getExtensions() as $extension) {
            $container->loadFromExtension($extension->getAlias());
        }

        $container->addCompilerPass(new EventSubscriberPass());
        $container->compile();

        return $container;
    }
}

<?php

namespace Yolo;

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Yolo\DependencyInjection\YoloExtension;
use Yolo\Compiler\EventSubscriberPass;

class Factory
{
    public static function createContainer(array $parameters = [])
    {
        $container = new ContainerBuilder();
        $container->registerExtension(new YoloExtension());

        $container->getParameterBag()->add($parameters);

        foreach ($container->getExtensions() as $extension) {
            $container->loadFromExtension($extension->getAlias());
        }

        $container->addCompilerPass(new EventSubscriberPass());
        $container->compile();

        return $container;
    }
}

--- 
+++ 
@@ -8,10 +8,13 @@
 
 class Factory
 {
-    public static function createContainer(array $parameters = [])
+    public static function createContainer(array $parameters = [], array $extensions = [])
     {
         $container = new ContainerBuilder();
         $container->registerExtension(new YoloExtension());
+        foreach ($extensions as $extension) {
+            $container->registerExtension($extension);
+        }
 
         $container->getParameterBag()->add($parameters);
 
Allow registering additional extensions for container
