Passed
Push — master ( 6506fa...b67d4f )
by Angel Fernando Quiroz
07:50
created

DocumentItemViewEvent   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 17
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getDocument() 0 3 1
A addLink() 0 5 1
A getLinks() 0 3 1
1
<?php
2
3
/* For licensing terms, see /license.txt */
4
5
declare(strict_types=1);
6
7
namespace Chamilo\CoreBundle\Event;
8
9
use Chamilo\CourseBundle\Entity\CDocument;
10
11
class DocumentItemViewEvent extends AbstractEvent
12
{
13
    public function getDocument(): ?CDocument
14
    {
15
        return $this->data['document'] ?? null;
16
    }
17
18
    public function addLink(string $link): static
19
    {
20
        $this->data['links'][] = $link;
21
22
        return $this;
23
    }
24
25
    public function getLinks(): array
26
    {
27
        return $this->data['links'] ?? [];
28
    }
29
}
30