Passed
Push — master ( 7b825e...35d4c7 )
by Marcel
02:51
created

FunnyData   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 20
rs 10
wmc 3
1
<?php
2
3
declare(strict_types=1);
4
5
namespace OCA\Analytics\Datasource;
6
7
use OCP\EventDispatcher\Event;
8
9
class FunnyData implements IDatasource
10
{
11
12
    public function handle(Event $event): void
13
    {
14
        if (!($event instanceof DatasourceEvent)) {
15
            // Unrelated
16
            return;
17
        }
18
        $event->registerDatasource($this->getName(), ***FunnyDataObjectHere ?***);
0 ignored issues
show
Bug introduced by
A parse error occurred: Syntax error, unexpected T_POW on line 18 at column 53
Loading history...
19
    }
20
21
    public function getName(): string
22
    {
23
        return 'FunnyData';
24
    }
25
26
    public function getTemplates(): array
27
    {
28
        $template = array();
29
        array_push($template, ['id' => 'datatype', 'name' => 'Type of data', 'placeholder' => 'absolute/adaptation']);
30
        array_push($template, ['id' => 'delete', 'name' => 'Delete all data before load', 'placeholder' => 'true/false']);
31
        return $template;
32
    }
33
34
    public function readData(): string
35
    {
36
        // do all the database related stuff
37
        return 'test';
38
    }
39
40
}
41
42