Passed
Push — master ( 953339...7b825e )
by Marcel
02:59
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
namespace OCA\Analytics\Datasource;
4
5
use OCP\EventDispatcher\Event;
6
7
/**
8
 * Class CommentsEntityEvent
9
 *
10
 * @since 9.1.0
11
 */
12
class DatasourceEvent extends Event
13
{
14
15
    /** @var string */
16
    protected $event;
17
    /** @var \Closure[] */
18
    protected $collections;
19
20
    /**
21
     * DispatcherEvent constructor.
22
     *
23
     * @param string $event
24
     * @since 9.1.0
25
     */
26
    public function __construct($event)
27
    {
28
        $this->event = $event;
29
        $this->collections = [];
30
    }
31
32
    /**
33
     * @param OCA\Analytics\Datasource\IDatasource $datasource
34
     * @since 9.1.0
35
     */
36
    public function registerDatasource(OCA\Analytics\Datasource\IDatasource $datasource)
0 ignored issues
show
Bug introduced by
The type OCA\Analytics\Datasource...\Datasource\IDatasource was not found. Did you mean OCA\Analytics\Datasource\IDatasource? If so, make sure to prefix the type with \.
Loading history...
Unused Code introduced by
The parameter $datasource is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

36
    public function registerDatasource(/** @scrutinizer ignore-unused */ OCA\Analytics\Datasource\IDatasource $datasource)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
37
    {
38
        //
39
    }
40
41
    /**
42
     * @return \Closure[]
43
     * @since 9.1.0
44
     */
45
    public function getDataSources()
46
    {
47
        return $this->collections;
48
    }
49
}