Passed
Pull Request — master (#6127)
by Angel Fernando Quiroz
40:13 queued 28:46
created

ExerciseQuestionAnsweredEvent::getTrackingExeId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
/* For licensing terms, see /license.txt */
4
5
declare(strict_types=1);
6
7
namespace Chamilo\CoreBundle\Event;
8
9
class ExerciseQuestionAnsweredEvent extends AbstractEvent
10
{
11
    public function getTrackingExeId(): ?int
12
    {
13
        return $this->data['exe_id'] ?? null;
14
    }
15
16
    public function getExerciseId(): ?int
17
    {
18
        if (!empty($this->data['exercise']['id'])) {
19
            return $this->data['exercise']['id'];
20
        }
21
22
        return null;
23
    }
24
25
    public function getExerciseTitle(): ?string
26
    {
27
        if (!empty($this->data['exercise']['title'])) {
28
            return $this->data['exercise']['title'];
29
        }
30
31
        return null;
32
    }
33
34
    public function getQuestionId(): ?int
35
    {
36
        if (!empty($this->data['question']['id'])) {
37
            return $this->data['question']['id'];
38
        }
39
40
        return null;
41
    }
42
43
    public function getQuestionWeigth(): ?float
44
    {
45
        if (!empty($this->data['question']['weight'])) {
46
            return $this->data['question']['weight'];
47
        }
48
49
        return null;
50
    }
51
}
52