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

DatasourceEvent   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 25
rs 10
c 2
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A registerDatasource() 0 3 1
A getDataSources() 0 3 1
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
}