Passed
Push — master ( 287e14...bd04cd )
by
unknown
15:08
created

AfterFileCopiedEvent::getNewFileIdentifier()   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
declare(strict_types=1);
4
5
/*
6
 * This file is part of the TYPO3 CMS project.
7
 *
8
 * It is free software; you can redistribute it and/or modify it under
9
 * the terms of the GNU General Public License, either version 2
10
 * of the License, or any later version.
11
 *
12
 * For the full copyright and license information, please read the
13
 * LICENSE.txt file that was distributed with this source code.
14
 *
15
 * The TYPO3 project - inspiring people to share!
16
 */
17
18
namespace TYPO3\CMS\Core\Resource\Event;
19
20
use TYPO3\CMS\Core\Resource\FileInterface;
21
use TYPO3\CMS\Core\Resource\Folder;
22
23
/**
24
 * This event is fired after a file was copied within a Resource Storage / Driver.
25
 * The folder represents the "target folder".
26
 *
27
 * Example: Listeners can sign up for listing duplicates using this event.
28
 */
29
final class AfterFileCopiedEvent
30
{
31
    /**
32
     * @var FileInterface
33
     */
34
    private $file;
35
36
    /**
37
     * @var Folder
38
     */
39
    private $folder;
40
41
    /**
42
     * @var string
43
     */
44
    private $newFileIdentifier;
45
46
    /**
47
     * @var FileInterface|null
48
     */
49
    private $newFile;
50
51
    public function __construct(FileInterface $file, Folder $folder, string $newFileIdentifier, ?FileInterface $newFile)
52
    {
53
        $this->file = $file;
54
        $this->folder = $folder;
55
        $this->newFileIdentifier = $newFileIdentifier;
56
        $this->newFile = $newFile;
57
    }
58
59
    public function getFile(): FileInterface
60
    {
61
        return $this->file;
62
    }
63
64
    public function getFolder(): Folder
65
    {
66
        return $this->folder;
67
    }
68
69
    public function getNewFileIdentifier(): string
70
    {
71
        return $this->newFileIdentifier;
72
    }
73
74
    public function getNewFile(): ?FileInterface
75
    {
76
        return $this->newFile;
77
    }
78
}
79