| Total Complexity | 6 |
| Total Lines | 53 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | class ConfigEventManager implements ConfigListenerInterface |
||
| 21 | { |
||
| 22 | /** |
||
| 23 | * @var Container |
||
| 24 | */ |
||
| 25 | protected $di; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @var string[] |
||
| 29 | */ |
||
| 30 | protected $aListeners = []; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * The constructor |
||
| 34 | * |
||
| 35 | * @param Container $di |
||
| 36 | */ |
||
| 37 | public function __construct(Container $di) |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * Add a listener |
||
| 44 | * |
||
| 45 | * @param string $sClassName |
||
| 46 | * |
||
| 47 | * @return void |
||
| 48 | */ |
||
| 49 | public function addListener(string $sClassName) |
||
| 50 | { |
||
| 51 | $this->aListeners[] = $sClassName; |
||
| 52 | } |
||
| 53 | |||
| 54 | /** |
||
| 55 | * @inheritDoc |
||
| 56 | */ |
||
| 57 | public function onChanges(Config $xConfig) |
||
| 58 | { |
||
| 59 | foreach($this->aListeners as $sListener) |
||
| 60 | { |
||
| 61 | $this->di->g($sListener)->onChanges($xConfig); |
||
| 62 | } |
||
| 63 | } |
||
| 64 | |||
| 65 | /** |
||
| 66 | * @inheritDoc |
||
| 67 | */ |
||
| 68 | public function onChange(Config $xConfig, string $sName) |
||
| 73 | } |
||
| 74 | } |
||
| 75 | } |
||
| 76 |