mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-03-31 15:07:47 +01:00
fix event dispatcher and call the storage service
This commit is contained in:
@@ -12,13 +12,13 @@ final class Configuration implements ConfigurationInterface
|
||||
*/
|
||||
public function getConfigTreeBuilder()
|
||||
{
|
||||
$treeBuilder = new TreeBuilder('notify_toastr');
|
||||
$treeBuilder = new TreeBuilder('flasher_toastr');
|
||||
|
||||
if (\method_exists($treeBuilder, 'getRootNode')) {
|
||||
$rootNode = $treeBuilder->getRootNode();
|
||||
} else {
|
||||
// BC layer for symfony/config 4.1 and older
|
||||
$rootNode = $treeBuilder->root('notify_toastr');
|
||||
$rootNode = $treeBuilder->root('flasher_toastr');
|
||||
}
|
||||
|
||||
$rootNode
|
||||
|
||||
+3
-3
@@ -8,7 +8,7 @@ use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
|
||||
use Symfony\Component\DependencyInjection\Loader;
|
||||
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
||||
|
||||
final class NotifyToastrExtension extends Extension implements PrependExtensionInterface
|
||||
final class FlasherToastrExtension extends Extension implements PrependExtensionInterface
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
@@ -29,14 +29,14 @@ final class NotifyToastrExtension extends Extension implements PrependExtensionI
|
||||
*/
|
||||
public function prepend(ContainerBuilder $container)
|
||||
{
|
||||
if (!$container->hasExtension('notify')) {
|
||||
if (!$container->hasExtension('flasher')) {
|
||||
throw new \RuntimeException('[Flasher\SymfonyFlasher\PrimeBundle] is not registered');
|
||||
}
|
||||
|
||||
$configs = $container->getExtensionConfig($this->getAlias());
|
||||
$config = $this->processConfiguration(new Configuration(), $configs);
|
||||
|
||||
$container->prependExtensionConfig('notify', array(
|
||||
$container->prependExtensionConfig('flasher', array(
|
||||
'adapters' => array(
|
||||
'toastr' => $config,
|
||||
),
|
||||
@@ -4,6 +4,6 @@ namespace Flasher\Toastr\Symfony;
|
||||
|
||||
use Symfony\Component\HttpKernel\Bundle\Bundle;
|
||||
|
||||
class NotifyToastrBundle extends Bundle
|
||||
class FlasherToastrBundle extends Bundle
|
||||
{
|
||||
}
|
||||
@@ -1,16 +1,16 @@
|
||||
services:
|
||||
notify.producer.toastr:
|
||||
parent: 'notify.producer.abstract'
|
||||
class: Flasher\Toastr\Prime\Producer\ToastrProducer
|
||||
flasher.factory.toastr:
|
||||
parent: 'flasher.abstract_factory'
|
||||
class: Flasher\Toastr\Prime\ToastrFactory
|
||||
tags:
|
||||
- { name: 'notify.producer', alias: 'toastr' }
|
||||
- { name: 'flasher.factory' }
|
||||
|
||||
notify.renderer.toastr:
|
||||
class: Flasher\Toastr\Prime\Renderer\ToastrRenderer
|
||||
flasher.renderer.toastr:
|
||||
class: Flasher\Toastr\Prime\ToastrRenderer
|
||||
arguments:
|
||||
- '@notify.config'
|
||||
- '@flasher.config'
|
||||
tags:
|
||||
- { name: 'notify.renderer', alias: 'toastr' }
|
||||
- { name: 'flasher.renderer' }
|
||||
|
||||
Flasher\Toastr\Prime\Producer\ToastrProducer: '@notify.producer.toastr'
|
||||
Flasher\Toastr\Prime\Renderer\ToastrRenderer: '@notify.renderer.toastr'
|
||||
Flasher\Toastr\Prime\ToastrFactory: '@flasher.factory.toastr'
|
||||
Flasher\Toastr\Prime\ToastrRenderer: '@flasher.renderer.toastr'
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "php-flasher/flasher-symfony-toastr",
|
||||
"name": "php-flasher/flasher-toastr-symfony",
|
||||
"type": "symfony-bundle",
|
||||
"description": "Symfony Flasher adapter for toastr.js library for php-flasher/flasher-symfony",
|
||||
"keywords": [
|
||||
|
||||
Reference in New Issue
Block a user