Passed
Push — master ( 14e493...9c2d3e )
by Marcel
02:30
created

DatasourceEvent::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 4
rs 10
1
<?php
2
/**
3
 * Analytics
4
 *
5
 * This file is licensed under the Affero General Public License version 3 or
6
 * later. See the LICENSE.md file.
7
 *
8
 * @author Marcel Scherello <[email protected]>
9
 * @copyright 2020 Marcel Scherello
10
 */
11
12
namespace OCA\Analytics\Datasource;
13
14
use OCP\EventDispatcher\Event;
15
16
/**
17
 * Class CommentsEntityEvent
18
 *
19
 * @since 9.1.0
20
 */
21
class DatasourceEvent extends Event
22
{
23
24
    /** @var string */
25
    protected $event;
26
    /** @var \Closure[] */
27
    protected $collections = [];
28
29
    /**
30
     * @param string $name
31
     * @param string $datasource
32
     * @since 9.1.0
33
     */
34
    public function registerDatasource(string $datasource)
35
    {
36
        $this->collections[] = $datasource;
37
    }
38
39
    /**
40
     * @return \Closure[]
41
     * @since 9.1.0
42
     */
43
    public function getDataSources()
44
    {
45
        return $this->collections;
46
    }
47
}