Passed
Pull Request — 4.2 (#140)
by David
04:58
created

GeneratorEventDispatcher::onGenerate()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 3
nc 2
nop 2
1
<?php
2
3
4
namespace Mouf\Database\TDBM\Utils;
5
6
use Mouf\Database\TDBM\ConfigurationInterface;
7
8
class GeneratorEventDispatcher implements GeneratorListenerInterface
9
{
10
    /**
11
     * @var GeneratorListenerInterface[]
12
     */
13
    private $listeners;
14
15
    /**
16
     * GeneratorEventDispatcher constructor.
17
     * @param GeneratorListenerInterface[] $listeners
18
     */
19
    public function __construct(array $listeners)
20
    {
21
        $this->listeners = $listeners;
22
    }
23
24
    /**
25
     * @param ConfigurationInterface $configuration
26
     * @param BeanDescriptorInterface[] $beanDescriptors
27
     */
28
    public function onGenerate(ConfigurationInterface $configuration, array $beanDescriptors): void
29
    {
30
        foreach ($this->listeners as $listener) {
31
            $listener->onGenerate($configuration, $beanDescriptors);
32
        }
33
    }
34
}
35