Issues (2884)

src/App/Config/ConfigEventManager.php (13 issues)

1
<?php
2
0 ignored issues
show
Missing file doc comment
Loading history...
3
namespace Jaxon\App\Config;
4
5
/**
0 ignored issues
show
Block comments must be started with /*
Loading history...
6
 * ConfigEventManager.php
7
 *
8
 * Call listeners on config changes.
9
 *
10
 * @package jaxon-core
11
 * @author Thierry Feuzeu <[email protected]>
12
 * @copyright 2022 Thierry Feuzeu <[email protected]>
13
 * @license https://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
14
 * @link https://github.com/jaxon-php/jaxon-core
15
 */
16
17
use Jaxon\Di\Container;
18
use Jaxon\Utils\Config\Config;
19
20
class ConfigEventManager implements ConfigListenerInterface
0 ignored issues
show
Missing doc comment for class ConfigEventManager
Loading history...
21
{
22
    /**
23
     * @var Container
24
     */
25
    protected $di;
0 ignored issues
show
Expected 1 blank line(s) before first member var; 0 found
Loading history...
26
27
    /**
28
     * @var string[]
29
     */
30
    protected $aListeners = [];
31
32
    /**
33
     * The constructor
34
     *
35
     * @param Container $di
0 ignored issues
show
Missing parameter comment
Loading history...
36
     */
37
    public function __construct(Container $di)
0 ignored issues
show
Expected 2 blank lines before function; 1 found
Loading history...
38
    {
39
        $this->di = $di;
40
    }
0 ignored issues
show
Expected 2 blank lines after function; 1 found
Loading history...
41
42
    /**
43
     * Add a listener
44
     *
45
     * @param string $sClassName
0 ignored issues
show
Missing parameter comment
Loading history...
46
     *
47
     * @return void
48
     */
49
    public function addListener(string $sClassName)
50
    {
51
        $this->aListeners[] = $sClassName;
52
    }
0 ignored issues
show
Expected 2 blank lines after function; 1 found
Loading history...
53
54
    /**
0 ignored issues
show
Parameter $xConfig should have a doc-comment as per coding-style.
Loading history...
Parameter $sName should have a doc-comment as per coding-style.
Loading history...
55
     * @inheritDoc
56
     */
0 ignored issues
show
Missing @return tag in function comment
Loading history...
57
    public function onChange(Config $xConfig, string $sName)
58
    {
59
        foreach($this->aListeners as $sListener)
60
        {
61
            $this->di->g($sListener)->onChange($xConfig, $sName);
62
        }
63
    }
0 ignored issues
show
Expected 2 blank lines after function; 0 found
Loading history...
64
}
65