Start using Symfony Components

This commit is contained in:
Oliver Davies 2018-01-10 17:39:00 +00:00
parent b61178b9b0
commit bc3dae9c48
9 changed files with 131 additions and 13 deletions

View file

@ -0,0 +1,24 @@
<?php
namespace Opdavies\GmailFilterBuilder\Container;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
class Container
{
public function __construct()
{
$this->containerBuilder = new ContainerBuilder();
$loader = new YamlFileLoader($this->containerBuilder, new FileLocator(__DIR__.'/../../config'));
$loader->load('services.yml');
$this->containerBuilder->addCompilerPass(new CommandCompilerClass());
$this->containerBuilder->compile();
}
public function get($className)
{
return $this->containerBuilder->get($className);
}
}