Completed
Push — master ( 96018c...1e39ad )
by Beñat
02:13
created

FileUploaded   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 66
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 66
rs 10
c 1
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A id() 0 4 1
A name() 0 4 1
A occurredOn() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the BenGorFile package.
5
 *
6
 * (c) Beñat Espiña <[email protected]>
7
 * (c) Gorka Laucirica <[email protected]>
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
namespace BenGorFile\File\Domain\Model;
14
15
/**
16
 * File uploaded domain event class.
17
 *
18
 * @author Beñat Espiña <[email protected]>
19
 * @author Gorka Laucirica <[email protected]>
20
 */
21
class FileUploaded implements FileEvent
22
{
23
    /**
24
     * The file id.
25
     *
26
     * @var FileId
27
     */
28
    private $id;
29
30
    /**
31
     * The file name.
32
     *
33
     * @var FileName
34
     */
35
    private $name;
36
37
    /**
38
     * The occurred on.
39
     *
40
     * @var \DateTimeImmutable
41
     */
42
    private $occurredOn;
43
44
    /**
45
     * Constructor.
46
     *
47
     * @param FileId   $aFileId The file id
48
     * @param FileName $aName   The file name
49
     */
50
    public function __construct(FileId $aFileId, FileName $aName)
51
    {
52
        $this->id = $aFileId;
53
        $this->name = $aName;
54
        $this->occurredOn = new \DateTimeImmutable();
55
    }
56
57
    /**
58
     * Gets the file id.
59
     *
60
     * @return FileId
61
     */
62
    public function id()
63
    {
64
        return $this->id;
65
    }
66
67
    /**
68
     * Gets the file name.
69
     *
70
     * @return FileName
71
     */
72
    public function name()
73
    {
74
        return $this->name;
75
    }
76
77
    /**
78
     * Gets the occurred on.
79
     *
80
     * @return \DateTimeImmutable
81
     */
82
    public function occurredOn()
83
    {
84
        return $this->occurredOn;
85
    }
86
}
87