Completed
Push — master ( fefec9...56b8a6 )
by Beñat
10s
created

FileRenamed::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 5
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 5
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 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 renamed domain event class.
17
 *
18
 * @author Beñat Espiña <[email protected]>
19
 */
20 View Code Duplication
class FileRenamed implements FileEvent
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
21
{
22
    /**
23
     * The file id.
24
     *
25
     * @var FileId
26
     */
27
    private $id;
28
29
    /**
30
     * The occurred on.
31
     *
32
     * @var \DateTimeImmutable
33
     */
34
    private $occurredOn;
35
36
    /**
37
     * Constructor.
38
     *
39
     * @param FileId $aFileId The file id
40
     */
41
    public function __construct(FileId $aFileId)
42
    {
43
        $this->id = $aFileId;
44
        $this->occurredOn = new \DateTimeImmutable();
45
    }
46
47
    /**
48
     * Gets the file id.
49
     *
50
     * @return FileId
51
     */
52
    public function id()
53
    {
54
        return $this->id;
55
    }
56
57
    /**
58
     * Gets the occurred on.
59
     *
60
     * @return \DateTimeImmutable
61
     */
62
    public function occurredOn()
63
    {
64
        return $this->occurredOn;
65
    }
66
}
67