for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Jaxon\App\Config;
/**
* ConfigEventManager.php
*
* Call listeners on config changes.
* @package jaxon-core
* @author Thierry Feuzeu <[email protected]>
* @copyright 2022 Thierry Feuzeu <[email protected]>
* @license https://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @link https://github.com/jaxon-php/jaxon-core
*/
use Jaxon\Di\Container;
use Jaxon\Utils\Config\Config;
class ConfigEventManager implements ConfigListenerInterface
{
* @var Container
protected $di;
* @var string[]
protected $aListeners = [];
* The constructor
* @param Container $di
public function __construct(Container $di)
$this->di = $di;
}
* Add a listener
* @param string $sClassName
* @return void
public function addListener(string $sClassName)
$this->aListeners[] = $sClassName;
* @inheritDoc
public function onChange(Config $xConfig, string $sName)
foreach($this->aListeners as $sListener)
$this->di->g($sListener)->onChange($xConfig, $sName);