FileEntry::getSize()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
namespace kalanis\kw_input\Entries;
4
5
6
use kalanis\kw_input\Interfaces;
7
8
9
/**
10
 * Class FileEntry
11
 * @package kalanis\kw_input\Entries
12
 * Input is file and has extra values
13
 */
14
class FileEntry extends Entry implements Interfaces\IFileEntry
15
{
16
    protected string $mimeType = '';
17
    protected string $tmpName = '';
18
    protected int $error = 0;
19
    protected int $size = 0;
20
21 6
    public function setFile(string $fileName, string $tmpName, string $mimeType, int $error, int $size): self
22
    {
23 6
        $this->value = $fileName;
24 6
        $this->mimeType = $mimeType;
25 6
        $this->tmpName = $tmpName;
26 6
        $this->error = $error;
27 6
        $this->size = $size;
28 6
        return $this;
29
    }
30
31 6
    public function getSource(): string
32
    {
33 6
        return static::SOURCE_FILES;
34
    }
35
36 3
    public function getMimeType(): string
37
    {
38 3
        return $this->mimeType;
39
    }
40
41 3
    public function getTempName(): string
42
    {
43 3
        return $this->tmpName;
44
    }
45
46 2
    public function getError(): int
47
    {
48 2
        return $this->error;
49
    }
50
51 3
    public function getSize(): int
52
    {
53 3
        return $this->size;
54
    }
55
}
56