[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/vendor/laminas/laminas-zendframework-bridge/src/ -> Module.php (source)

   1  <?php
   2  
   3  /**
   4   * @see       https://github.com/laminas/laminas-zendframework-bridge for the canonical source repository
   5   * @copyright https://github.com/laminas/laminas-zendframework-bridge/blob/master/COPYRIGHT.md
   6   * @license   https://github.com/laminas/laminas-zendframework-bridge/blob/master/LICENSE.md New BSD License
   7   */
   8  
   9  namespace Laminas\ZendFrameworkBridge;
  10  
  11  use Laminas\ModuleManager\Listener\ConfigMergerInterface;
  12  use Laminas\ModuleManager\ModuleEvent;
  13  use Laminas\ModuleManager\ModuleManager;
  14  
  15  class Module
  16  {
  17      /**
  18       * Initialize the module.
  19       *
  20       * Type-hinting deliberately omitted to allow unit testing
  21       * without dependencies on packages that do not exist yet.
  22       *
  23       * @param ModuleManager $moduleManager
  24       */
  25      public function init($moduleManager)
  26      {
  27          $moduleManager
  28              ->getEventManager()
  29              ->attach('mergeConfig', [$this, 'onMergeConfig']);
  30      }
  31  
  32      /**
  33       * Perform substitutions in the merged configuration.
  34       *
  35       * Rewrites keys and values matching known ZF classes, namespaces, and
  36       * configuration keys to their Laminas equivalents.
  37       *
  38       * Type-hinting deliberately omitted to allow unit testing
  39       * without dependencies on packages that do not exist yet.
  40       *
  41       * @param ModuleEvent $event
  42       */
  43      public function onMergeConfig($event)
  44      {
  45          /** @var ConfigMergerInterface */
  46          $configMerger = $event->getConfigListener();
  47          $processor    = new ConfigPostProcessor();
  48          $configMerger->setMergedConfig(
  49              $processor(
  50                  $configMerger->getMergedConfig($returnAsObject = false)
  51              )
  52          );
  53      }
  54  }


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer