symfony-notifications/NotificationsBundle/DependencyInjection/NotificationsExtension.php

65 lines
2.0 KiB
PHP
Raw Normal View History

2019-03-01 12:18:06 +01:00
<?php
2019-03-01 12:49:26 +01:00
namespace Bluesquare\NotificationsBundle\DependencyInjection;
2019-03-01 12:18:06 +01:00
use Symfony\Component\Config\FileLocator;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Extension\Extension;
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
use Symfony\Component\DependencyInjection\Reference;
2019-03-01 12:49:26 +01:00
final class NotificationsExtension extends Extension implements PrependExtensionInterface
2019-03-01 12:18:06 +01:00
{
/**
* {@inheritdoc}
*/
public function load(array $configs, ContainerBuilder $container)
{
$loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader->load('services.yaml');
$config = $this->processConfiguration(new Configuration(), $configs);
2019-03-01 12:49:26 +01:00
// $definition = $container->getDefinition('bluesquare.notifications_bundle.foo');
2019-03-01 12:18:06 +01:00
return $config;
// $this->configurePersistence($loader, $container, $config['provider']);
// $this->configureAuthorizationServer($container, $config['authorization_server']);
// $this->configureResourceServer($container, $config['resource_server']);
// $this->configureScopes($container, $config['scopes']);
}
/**
* {@inheritdoc}
*/
public function getAlias()
{
2019-03-01 12:49:26 +01:00
return 'bluesquare.notifications_bundle';
2019-03-01 12:18:06 +01:00
}
/**
* {@inheritdoc}
*/
public function prepend(ContainerBuilder $container)
{
//
}
private function configureScopes(ContainerBuilder $container, array $scopes): void
{
/*$scopeManager = $container
->getDefinition(
$container->getAlias(ScopeManagerInterface::class)
)
;
foreach ($scopes as $scope) {
$scopeManager->addMethodCall('save', [
new Definition(ScopeModel::class, [$scope]),
]);
}*/
}
}