From 310ab78a7ea56280a62157720e47a1863cf00cdd Mon Sep 17 00:00:00 2001 From: Khoubza Younes Date: Sun, 6 Dec 2020 17:29:32 +0100 Subject: [PATCH] update namespaces --- DependencyInjection/Configuration.php | 4 ++-- ...Extension.php => FlasherPnotifyExtension.php} | 10 +++++----- ...PnotifyBundle.php => FlasherPnotifyBundle.php | 2 +- Resources/config/config.yaml | 16 ++++++++++++++++ Resources/config/services.yaml | 16 ---------------- {tests => Tests}/.gitkeep | 0 composer.json | 16 ++++++++-------- 7 files changed, 32 insertions(+), 32 deletions(-) rename DependencyInjection/{NotifyPnotifyExtension.php => FlasherPnotifyExtension.php} (76%) rename NotifyPnotifyBundle.php => FlasherPnotifyBundle.php (69%) create mode 100644 Resources/config/config.yaml delete mode 100644 Resources/config/services.yaml rename {tests => Tests}/.gitkeep (100%) diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index a3829ed3..6907ce6b 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -12,13 +12,13 @@ final class Configuration implements ConfigurationInterface */ public function getConfigTreeBuilder() { - $treeBuilder = new TreeBuilder('notify_pnotify'); + $treeBuilder = new TreeBuilder('flasher_pnotify'); if (\method_exists($treeBuilder, 'getRootNode')) { $rootNode = $treeBuilder->getRootNode(); } else { // BC layer for symfony/config 4.1 and older - $rootNode = $treeBuilder->root('notify_pnotify'); + $rootNode = $treeBuilder->root('flasher_pnotify'); } $rootNode diff --git a/DependencyInjection/NotifyPnotifyExtension.php b/DependencyInjection/FlasherPnotifyExtension.php similarity index 76% rename from DependencyInjection/NotifyPnotifyExtension.php rename to DependencyInjection/FlasherPnotifyExtension.php index a0f64bf8..065d888d 100644 --- a/DependencyInjection/NotifyPnotifyExtension.php +++ b/DependencyInjection/FlasherPnotifyExtension.php @@ -8,7 +8,7 @@ use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface; use Symfony\Component\DependencyInjection\Loader; use Symfony\Component\HttpKernel\DependencyInjection\Extension; -final class NotifyPnotifyExtension extends Extension implements PrependExtensionInterface +final class FlasherPnotifyExtension extends Extension implements PrependExtensionInterface { /** * {@inheritdoc} @@ -18,7 +18,7 @@ final class NotifyPnotifyExtension extends Extension implements PrependExtension public function load(array $configs, ContainerBuilder $container) { $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); - $loader->load('services.yaml'); + $loader->load('config.yaml'); $configuration = new Configuration(); $this->processConfiguration($configuration, $configs); @@ -29,14 +29,14 @@ final class NotifyPnotifyExtension extends Extension implements PrependExtension */ public function prepend(ContainerBuilder $container) { - if (!$container->hasExtension('notify')) { - throw new \RuntimeException('[Flasher\SymfonyFlasher\PrimeBundle] is not registered'); + if (!$container->hasExtension('flasher')) { + throw new \RuntimeException('[Flasher\Symfony\FlasherBundle] is not registered'); } $configs = $container->getExtensionConfig($this->getAlias()); $config = $this->processConfiguration(new Configuration(), $configs); - $container->prependExtensionConfig('notify', array( + $container->prependExtensionConfig('flasher', array( 'adapters' => array( 'pnotify' => $config, ), diff --git a/NotifyPnotifyBundle.php b/FlasherPnotifyBundle.php similarity index 69% rename from NotifyPnotifyBundle.php rename to FlasherPnotifyBundle.php index 567b7c41..3f7bc315 100644 --- a/NotifyPnotifyBundle.php +++ b/FlasherPnotifyBundle.php @@ -4,6 +4,6 @@ namespace Flasher\Pnotify\Symfony; use Symfony\Component\HttpKernel\Bundle\Bundle; -class NotifyPnotifyBundle extends Bundle +class FlasherPnotifyBundle extends Bundle { } diff --git a/Resources/config/config.yaml b/Resources/config/config.yaml new file mode 100644 index 00000000..3c59e14c --- /dev/null +++ b/Resources/config/config.yaml @@ -0,0 +1,16 @@ +services: + flasher.factory.pnotify: + parent: 'flasher.abstract_factory' + class: Flasher\Pnotify\Prime\PnotifyFactory + tags: + - { name: 'flasher.factory' } + + flasher.renderer.pnotify: + class: Flasher\PFlasher\Prime\PnotifyRenderer + arguments: + - '@flasher.config' + tags: + - { name: 'flasher.renderer' } + + Flasher\PFlasher\Prime\PnotifyFactory: '@flasher.factory.pnotify' + Flasher\PFlasher\Prime\PnotifyRenderer: '@flasher.renderer.pnotify' diff --git a/Resources/config/services.yaml b/Resources/config/services.yaml deleted file mode 100644 index 0fa5a2b2..00000000 --- a/Resources/config/services.yaml +++ /dev/null @@ -1,16 +0,0 @@ -services: - flasher.factory.pnotify: - parent: 'flasher.factory.abstract' - class: Flasher\PFlasher\Prime\TestsProducer\PnotifyProducer - tags: - - { name: 'flasher.factory', alias: 'pnotify' } - - flasher.renderer.pnotify: - class: Flasher\PFlasher\Prime\Renderer\PnotifyRenderer - arguments: - - '@flasher.config' - tags: - - { name: 'flasher.renderer', alias: 'pnotify' } - - Flasher\PFlasher\Prime\TestsProducer\PnotifyProducer: '@flasher.factory.pnotify' - Flasher\PFlasher\Prime\Renderer\PnotifyRenderer: '@flasher.renderer.pnotify' diff --git a/tests/.gitkeep b/Tests/.gitkeep similarity index 100% rename from tests/.gitkeep rename to Tests/.gitkeep diff --git a/composer.json b/composer.json index fc41b173..c5502c1b 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "php-flasher/flasher-symfony-pnotify", + "name": "php-flasher/flasher-pnotify-symfony", "type": "symfony-bundle", "description": "Symfony Flasher adapter for pnotify.js library for php-flasher/flasher-symfony", "keywords": [ @@ -29,20 +29,20 @@ "license": "MIT", "require": { "php": ">=5.3", - "php-flasher/flasher-symfony": "^1.0", - "php-flasher/flasher-pnotify": "^1.0" - }, - "require-dev": { - "phpunit/phpunit": "4.8.36" + "php-flasher/flasher-symfony": "dev-main", + "php-flasher/flasher-pnotify": "dev-main" }, "autoload": { "psr-4": { - "Flasher\\Symfony\\Pnotify\\": "src/" + "Flasher\\Pnotify\\Symfony\\": "", + "exclude-from-classmap": [ + "/Tests/" + ] } }, "autoload-dev": { "psr-4": { - "Flasher\\Symfony\\Pnotify\\Tests\\": "tests/" + "Flasher\\Pnotify\\Symfony\\Tests\\": "Tests/" } }, "config": {