You've already forked php-flasher
mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-04-05 12:32:55 +01:00
update namespaces
This commit is contained in:
@@ -12,13 +12,13 @@ final class Configuration implements ConfigurationInterface
|
|||||||
*/
|
*/
|
||||||
public function getConfigTreeBuilder()
|
public function getConfigTreeBuilder()
|
||||||
{
|
{
|
||||||
$treeBuilder = new TreeBuilder('notify_notyf');
|
$treeBuilder = new TreeBuilder('flasher_notyf');
|
||||||
|
|
||||||
if (\method_exists($treeBuilder, 'getRootNode')) {
|
if (\method_exists($treeBuilder, 'getRootNode')) {
|
||||||
$rootNode = $treeBuilder->getRootNode();
|
$rootNode = $treeBuilder->getRootNode();
|
||||||
} else {
|
} else {
|
||||||
// BC layer for symfony/config 4.1 and older
|
// BC layer for symfony/config 4.1 and older
|
||||||
$rootNode = $treeBuilder->root('notify_notyf');
|
$rootNode = $treeBuilder->root('flasher_notyf');
|
||||||
}
|
}
|
||||||
|
|
||||||
$rootNode
|
$rootNode
|
||||||
|
|||||||
+5
-7
@@ -8,7 +8,7 @@ use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
|
|||||||
use Symfony\Component\DependencyInjection\Loader;
|
use Symfony\Component\DependencyInjection\Loader;
|
||||||
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
||||||
|
|
||||||
final class NotifyNotyfExtension extends Extension implements PrependExtensionInterface
|
final class FlasherNotyfExtension extends Extension implements PrependExtensionInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
@@ -18,7 +18,7 @@ final class NotifyNotyfExtension extends Extension implements PrependExtensionIn
|
|||||||
public function load(array $configs, ContainerBuilder $container)
|
public function load(array $configs, ContainerBuilder $container)
|
||||||
{
|
{
|
||||||
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
|
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
|
||||||
$loader->load('services.yaml');
|
$loader->load('config.yaml');
|
||||||
|
|
||||||
$configuration = new Configuration();
|
$configuration = new Configuration();
|
||||||
$this->processConfiguration($configuration, $configs);
|
$this->processConfiguration($configuration, $configs);
|
||||||
@@ -29,16 +29,14 @@ final class NotifyNotyfExtension extends Extension implements PrependExtensionIn
|
|||||||
*/
|
*/
|
||||||
public function prepend(ContainerBuilder $container)
|
public function prepend(ContainerBuilder $container)
|
||||||
{
|
{
|
||||||
if (!$container->hasExtension('notify')) {
|
if (!$container->hasExtension('flasher')) {
|
||||||
throw new \RuntimeException('[Flasher\SymfonyFlasher\PrimeBundle] is not registered');
|
throw new \RuntimeException('[Flasher\Symfony\FlasherBundle] is not registered');
|
||||||
}
|
}
|
||||||
|
|
||||||
$configs = $container->getExtensionConfig($this->getAlias());
|
$configs = $container->getExtensionConfig($this->getAlias());
|
||||||
$config = $this->processConfiguration(new Configuration(), $configs);
|
$config = $this->processConfiguration(new Configuration(), $configs);
|
||||||
|
|
||||||
$notifyConfig = $container->getExtensionConfig('notify');
|
$container->prependExtensionConfig('flasher', array(
|
||||||
|
|
||||||
$container->prependExtensionConfig('notify', array(
|
|
||||||
'adapters' => array(
|
'adapters' => array(
|
||||||
'notyf' => $config,
|
'notyf' => $config,
|
||||||
),
|
),
|
||||||
@@ -4,6 +4,6 @@ namespace Flasher\Notyf\Symfony;
|
|||||||
|
|
||||||
use Symfony\Component\HttpKernel\Bundle\Bundle;
|
use Symfony\Component\HttpKernel\Bundle\Bundle;
|
||||||
|
|
||||||
class NotifyNotyfBundle extends Bundle
|
class FlasherNotyfBundle extends Bundle
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
services:
|
||||||
|
flasher.factory.notyf:
|
||||||
|
parent: 'flasher.abstract_factory'
|
||||||
|
class: Flasher\Notyf\Prime\NotyfProducer
|
||||||
|
tags:
|
||||||
|
- { name: 'flasher.factory' }
|
||||||
|
|
||||||
|
flasher.renderer.notyf:
|
||||||
|
class: Flasher\Notyf\Prime\NotyfRenderer
|
||||||
|
arguments:
|
||||||
|
- '@flasher.config'
|
||||||
|
tags:
|
||||||
|
- { name: 'flasher.renderer' }
|
||||||
|
|
||||||
|
Flasher\Notyf\Prime\NotyfProducer: '@flasher.factory.notyf'
|
||||||
|
Flasher\Notyf\Prime\NotyfRenderer: '@flasher.renderer.notyf'
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
services:
|
|
||||||
flasher.factory.notyf:
|
|
||||||
parent: 'flasher.factory.abstract'
|
|
||||||
class: Flasher\Notyf\Prime\Factory\NotyfProducer
|
|
||||||
tags:
|
|
||||||
- { name: 'flasher.factory', alias: 'notyf' }
|
|
||||||
|
|
||||||
flasher.renderer.notyf:
|
|
||||||
class: Flasher\Notyf\Prime\Renderer\NotyfRenderer
|
|
||||||
arguments:
|
|
||||||
- '@flasher.config'
|
|
||||||
tags:
|
|
||||||
- { name: 'flasher.renderer', alias: 'notyf' }
|
|
||||||
|
|
||||||
Flasher\Notyf\Prime\Factory\NotyfProducer: '@flasher.factory.notyf'
|
|
||||||
Flasher\Notyf\Prime\Renderer\NotyfRenderer: '@flasher.renderer.notyf'
|
|
||||||
+8
-8
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "php-flasher/flasher-symfony-notyf",
|
"name": "php-flasher/flasher-notyf-symfony",
|
||||||
"type": "symfony-bundle",
|
"type": "symfony-bundle",
|
||||||
"description": "Symfony Flasher adapter for Sweet Alert 2 library for php-flasher/flasher-symfony",
|
"description": "Symfony Flasher adapter for Sweet Alert 2 library for php-flasher/flasher-symfony",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
@@ -31,20 +31,20 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.3",
|
"php": ">=5.3",
|
||||||
"php-flasher/flasher-symfony": "^1.0",
|
"php-flasher/flasher-symfony": "dev-main",
|
||||||
"php-flasher/flasher-notyf": "^1.0"
|
"php-flasher/flasher-notyf": "dev-main"
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"phpunit/phpunit": "4.8.36"
|
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"Flasher\\Symfony\\Notyf\\": "src/"
|
"Flasher\\Notyf\\Symfony\\": "",
|
||||||
|
"exclude-from-classmap": [
|
||||||
|
"/Tests/"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload-dev": {
|
"autoload-dev": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"Flasher\\Symfony\\Notyf\\Tests\\": "tests/"
|
"Flasher\\Notyf\\Symfony\\Tests\\": "Tests/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
|
|||||||
Reference in New Issue
Block a user